lib/garufa/garufa_app.rb
# Extend goliath options with our own options.
Extend goliath options with our own options.
Extend goliath options with our own options .
def options_parser(opts, options)
      options[:port] = DEFAULT_PORT
      opts.on('-V', '--version', 'Display version and exit') { puts "Garufa version #{Garufa::VERSION}"; exit }
      opts.separator ""
      opts.separator "Pusher options:"
      new_options = {
        app_id:  ['--app_id APP_ID',   'Pusher application ID (required)'],
        app_key: ['--app_key APP_KEY', 'Pusher application key (required)'],
        secret:  ['--secret SECRET',   'Pusher application secret (required)']
      }
      new_options.each do |k, v|
        opts.on(v.first, v.last) { |value| Garufa::Config[k] = value }
      end
      opts.on('--enable-client-events', 'Enable client events (default: false)') {
        Garufa::Config[:client_events_enabled] = true
      }
    end
def options_parser ( opts , options ) options [ :port ] = DEFAULT_PORT opts . on ( '-V' , '--version' , 'Display version and exit' ) { puts "Garufa version #{Garufa::VERSION}" ; exit } opts . separator "" opts . separator "Pusher options:" new_options = { app_id : [ '--app_id APP_ID' , 'Pusher application ID (required)' ] , app_key : [ '--app_key APP_KEY' , 'Pusher application key (required)' ] , secret : [ '--secret SECRET' , 'Pusher application secret (required)' ] } new_options . each do | k , v | opts . on ( v . first , v . last ) { | value | Garufa :: Config [ k ] = value } end opts . on ( '--enable-client-events' , 'Enable client events (default: false)' ) { Garufa :: Config [ :client_events_enabled ] = true } end
Extend goliath options with our own options.
Extend goliath options with our own options .
opts
<not_specific>
options
<not_specific>