Method: Closync::Config#initialize

Defined in:
lib/closync/config.rb

#initialize(opts = {}) ⇒ Config

Returns a new instance of Config.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/closync/config.rb', line 13

def initialize(opts={})
  self.credentials    = {}
  self.storage        = {}
  self.cache_control  = {}
  self.branch         = []

  @yml_path = ( opts[:yml_path] || "#{Dir.pwd}/.closync.yml" )

  if self.yml_exists?
    load_yml!
  else
    raise "Config file not found at #{opts[:yml_path]}" if opts[:yml_path]
  end
end