Module: Rails

Defined in:
lib/six-updater-web/config/boot.rb,
lib/six-updater-web/config/environment.rb

Defined Under Namespace

Classes: Boot, Configuration, GemBoot, VendorBoot

Class Method Summary collapse

Class Method Details

.boot!Object



10
11
12
13
14
15
# File 'lib/six-updater-web/config/boot.rb', line 10

def boot!
  unless booted?
    preinitialize
    pick_boot.run
  end
end

.booted?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/six-updater-web/config/boot.rb', line 17

def booted?
  defined? Rails::Initializer
end

.pick_bootObject



21
22
23
# File 'lib/six-updater-web/config/boot.rb', line 21

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

.preinitializeObject



29
30
31
# File 'lib/six-updater-web/config/boot.rb', line 29

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

.preinitializer_pathObject



33
34
35
# File 'lib/six-updater-web/config/boot.rb', line 33

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

.vendor_rails?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/six-updater-web/config/boot.rb', line 25

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