Class: ClassicApi::Command::Base
- Inherits:
-
Thor
- Object
- Thor
- ClassicApi::Command::Base
- Defined in:
- lib/classic_api/command/base.rb
Class Method Summary collapse
- .api ⇒ Object
-
.handle_argument_error(command, error, args, arity) ⇒ Object
:nodoc:.
- .start(given_args = ARGV, config = {}) ⇒ Object
Class Method Details
.api ⇒ Object
21 22 23 |
# File 'lib/classic_api/command/base.rb', line 21 def api ClassicApi end |
.handle_argument_error(command, error, args, arity) ⇒ Object
:nodoc:
13 14 15 16 17 18 19 |
# File 'lib/classic_api/command/base.rb', line 13 def handle_argument_error(command, error, args, arity) #:nodoc: = "#{basename} #{command.name} was called with " << "no arguments" if args.empty? << "arguments " << args.inspect unless args.empty? Util::Format.print_error("Invalid Arguments", ) Util::Format.print_info("USAGE", (command).inspect) end |
.start(given_args = ARGV, config = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/classic_api/command/base.rb', line 5 def start(given_args = ARGV, config = {}) config[:shell] ||= Thor::Base.shell.new dispatch(nil, given_args.dup, nil, config) rescue StandardError => e Util::Format.show_error(e) exit(1) end |