Class: Fuguta::Configuration::DSLProxy
- Inherits:
-
Object
- Object
- Fuguta::Configuration::DSLProxy
- Defined in:
- lib/fuguta.rb
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(subject) ⇒ DSLProxy
constructor
A new instance of DSLProxy.
-
#load(*paths) ⇒ Object
Load separate configuration files from the file.
Constructor Details
#initialize(subject) ⇒ DSLProxy
Returns a new instance of DSLProxy.
104 105 106 107 108 |
# File 'lib/fuguta.rb', line 104 def initialize(subject) @subject = subject @config = subject.config @loading_path = nil end |
Instance Method Details
#config ⇒ Object
110 111 112 |
# File 'lib/fuguta.rb', line 110 def config self end |
#load(*paths) ⇒ Object
Load separate configuration files from the file.
Load relative path file.
load 'test2.conf'
Load absolute path file.
load '/etc/test2.conf'
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/fuguta.rb', line 123 def load(*paths) l = Loader.new(@subject) paths.each { |path| if path =~ %r{^/} # Load absolute path l.load(path) else # Load relative path base_conf_dir = (@loading_path.nil? ? Dir.pwd : File.dirname(@loading_path)) l.load(File.(path, base_conf_dir)) end } self end |