Class: Legion::CLI::LexGenerator
- Inherits:
-
Object
- Object
- Legion::CLI::LexGenerator
- Defined in:
- lib/legion/cli/lex_command.rb
Overview
Thin generator class that wraps the template logic
Instance Method Summary collapse
- #generate(out) ⇒ Object
-
#initialize(name, vars, options, gem_name: nil, template: 'basic') ⇒ LexGenerator
constructor
A new instance of LexGenerator.
Constructor Details
#initialize(name, vars, options, gem_name: nil, template: 'basic') ⇒ LexGenerator
Returns a new instance of LexGenerator.
464 465 466 467 468 469 470 471 |
# File 'lib/legion/cli/lex_command.rb', line 464 def initialize(name, vars, , gem_name: nil, template: 'basic') @name = name @vars = vars @options = @gem_name = gem_name || "lex-#{name}" @target = @gem_name @template = template || 'basic' end |
Instance Method Details
#generate(out) ⇒ Object
473 474 475 476 477 478 |
# File 'lib/legion/cli/lex_command.rb', line 473 def generate(out) create_structure(out) (out) unless @template == 'basic' init_git(out) if @options[:git_init] run_bundle(out) if @options[:bundle_install] end |