Module: Rails
- Defined in:
- lib/picolena/templates/config/boot.rb
Overview
Defined Under Namespace
Classes: Boot, GemBoot, VendorBoot
Class Method Summary
collapse
Class Method Details
8
9
10
11
12
13
|
# File 'lib/picolena/templates/config/boot.rb', line 8
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
|
.booted? ⇒ Boolean
15
16
17
|
# File 'lib/picolena/templates/config/boot.rb', line 15
def booted?
defined? Rails::Initializer
end
|
.pick_boot ⇒ Object
19
20
21
|
# File 'lib/picolena/templates/config/boot.rb', line 19
def pick_boot
(vendor_rails? ? VendorBoot : GemBoot).new
end
|
.preinitialize ⇒ Object
28
29
30
|
# File 'lib/picolena/templates/config/boot.rb', line 28
def preinitialize
load(preinitializer_path) if File.exists?(preinitializer_path)
end
|
.preinitializer_path ⇒ Object
32
33
34
|
# File 'lib/picolena/templates/config/boot.rb', line 32
def preinitializer_path
"#{RAILS_ROOT}/config/preinitializer.rb"
end
|
.vendor_rails? ⇒ Boolean
23
24
25
|
# File 'lib/picolena/templates/config/boot.rb', line 23
def vendor_rails?
File.exist?("#{RAILS_ROOT}/vendor/rails")
end
|