Class: TrustyCms::Boot

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/instance/templates/instance_boot.rb

Direct Known Subclasses

AppBoot, GemBoot, VendorBoot

Instance Method Summary collapse

Instance Method Details

#load_initializerObject



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/generators/instance/templates/instance_boot.rb', line 77

def load_initializer
  begin
    require 'trusty_cms'
    require 'trusty_cms/initializer'
  rescue LoadError => e
    $stderr.puts %(TrustyCms could not be initialized. #{load_error_message})
    exit 1
  end
  TrustyCms::Initializer.run(:set_load_path)
  TrustyCms::Initializer.run(:install_gem_spec_stubs)
  Rails::GemDependency.add_frozen_gem_path
end

#load_mutexObject

RubyGems from version 1.6 does not require thread but Rails depend on it This should newer rails do automaticly



68
69
70
71
72
73
74
75
# File 'lib/generators/instance/templates/instance_boot.rb', line 68

def load_mutex
  begin
    require "thread" unless defined?(Mutex)
  rescue LoadError => e
    $stderr.puts %(Mutex could not be initialized. #{load_error_message})
    exit 1
  end
end

#runObject



61
62
63
64
# File 'lib/generators/instance/templates/instance_boot.rb', line 61

def run
  load_mutex
  load_initializer
end