Class: Bricolage::ConfigLoader
- Inherits:
-
Object
- Object
- Bricolage::ConfigLoader
- Includes:
- EmbeddedCodeAPI
- Defined in:
- lib/bricolage/configloader.rb
Direct Known Subclasses
Constant Summary
Constants included from VacuumLock
VacuumLock::DEFAULT_VACUUM_LOCK_FILE, VacuumLock::DEFAULT_VACUUM_LOCK_TIMEOUT
Instance Method Summary collapse
- #eruby(text, path) ⇒ Object
-
#initialize(app_home) ⇒ ConfigLoader
constructor
A new instance of ConfigLoader.
- #load_text(path) ⇒ Object
- #load_yaml(path) ⇒ Object
Methods included from VacuumLock
cleanup_vacuum_lock, create_lockfile_cmd, create_vacuum_lock_file, enable_vacuum_lock?, locking?, psql_serialize_vacuum_begin, psql_serialize_vacuum_end, serialize_vacuum, using, #using_vacuum_lock, vacuum_lock_parameters
Constructor Details
#initialize(app_home) ⇒ ConfigLoader
Returns a new instance of ConfigLoader.
13 14 15 16 |
# File 'lib/bricolage/configloader.rb', line 13 def initialize(app_home) @app_home = app_home @base_dir = Pathname('.') end |
Instance Method Details
#eruby(text, path) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/bricolage/configloader.rb', line 26 def eruby(text, path) erb = ERB.new(text, nil, '%-') erb.filename = path.to_s push_base_dir(path) { erb.result(binding()) } end |
#load_text(path) ⇒ Object
22 23 24 |
# File 'lib/bricolage/configloader.rb', line 22 def load_text(path) eruby(read_file(path), path) end |
#load_yaml(path) ⇒ Object
18 19 20 |
# File 'lib/bricolage/configloader.rb', line 18 def load_yaml(path) parse_yaml(load_text(path), path) end |