Sha256: f654a33ed7e1b0123d89f97e7097a2684f0b1209a00da4e9f3f712ee6aa3c232

Contents?: true

Size: 1.05 KB

Versions: 11

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

11 entries across 11 versions & 1 rubygems

Version Path
encbs-0.2.5.1 lib/encbsconfig.rb
encbs-0.2.5 lib/encbsconfig.rb
encbs-0.2.4.6 lib/encbsconfig.rb
encbs-0.2.4.5 lib/encbsconfig.rb
encbs-0.2.4.4 lib/encbsconfig.rb
encbs-0.2.4.3 lib/encbsconfig.rb
encbs-0.2.4.2 lib/encbsconfig.rb
encbs-0.2.4.1 lib/encbsconfig.rb
encbs-0.2.4 lib/encbsconfig.rb
encbs-0.2.3 lib/encbsconfig.rb
encbs-0.2.2 lib/encbsconfig.rb