Class: Mitt::CLI
- Inherits:
-
Object
- Object
- Mitt::CLI
- Defined in:
- lib/mitt/cli.rb
Instance Method Summary collapse
-
#initialize(arguments) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(arguments) ⇒ CLI
Returns a new instance of CLI.
7 8 9 |
# File 'lib/mitt/cli.rb', line 7 def initialize(arguments) @arguments = arguments end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mitt/cli.rb', line 11 def run if help_command? print_usage return end port, body = read_args app = Mitt::App.new(body) # Suppress thin's normal startup message Thin::Logging.silent = true puts "Mitt is listening on port #{port}" Rack::Handler::Thin.run app, Port: port rescue InvalidArguments print_usage end |