Class: Locomotive::Wagon::GenerateCommand

Inherits:
Struct
  • Object
show all
Defined in:
lib/locomotive/wagon/commands/generate_command.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



3
4
5
# File 'lib/locomotive/wagon/commands/generate_command.rb', line 3

def args
  @args
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



3
4
5
# File 'lib/locomotive/wagon/commands/generate_command.rb', line 3

def name
  @name
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



3
4
5
# File 'lib/locomotive/wagon/commands/generate_command.rb', line 3

def options
  @options
end

Class Method Details

.generate(name, args, options) ⇒ Object



5
6
7
# File 'lib/locomotive/wagon/commands/generate_command.rb', line 5

def self.generate(name, args, options)
  new(name, args, options).generate
end

Instance Method Details

#generateObject



9
10
11
12
13
14
15
16
# File 'lib/locomotive/wagon/commands/generate_command.rb', line 9

def generate
  Locomotive::Wagon.require_misc_gems
  
  generator = generator_klass.new(args, options, { behavior: :skip })
  generator.destination_root = args.last
  generator.force_color_if_asked(options)
  generator.invoke_all
end