Class: Shacho::Runner
- Inherits:
-
Object
- Object
- Shacho::Runner
- Defined in:
- lib/shacho/runner.rb
Class Method Summary collapse
-
.delegate_command(options) ⇒ Object
TODO include active support?.
- .error(message) ⇒ Object
- .parse_options(args) ⇒ Object
- .run!(*args) ⇒ Object
Class Method Details
.delegate_command(options) ⇒ Object
TODO include active support?
27 28 29 30 31 32 33 |
# File 'lib/shacho/runner.rb', line 27 def delegate_command() if ["action"] == "help" Shacho::Util.help else Shacho::Account.send(["action"], ["params"]) end end |
.error(message) ⇒ Object
22 23 24 |
# File 'lib/shacho/runner.rb', line 22 def error() raise RuntimeError, end |
.parse_options(args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/shacho/runner.rb', line 10 def (args) = {} value = args.shift if COMMANDS.include?(value) ["action"] = value else error "Run shacho help for usage" end ["params"] = args return end |
.run!(*args) ⇒ Object
4 5 6 7 8 |
# File 'lib/shacho/runner.rb', line 4 def run!(*args) = (args) delegate_command() return 0 end |