locomotive_plugins 1.0.0.beta8 → 1.0.0.beta9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,13 +89,15 @@ module Locomotive
|
|
89
89
|
def prepared_rack_app
|
90
90
|
app = self.class.rack_app
|
91
91
|
|
92
|
-
|
93
|
-
|
94
|
-
app.
|
95
|
-
|
92
|
+
if app
|
93
|
+
# Extend helper module if needed
|
94
|
+
unless app.singleton_class.included_modules.include?(HelperMethods)
|
95
|
+
app.extend(HelperMethods)
|
96
|
+
end
|
96
97
|
|
97
|
-
|
98
|
-
|
98
|
+
app.plugin_object = self
|
99
|
+
RackAppWrapper.new(app)
|
100
|
+
end
|
99
101
|
end
|
100
102
|
|
101
103
|
end
|
data/lib/version.rb
CHANGED
@@ -13,6 +13,11 @@ module Locomotive
|
|
13
13
|
|
14
14
|
let(:original_app) { plugin.class.rack_app }
|
15
15
|
|
16
|
+
it 'should only supply a Rack app if one has been given' do
|
17
|
+
plugin = UselessPlugin.new({})
|
18
|
+
plugin.prepared_rack_app.should be_nil
|
19
|
+
end
|
20
|
+
|
16
21
|
it 'should add the plugin object to the Rack app' do
|
17
22
|
stub_app_call do
|
18
23
|
original_app.plugin_object.should == plugin
|