motorhead 0.3.9 → 0.4.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +8 -1
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/gemfiles/Gemfile-rails.5.0.x +14 -0
- data/lib/motorhead/abstract_controller.rb +7 -7
- data/lib/motorhead/action_view.rb +2 -1
- data/lib/motorhead/engine.rb +5 -2
- data/lib/motorhead/road_crew/road_crew.gemspec +1 -1
- data/lib/motorhead/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5da96ff9de01b6bd45257a2b9a42777a925f3acb
|
4
|
+
data.tar.gz: 3f2377fb39dba6442dae76751d4c2ed39363e61f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60516910dc8605c810355189928dacf857faf8998f0a51b69fa10ac90de1483e346dd3b3cd55f3cec9aa389b94d0e038695acbe390013b6ec802636c616b3b90
|
7
|
+
data.tar.gz: 180cf4a084f3c9106e01428c21f64ad95610b3bcd8087c3b802a91e6290388d83ba2087f47f493c89b96c07ed1703b60dc89850ed7abffd81642766a6760ba46
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -16,7 +16,7 @@ Bundle into your Rails app.
|
|
16
16
|
### Isolated Engine
|
17
17
|
|
18
18
|
Motorhead helps you mounting specially creafted Isolated Engines onto the main Rails app.
|
19
|
-
An engine can contain whole MVC
|
19
|
+
An engine can contain whole MVC components, which means that you can encapsulate everything that are needed for your new feature under one single directory.
|
20
20
|
This helps your team creating multiple new features simultaneously without causing code conflict.
|
21
21
|
|
22
22
|
### Conditional Execution
|
data/Rakefile
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gemspec :path => '../'
|
4
|
+
|
5
|
+
gem 'rails', '~> 5.0.0'
|
6
|
+
gem 'controller_extension', path: '../test/dummy_app/app/engines/controller_extension'
|
7
|
+
gem 'controller_fallback', path: '../test/dummy_app/app/engines/controller_fallback'
|
8
|
+
gem 'view_render_fallback', path: '../test/dummy_app/app/engines/view_render_fallback'
|
9
|
+
gem 'routes_fallback', path: '../test/dummy_app/app/engines/routes_fallback'
|
10
|
+
gem 'italian', path: '../test/dummy_app/app/engines/italian'
|
11
|
+
gem 'spanish', path: '../test/dummy_app/app/engines/spanish'
|
12
|
+
gem 'simple_controller', path: '../test/dummy_app/app/engines/simple_controller'
|
13
|
+
gem 'mount_at_capricorn', path: '../test/dummy_app/app/engines/mount_at_capricorn'
|
14
|
+
gem 'redirector', path: '../test/dummy_app/app/engines/redirector'
|
@@ -27,13 +27,13 @@ module Motorhead
|
|
27
27
|
begin
|
28
28
|
super
|
29
29
|
@_motorhead_action_successfully_finished = true
|
30
|
-
env['motorhead_view_assigns'] = view_assigns
|
30
|
+
request.env['motorhead_view_assigns'] = view_assigns
|
31
31
|
rescue => e
|
32
32
|
(self.class.parent::Engine.on_error || Motorhead.config.on_error).call(e)
|
33
33
|
end
|
34
34
|
when ::ActionController::Base
|
35
|
-
if env.key? 'motorhead_render_result'
|
36
|
-
self.response = env.delete 'motorhead_render_result'
|
35
|
+
if request.env.key? 'motorhead_render_result'
|
36
|
+
self.response = request.env.delete 'motorhead_render_result'
|
37
37
|
headers.delete 'X-Cascade'
|
38
38
|
self.response_body = response.body
|
39
39
|
else
|
@@ -58,8 +58,8 @@ module Motorhead
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def view_assigns
|
61
|
-
if env.key? 'motorhead_view_assigns'
|
62
|
-
super.merge env['motorhead_view_assigns']
|
61
|
+
if request.env.key? 'motorhead_view_assigns'
|
62
|
+
super.merge request.env['motorhead_view_assigns']
|
63
63
|
else
|
64
64
|
super
|
65
65
|
end
|
@@ -68,13 +68,13 @@ module Motorhead
|
|
68
68
|
def render_to_body(options = {})
|
69
69
|
return if (headers['X-Cascade'] == 'pass') && !defined?(@_motorhead_action_successfully_finished)
|
70
70
|
ret = super
|
71
|
-
env['motorhead_render_result'] = response
|
71
|
+
request.env['motorhead_render_result'] = response
|
72
72
|
ret
|
73
73
|
end
|
74
74
|
|
75
75
|
def redirect_to(options = {}, response_status = {}) #:doc:
|
76
76
|
ret = super
|
77
|
-
env['motorhead_render_result'] = response
|
77
|
+
request.env['motorhead_render_result'] = response
|
78
78
|
ret
|
79
79
|
end
|
80
80
|
end
|
data/lib/motorhead/engine.rb
CHANGED
@@ -6,7 +6,6 @@ module Motorhead
|
|
6
6
|
|
7
7
|
module ClassMethods
|
8
8
|
attr_accessor :on_error
|
9
|
-
attr_reader :mount_at
|
10
9
|
|
11
10
|
def active_if(&block)
|
12
11
|
@active_if = block
|
@@ -17,7 +16,11 @@ module Motorhead
|
|
17
16
|
end
|
18
17
|
|
19
18
|
def mount_at(path = nil)
|
20
|
-
|
19
|
+
if path
|
20
|
+
@mount_at = path
|
21
|
+
else
|
22
|
+
defined?(@mount_at) && @mount_at
|
23
|
+
end
|
21
24
|
end
|
22
25
|
end
|
23
26
|
|
data/lib/motorhead/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motorhead
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- README.md
|
124
124
|
- Rakefile
|
125
125
|
- gemfiles/Gemfile-rails.4.2.x
|
126
|
+
- gemfiles/Gemfile-rails.5.0.x
|
126
127
|
- lib/generators/motorhead/controller_generator.rb
|
127
128
|
- lib/generators/motorhead/templates/controller.rb
|
128
129
|
- lib/generators/motorhead/templates/lib/%name%/engine.rb
|
@@ -165,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
166
|
version: '0'
|
166
167
|
requirements: []
|
167
168
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.5.1
|
169
170
|
signing_key:
|
170
171
|
specification_version: 4
|
171
172
|
summary: A safe and rapid prototyping framework for Rails
|