lib/encbsconfig.rb in encbs-0.1.3 vs lib/encbsconfig.rb in encbs-0.2.0.alpha

- old
+ new

@@ -1,23 +1,23 @@ class EncbsConfig - attr_reader :paths, :bucket, :colorize, :hostname, :increment, :key, - :secret, :token, :verbose + attr_reader :paths, :bucket, :colorize, :compression, :hostname, :increment, + :key, :secret, :size, :token, :timeout, :verbose def initialize @paths = "" end def load(path) - [:bucket, :colorize, :hostname, :increment, :key, :secret, - :token, :verbose].each {|attr| eval "@#{attr} = nil"} + [:bucket, :colorize, :compression, :hostname, :increment, :key, :secret, + :size, :token, :timeout, :verbose].each {|attr| eval "@#{attr} = nil"} @paths = "" - eval "#{open(path).read}" + instance_eval "#{open(path).read}" end - def use_hostname(attr) + def use_hostname attr @hostname = attr end def add(attr) @paths += " #{attr}" @@ -25,29 +25,41 @@ def colorize! @colorize = true end - def public_key(attr) + def public_key attr @token = attr end def increment! @increment = true end + + def use_compression attr + @compression = attr + end - def aws_key(attr) + def aws_key attr @key = attr end - def aws_secret(attr) + def aws_secret attr @secret = attr end - def aws_bucket(attr) + 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 end