Module: Herbert::Configurator
- Defined in:
- lib/herbert/Configurator.rb
Defined Under Namespace
Modules: Helpers, Prepatch
Class Method Summary
collapse
Class Method Details
.registered(app) ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/herbert/Configurator.rb', line 36
def self.registered(app)
app.enable :logging if app.development?
puts app.settings.root
app.settings.root ||= File.join(Dir.getwd, 'lib')
path = File.join(app.settings.root, 'config')
['common.rb', app.environment.to_s + '.rb'].each do |file|
cpath = File.join(path, file)
if File.exists?(cpath) then
app.instance_eval(IO.read(cpath))
log.h_debug("Applying #{cpath} onto the application")
else
log.h_warn("Configuration file #{cpath} not found")
end
end
end
|