Class: Abstract

Inherits:
Object show all
Defined in:
lib/rad/configurators/abstract.rb

Direct Known Subclasses

Runtime, Web

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Abstract

Returns a new instance of Abstract.



4
5
6
# File 'lib/rad/configurators/abstract.rb', line 4

def initialize dir
  @dir = File.expand_path(dir)
end

Instance Method Details

#localesObject



17
18
19
20
# File 'lib/rad/configurators/abstract.rb', line 17

def locales
  I18n.load_path += Dir["#{dir}/config/locales/**/*.{rb,yml}"]
  I18n.load_path += Dir["#{dir}/config/locales/*.{rb,yml}"]
end

#routesObject

def config options = {}

rad.config.merge_config! "#{dir}/config/config.yml", options

end



12
13
14
15
# File 'lib/rad/configurators/abstract.rb', line 12

def routes
  routes_file = "#{dir}/config/routes.rb"
  load routes_file if File.exist? routes_file
end