Module: Radiant
- Defined in:
- lib/radiant.rb,
lib/radiant/cache.rb,
lib/radiant/setup.rb,
lib/radiant/admin_ui.rb,
lib/radiant/extension.rb,
lib/radiant/initializer.rb,
app/models/radiant/config.rb,
app/models/radiant/exporter.rb,
lib/radiant/extension/script.rb,
lib/radiant/extension_loader.rb,
lib/radiant/extension_migrator.rb,
lib/radiant/resource_responses.rb,
lib/generators/generator_base_extension.rb,
lib/generators/instance/templates/instance_boot.rb,
lib/plugins/extension_patches/lib/routing_extension.rb
Defined Under Namespace
Modules: Cache, GeneratorBaseExtension, LegacyRoutes, ResourceResponses, RoutingExtension, Taggable, Version
Classes: AdminUI, AppBoot, Boot, Config, Configuration, Exporter, Extension, ExtensionLoader, ExtensionMigrator, GemBoot, Initializer, Setup, VendorBoot
Class Method Summary
collapse
Class Method Details
.app? ⇒ Boolean
42
43
44
|
# File 'lib/generators/instance/templates/instance_boot.rb', line 42
def app?
File.exist?("#{RAILS_ROOT}/lib/radiant.rb")
end
|
16
17
18
19
20
21
|
# File 'lib/generators/instance/templates/instance_boot.rb', line 16
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
|
.booted? ⇒ Boolean
23
24
25
|
# File 'lib/generators/instance/templates/instance_boot.rb', line 23
def booted?
defined? Radiant::Initializer
end
|
.loaded_via_gem? ⇒ Boolean
50
51
52
|
# File 'lib/generators/instance/templates/instance_boot.rb', line 50
def loaded_via_gem?
pick_boot.is_a? GemBoot
end
|
.pick_boot ⇒ Object
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/generators/instance/templates/instance_boot.rb', line 27
def pick_boot
case
when app?
AppBoot.new
when vendor?
VendorBoot.new
else
GemBoot.new
end
end
|
.preinitialize ⇒ Object
46
47
48
|
# File 'lib/generators/instance/templates/instance_boot.rb', line 46
def preinitialize
load(preinitializer_path) if File.exist?(preinitializer_path)
end
|
.preinitializer_path ⇒ Object
54
55
56
|
# File 'lib/generators/instance/templates/instance_boot.rb', line 54
def preinitializer_path
"#{RAILS_ROOT}/config/preinitializer.rb"
end
|
.vendor? ⇒ Boolean
38
39
40
|
# File 'lib/generators/instance/templates/instance_boot.rb', line 38
def vendor?
File.exist?("#{RAILS_ROOT}/vendor/radiant")
end
|