Class: App::CLI::Command
- Inherits:
-
Object
- Object
- App::CLI::Command
- Defined in:
- lib/app-cli.rb
Constant Summary collapse
- @@subcommands =
[]
- @@options =
[]
Class Method Summary collapse
Class Method Details
.cascadable ⇒ Object
50 51 52 53 54 |
# File 'lib/app-cli.rb', line 50 def self.cascadable self.subcommands.each do |subcmd| return ARGV[0].capitalize == subcmd && class_defined?(self.to_s+"::"+subcmd) ? self.to_s+"::"+subcmd : nil end end |
.cascading ⇒ Object
43 44 45 46 47 48 |
# File 'lib/app-cli.rb', line 43 def self.cascading if subcmd = self.cascadable ARGV.shift eval(subcmd) end end |
.options ⇒ Object
39 40 41 |
# File 'lib/app-cli.rb', line 39 def self. self.class_variable_defined?(:@@options) ? @@options : [] end |
.subcommands ⇒ Object
35 36 37 |
# File 'lib/app-cli.rb', line 35 def self.subcommands self.class_variable_defined?(:@@subcommands) ? @@subcommands : [] end |