Sha256: 2eb3a1edeee64b577ea5b454db218a690fe8e23c44620da211f65a2cec3c0f22

Contents?: true

Size: 920 Bytes

Versions: 7

Compression:

Stored size: 920 Bytes

Contents

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

  RBConfig = Config

  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

7 entries across 7 versions & 1 rubygems

Version Path
nfagent-0.9.13 lib/nfagent/config.rb
nfagent-0.9.11 lib/nfagent/config.rb
nfagent-0.9.10 lib/nfagent/config.rb
nfagent-0.9.9 lib/nfagent/config.rb
nfagent-0.9.8 lib/nfagent/config.rb
nfagent-0.9.6 lib/nfagent/config.rb
nfagent-0.9.5 lib/nfagent/config.rb