Class: DevOops::Runner

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/dev_oops/runner.rb

Constant Summary collapse

REGISTERED_CLASS_METHODS =

rubocop:disable Style/MutableConstant

{}
CONFIG_DIR =
"#{ENV['HOME']}/.dev_oops"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.register(klass, subcommand_name, usage, description, options = {}) ⇒ Object



14
15
16
17
# File 'lib/dev_oops/runner.rb', line 14

def self.register(klass, subcommand_name, usage, description, options = {})
  REGISTERED_CLASS_METHODS[subcommand_name] = klass if klass <= Thor::Group
  super
end

.source_rootObject



10
11
12
# File 'lib/dev_oops/runner.rb', line 10

def self.source_root
  "#{File.dirname(__FILE__)}/.."
end

Instance Method Details

#help(subcommand = nil) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/dev_oops/runner.rb', line 51

def help(subcommand = nil)
  if subcommand && respond_to?(subcommand)
    klass = REGISTERED_CLASS_METHODS[subcommand]
    klass.start(['-h'])
  else
    super
  end
end