class Fuguta::Configuration::DSLProxy

Public Class Methods

new(subject) click to toggle source
# File lib/fuguta.rb, line 103
def initialize(subject)
  @subject = subject
  @config = subject.config
  @loading_path = nil
end

Public Instance Methods

config() click to toggle source
# File lib/fuguta.rb, line 109
def config
  self
end
load(*paths) click to toggle source

Load separate configuration files from the file.

Load relative path file.


load 'test2.conf'

Load absolute path file.


load '/etc/test2.conf'
# File lib/fuguta.rb, line 122
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.expand_path(path, base_conf_dir))
    end
  }

  self
end