Method: Perquackey::Application#initialize
- Defined in:
- lib/perquackey/application.rb
#initialize ⇒ Application
Returns a new instance of Application.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/perquackey/application.rb', line 9 def initialize = OptionParser.with_defaults do |opts| opts. = "Usage: #{File.basename($0)} [-c|-s]" opts.defaults = %w(--console) opts.version = Perquackey::VERSION opts.separator '' opts.on('-c', '--console', 'Run an interactive console.') do @mode = :console end opts.on('-s', '--server[=port]', 'Run an http server.') do |port| @mode = :server @port = port || 3000 end end end |