Class: Locomotive::Wagon::InitCommand

Inherits:
Struct
  • Object
show all
Defined in:
lib/locomotive/wagon/commands/init_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/init_command.rb', line 3

def args
  @args
end

#generator_klassObject

Returns the value of attribute generator_klass

Returns:

  • (Object)

    the current value of generator_klass



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

def generator_klass
  @generator_klass
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



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

def options
  @options
end

Class Method Details

.generate(klass, args, options) ⇒ Object



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

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

Instance Method Details

#generateObject



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

def generate
  args, opts = Thor::Options.split(self.args)

  generator = generator_klass.new(args, opts, {})
  generator.force_color_if_asked(options)
  generator.invoke_all
end