Sha256: d3e9894cb27288e0f359748323d700a91535e9a79425c2f2623332e9f9b5927a

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

class EncbsConfig
  attr_reader :paths, :bucket, :colorize, :compression, :hostname, :increment,
              :key, :purge, :secret, :size, :token, :timeout, :verbose

  def initialize
    @paths = ""
  end

  def load(path)
    [:bucket, :colorize, :compression, :hostname, :increment, :key, :secret,
      :size, :token, :timeout, :verbose].each {|attr| eval "@#{attr} = nil"}

    @paths = ""

    instance_eval "#{open(path).read}"
  end

  def use_hostname attr
    @hostname = attr
  end

  def add(attr)
    @paths += " #{attr}"
  end

  def colorize!
    @colorize = true
  end

  def public_key attr
    @token = attr
  end

  def increment!
    @increment = true
  end
  
  def use_compression attr
    @compression = attr
  end

  def aws_key attr
    @key = attr
  end

  def aws_secret attr
    @secret = attr
  end

  def aws_bucket attr
    @bucket = attr
  end

  def key_size attr
    @size = attr
  end

  def verbose!
    @verbose = true
  end
  
  def set_timeout attr
    @timeout = attr
  end

  def purge!
    @purge = true unless @increment
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
encbs-0.2.1 lib/encbsconfig.rb
encbs-0.2.1.beta2 lib/encbsconfig.rb
encbs-0.2.1.beta1 lib/encbsconfig.rb