Class: StaticSync::Config
- Inherits:
-
Hash
- Object
- Hash
- StaticSync::Config
- Defined in:
- lib/static_sync/config.rb
Instance Method Summary collapse
- #cache ⇒ Object
- #gzip ⇒ Object
- #load(path = '.static') ⇒ Object
- #log ⇒ Object
- #source ⇒ Object
- #storage ⇒ Object
- #storage_directory ⇒ Object
Instance Method Details
#cache ⇒ Object
10 11 12 |
# File 'lib/static_sync/config.rb', line 10 def cache self.fetch('cache', {}) end |
#gzip ⇒ Object
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 |
#log ⇒ Object
6 7 8 |
# File 'lib/static_sync/config.rb', line 6 def log self.fetch('log', true) end |
#source ⇒ Object
14 15 16 |
# File 'lib/static_sync/config.rb', line 14 def source self['local']['directory'] end |
#storage ⇒ Object
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_directory ⇒ Object
26 27 28 |
# File 'lib/static_sync/config.rb', line 26 def storage_directory self['remote']['directory'] end |