Configuration::ClassMethods

Public Instance Methods

for(name, options = nil, &block) click to toggle source
    # File lib/configuration.rb, line 18
18:     def for name, options = nil, &block
19:       name = name.to_s
20:       if Table.has_key?(name)
21:         if options or block
22:           configuration = Table[name]
23:           Table[name] = DSL.evaluate(configuration, options || {}, &block)
24:         else
25:           Table[name]
26:         end
27:       else
28:         if options or block
29:           Table[name] = new name, options || {}, &block
30:         else
31:           load name
32:         end
33:       end
34:     end
load(name) click to toggle source
    # File lib/configuration.rb, line 46
46:     def load name
47:       name = name.to_s
48:       name = name + '.rb' unless name[/\.rb$/]
49:       key = name.sub /\.rb$/, ''
50:       load_path = $LOAD_PATH.dup
51:       begin
52:         $LOAD_PATH.replace(path + load_path)
53:         ::Kernel.load name
54:       ensure
55:         $LOAD_PATH.replace load_path
56:       end
57:       Table[key]
58:     end
path(*value) click to toggle source
    # File lib/configuration.rb, line 36
36:     def path *value
37:       return self.path = value.first unless value.empty?
38:       Path
39:     end
path=(value) click to toggle source
    # File lib/configuration.rb, line 41
41:     def path= value
42:       Path.clear
43:       Path.replace [value].compact.flatten.join(File::PATH_SEPARATOR).split(File::PATH_SEPARATOR)
44:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.