Class: ArcWeld::WeldCli
- Inherits:
-
Thor
- Object
- Thor
- ArcWeld::WeldCli
- Includes:
- Thor::Actions
- Defined in:
- lib/arc_weld/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
12 13 14 15 |
# File 'lib/arc_weld/cli.rb', line 12 def self.source_root @source_root ||= File.join( File.dirname( File.(__FILE__) ), 'templates') end |
Instance Method Details
#generate(filename = 'model.xml') ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/arc_weld/cli.rb', line 38 def generate(filename='model.xml') config = JSON.parse(File.read([:config])) project = ArcWeld::Cli::Project.new(config) outfile = File.join(project.output_dir, filename) archive = project.generate_archive File.open(outfile,'w') {|f| f.puts archive.xml.to_s } end |
#new(name) ⇒ Object
31 32 33 34 35 |
# File 'lib/arc_weld/cli.rb', line 31 def new(name) self.destination_root = [:dir] @config = .merge(name: name) directory(format('project-%s',[:driver]),name) end |