Sha256: 07cc13650f58579cc259038dfd7f4c0201ac9742dc38af0f32281ede3b921c88

Contents?: true

Size: 790 Bytes

Versions: 1

Compression:

Stored size: 790 Bytes

Contents

class EncbsConfig
  attr_reader :paths, :bucket, :colorize, :hostname, :increment, :key,
              :secret, :token, :verbose

  def initialize
    @paths = ""
  end

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

    @paths = ""

    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 aws_key(attr)
    @key = attr
  end

  def aws_secret(attr)
    @secret = attr
  end

  def aws_bucket(attr)
    @bucket = attr
  end

  def verbose!
    @verbose = true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
encbs-0.1.3 lib/encbsconfig.rb