Sha256: 671b9d6026479c78e840ea9d09d059ca9ae20865d3a6991d429b1437df176368

Contents?: true

Size: 899 Bytes

Versions: 3

Compression:

Stored size: 899 Bytes

Contents

module NFAgent
  class Proxy
    attr_accessor :host, :port, :user, :password
  end

  class Config < SVUtil::Config
    @@proxy = Proxy.new

    def self.proxy
      @@proxy
    end

    class << self
      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

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nfagent-0.9.0 lib/nfagent/config.rb
nfagent-0.0.99 lib/nfagent/config.rb
nfagent-0.0.1 lib/nfagent/config.rb