Module: Rails

Defined in:
lib/picolena/templates/config/boot.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Boot, GemBoot, VendorBoot

Class Method Summary collapse

Class Method Details

.boot!Object



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

Returns:

  • (Boolean)


15
16
17
# File 'lib/picolena/templates/config/boot.rb', line 15

def booted?
  defined? Rails::Initializer
end

.pick_bootObject



19
20
21
# File 'lib/picolena/templates/config/boot.rb', line 19

def pick_boot
  (vendor_rails? ? VendorBoot : GemBoot).new
end

.preinitializeObject

FIXME : Ruby 1.9



28
29
30
# File 'lib/picolena/templates/config/boot.rb', line 28

def preinitialize
  load(preinitializer_path) if File.exists?(preinitializer_path)
end

.preinitializer_pathObject



32
33
34
# File 'lib/picolena/templates/config/boot.rb', line 32

def preinitializer_path
  "#{RAILS_ROOT}/config/preinitializer.rb"
end

.vendor_rails?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/picolena/templates/config/boot.rb', line 23

def vendor_rails?
  File.exist?("#{RAILS_ROOT}/vendor/rails")
end