class VFS::Command::YAMLWriter

vfs yaml file gen cmd

Public Class Methods

new(argv) click to toggle source
Calls superclass method VFS::Command::new
# File lib/yaml-vfs/command/yaml_vfs_writer.rb, line 22
def initialize(argv)
  super
  framework_path = argv.option('framework-path')
  @framework_path = Pathname(framework_path) unless framework_path.nil?
  real_headers_dir = argv.option('real-headers-dir')
  @real_header_dir = Pathname(real_headers_dir) unless real_headers_dir.nil?
  real_modules_dir = argv.option('real-modules-dir')
  @real_modules_dir = Pathname(real_modules_dir) unless real_modules_dir.nil?
  output_path = argv.option('output-path')
  @output_path = output_path.nil? ? Pathname('.') : Pathname(output_path)
end
options() click to toggle source

help

Calls superclass method
# File lib/yaml-vfs/command/yaml_vfs_writer.rb, line 42
def self.options
  [
    ['--framework-path=<path>', 'framework path'],
    ['--real-headers-dir=<path>', 'real header path'],
    ['--real-modules-dir=<path>', 'real modules path'],
    ['--output-path=<path>', 'vfs yaml file output path']
  ].concat(super)
end

Public Instance Methods

run() click to toggle source
# File lib/yaml-vfs/command/yaml_vfs_writer.rb, line 51
def run
  require 'yaml_vfs'

  entry = VFS::FileCollectorEntry.new_from_real_headers_dir(@framework_path, @real_modules_dir, @real_header_dir)
  VFS::FileCollector.new([entry]).write_mapping(@output_path)
end
validate!() click to toggle source
Calls superclass method
# File lib/yaml-vfs/command/yaml_vfs_writer.rb, line 34
def validate!
  super
  help! 'must set framework_path' if @framework_path.nil?
  help! 'must set real_headers_dir' if @real_header_dir.nil?
  help! 'must set real_modules_dir' if @real_modules_dir.nil?
end