Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (22 sloc) 0.824 kb
module Daikon
class Configuration
FLAGS = %w[-h -p -k -f -s]
OPTIONS = %w[redis_host redis_port api_key field_id server_prefix]
DEFAULTS = %w[127.0.0.1 6379 1234567890 1 https://radishapp.com]
attr_accessor *OPTIONS
def initialize(argv = [])
FLAGS.each_with_index do |flag, flag_index|
argv_index = argv.index(flag)
value = if argv_index
argv[argv_index + 1]
else
DEFAULTS[flag_index]
end
send "#{OPTIONS[flag_index]}=", value
end
if api_key == DEFAULTS[2] && argv.any? { |arg| arg =~ /start|run/ }
abort "Must supply an api key to start the daemon.\nExample: daikon start #{FLAGS[2]} #{DEFAULTS[2]}"
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.