pancake 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pancake/stack/bootloader.rb +3 -13
- data/lib/pancake/stack/stack.rb +19 -3
- metadata +2 -2
@@ -24,17 +24,7 @@ Pancake::Stack::BootLoader.add(:load_mounted_inits, :level => :init) do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
Pancake::Stack::BootLoader.add(:
|
28
|
-
def run!
|
29
|
-
return unless config[:master]
|
30
|
-
roots = stack_class.roots.dup
|
31
|
-
roots.each do |root|
|
32
|
-
stack_class.roots << File.join(root, "master")
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
Pancake::Stack::BootLoader.add(:load_configuration) do
|
27
|
+
Pancake::Stack::BootLoader.add(:load_configuration, :level => :init) do
|
38
28
|
def run!
|
39
29
|
stack_class.roots.each do |root|
|
40
30
|
stack_class.paths_for(:config).each{|f| require f.join}
|
@@ -42,7 +32,7 @@ Pancake::Stack::BootLoader.add(:load_configuration) do
|
|
42
32
|
end
|
43
33
|
end
|
44
34
|
|
45
|
-
Pancake::Stack::BootLoader.add(:load_application) do
|
35
|
+
Pancake::Stack::BootLoader.add(:load_application, :level => :init) do
|
46
36
|
def run!
|
47
37
|
stack_class.roots.each do |root|
|
48
38
|
[:models, :controllers].each do |type|
|
@@ -63,7 +53,7 @@ end
|
|
63
53
|
#
|
64
54
|
|
65
55
|
|
66
|
-
Pancake::Stack::BootLoader.add(:load_routes) do
|
56
|
+
Pancake::Stack::BootLoader.add(:load_routes, :level => :init) do
|
67
57
|
def run!
|
68
58
|
stack_class.roots.each do |root|
|
69
59
|
stack_class.paths_for(:router).each{|f| require f.join}
|
data/lib/pancake/stack/stack.rb
CHANGED
@@ -18,11 +18,14 @@ module Pancake
|
|
18
18
|
|
19
19
|
|
20
20
|
#Iterates the list of roots in the stack, and initializes the app found their
|
21
|
-
def self.initialize_stack
|
21
|
+
def self.initialize_stack(opts = {})
|
22
22
|
raise "Stack root not set" if roots.empty?
|
23
|
-
|
23
|
+
master = opts.delete(:master)
|
24
|
+
set_as_master! if master
|
24
25
|
# Run any :init level bootloaders for this stack
|
25
26
|
self::BootLoader.run!(:stack_class => self, :only => {:level => :init})
|
27
|
+
# Pick up any new stacks added during the boot process.
|
28
|
+
set_as_master! if master
|
26
29
|
|
27
30
|
@initialized = true
|
28
31
|
end # initiailze stack
|
@@ -44,7 +47,10 @@ module Pancake
|
|
44
47
|
|
45
48
|
def initialize(app = nil, opts = {})
|
46
49
|
@app_name = opts.delete(:app_name) || self.class
|
47
|
-
|
50
|
+
|
51
|
+
master = opts.delete(:master)
|
52
|
+
self.class.initialize_stack(:master => master) unless self.class.initialized?
|
53
|
+
self.class.set_as_master! if master
|
48
54
|
Pancake.configuration.stacks[@app_name] = self
|
49
55
|
|
50
56
|
# setup the configuration for this stack
|
@@ -128,6 +134,16 @@ module Pancake
|
|
128
134
|
end
|
129
135
|
end
|
130
136
|
|
137
|
+
# Sets this as a master stack. This means that the "master" directory will be added to all existing stack roots
|
138
|
+
def self.set_as_master!
|
139
|
+
# Want to add master to the roots for this stack only
|
140
|
+
roots.dup.each do |root|
|
141
|
+
unless root =~ /master\/?$/
|
142
|
+
roots << File.join(root, 'master')
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
131
147
|
# Creates a bootloader hook(s) of the given name. That are inheritable
|
132
148
|
# This will create hooks for use in a bootloader (but will not create the bootloader itself!)
|
133
149
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pancake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Neighman
|
@@ -9,7 +9,7 @@ autorequire: pancake
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-15 00:00:00 +11:00
|
13
13
|
default_executable: pancake-gen
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|