class Thor::DynamicCommand

A dynamic command that handles method missing scenarios.

Public Class Methods

new(name, options = nil) click to toggle source
Calls superclass method Thor::Command::new
# File lib/thor/command.rb, line 362
def initialize(name, options = nil)
  super(  name: name.to_s,
          description: "A dynamically-generated command",
          long_description: name.to_s, # why?!
          usage: name.to_s,
          options: options )
end

Public Instance Methods

run(instance, args = []) click to toggle source
Calls superclass method Thor::Command#run
# File lib/thor/command.rb, line 370
def run(instance, args = [])
  if (instance.methods & [name.to_s, name.to_sym]).empty?
    super
  else
    instance.class.handle_no_command_error(name)
  end
end