Class: StaticSync::Config

Inherits:
Hash
  • Object
show all
Defined in:
lib/static_sync/config.rb

Instance Method Summary collapse

Instance Method Details

#cacheObject



10
11
12
# File 'lib/static_sync/config.rb', line 10

def cache
  self.fetch('cache', {})
end

#gzipObject



30
31
32
# File 'lib/static_sync/config.rb', line 30

def gzip
  self['gzip']
end

#load(path = '.static') ⇒ Object



34
35
36
37
# File 'lib/static_sync/config.rb', line 34

def load(path = '.static')
  self.replace(YAML.load_file(ERB.new(path).result))
  self
end

#logObject



6
7
8
# File 'lib/static_sync/config.rb', line 6

def log
  self.fetch('log', true)
end

#sourceObject



14
15
16
# File 'lib/static_sync/config.rb', line 14

def source
  self['local']['directory']
end

#storageObject



18
19
20
21
22
23
24
# File 'lib/static_sync/config.rb', line 18

def storage
  Fog::Storage.new({
    :provider              => self['remote']['provider'],
    :aws_access_key_id     => self['remote']['username'],
    :aws_secret_access_key => self['remote']['password']
  })
end

#storage_directoryObject



26
27
28
# File 'lib/static_sync/config.rb', line 26

def storage_directory
  self['remote']['directory']
end