18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/jun/application.rb', line 18
def initialize!
return false if initialized? || Jun.application.nil?
Jun::ActiveSupport::Dependencies.autoload_paths += Jun.root.join("app").children
require Jun.root.join("config/routes.rb")
url_helpers = Jun.application.routes.url_helpers
Jun::ActionController::Base.include(url_helpers)
Jun::ActionView::Base.include(url_helpers)
Dir.glob(Jun.root.join("app/helpers/**/*.rb")).each do |filepath|
helper_class_name = File.basename(filepath, ".rb").camelize
helper_class = Object.const_get(helper_class_name)
Jun::ActionView::Base.include(helper_class)
end
@initialized = true
end
|