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
- # Extend helper module if needed
93
- unless app.singleton_class.included_modules.include?(HelperMethods)
94
- app.extend(HelperMethods)
95
- end
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
- app.plugin_object = self
98
- RackAppWrapper.new(app)
98
+ app.plugin_object = self
99
+ RackAppWrapper.new(app)
100
+ end
99
101
  end
100
102
 
101
103
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module LocomotivePlugins
2
- VERSION = '1.0.0.beta8'
2
+ VERSION = '1.0.0.beta9'
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotive_plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta8
4
+ version: 1.0.0.beta9
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: