Class: When::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/when-do/cli.rb

Constant Summary collapse

CANONICAL_KEYS =
{
  :sk => :schedule_key,
  :wq => :worker_queue_key,
  :dq => :delayed_queue_key,
  :lp => :log_path,
  :ll => :log_level,
  :c  => :config_path,
  :rc => :redis_config_path,
  :d  => :daemonize,
  :e  => :environment,
  :pf => :pid_file_path
}

Instance Method Summary collapse

Instance Method Details

#initObject



21
22
23
24
25
# File 'lib/when-do/cli.rb', line 21

def init
  cl_opts = canonicalize_keys(argv_to_hash)
  copy_example_config if cl_opts.has_key? :init
  @options = merge_redis_config_file(merge_config_file(cl_opts))
end

#optionsObject



27
28
29
# File 'lib/when-do/cli.rb', line 27

def options
  @options ||= init
end