Class: Cougar::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/cougar/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CLI

Returns a new instance of CLI.



7
8
9
10
11
12
13
14
15
# File 'lib/cougar/cli.rb', line 7

def initialize(argv)
  @argv = argv
  @options = {
    host: "localhost",
    port: 9292,
    config: "config.ru",
    environment: ENV["RACK_ENV"] || "development"
  }
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cougar/cli.rb', line 17

def run
  parse_options!
  
  if @options[:version]
    puts "Cougar version #{Cougar::VERSION}"
    return
  end

  if @options[:help]
    puts @parser
    return
  end

  start_server
end