Class: NFAgent::Config

Inherits:
SVUtil::Config
  • Object
show all
Defined in:
lib/nfagent/config.rb

Constant Summary collapse

@@proxy =
Proxy.new

Class Method Summary collapse

Class Method Details

.process_optionsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/nfagent/config.rb', line 21

def process_options
  parse_options do |opts|
    opts.on("-k", "--client-key [key]", "Service client key") do |key|
      Config.client_key = key
      end
    opts.on("-l", "--debug-log [log-file]", "Debug Log File") do |log|
      Config.log_file = log
    end
    opts.on("-D", "--dump-dir [dir]", "Dump directory for failed chunks") do |dir|
      Config.dump_dir = dir
    end
  end
end

.proxyObject



9
10
11
# File 'lib/nfagent/config.rb', line 9

def self.proxy
  @@proxy
end

.validateObject



14
15
16
17
18
19
# File 'lib/nfagent/config.rb', line 14

def validate
  unless dump_dir and File.exists?(dump_dir) and File.directory?(dump_dir)
    raise "Dump dir (#{dump_dir}) must exist and be a directory"
  end
  super
end