trailblazer-rails 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/README.md +1 -1
- data/lib/trailblazer/rails.rb +1 -0
- data/lib/trailblazer/rails/controller.rb +0 -18
- data/lib/trailblazer/rails/controller/cell.rb +21 -0
- data/lib/trailblazer/rails/railtie.rb +1 -0
- data/lib/trailblazer/rails/version.rb +1 -1
- data/trailblazer-rails.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cf8c3a411e8572f6e8d0909cc12be8689003dee
|
4
|
+
data.tar.gz: 85c774a47cd27eb23a12f420c88bd4cfff2d0ee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd1d1b28b4567de47ae22578741094cabc6afb8cccfa0e2b82238a8d14a70378257390f4bcf090c28b62b7f3995445c4f7cbd80b5a0cb16ed12fa703aedd5c83
|
7
|
+
data.tar.gz: 9a818102898e9a6685e4f6871a39c7faa5c2924377f86f2f3067cabf7dc2ea1048d7dfd799e88e51af39b76bacd2157d54708f7f644dc1240e1b89ea64d0a0e4
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -16,7 +16,7 @@ Status](https://travis-ci.org/trailblazer/trailblazer-rails.svg)](https://travis
|
|
16
16
|
* Minimalistic integration tests ("smoke tests") to test controller/operation wiring.
|
17
17
|
* Rendering cells instead of an ActionView in a controller action.
|
18
18
|
|
19
|
-
Please refer to the [full documentation for more](http://trailblazer.to/gems/trailblazer/rails.html).
|
19
|
+
Please refer to the [full documentation for more](http://trailblazer.to/gems/trailblazer/2.0/rails.html).
|
20
20
|
|
21
21
|
## Installation
|
22
22
|
|
data/lib/trailblazer/rails.rb
CHANGED
@@ -32,24 +32,6 @@ module Trailblazer::Rails
|
|
32
32
|
options
|
33
33
|
end
|
34
34
|
|
35
|
-
module Render
|
36
|
-
def render(cell=nil, options={}, *, &block)
|
37
|
-
return super unless cell.kind_of?(::Cell::ViewModel)
|
38
|
-
render_cell(cell, options)
|
39
|
-
end
|
40
|
-
|
41
|
-
def render_cell(cell, options)
|
42
|
-
options = options.reverse_merge(layout: true)
|
43
|
-
|
44
|
-
# render the cell.
|
45
|
-
content = cell.()
|
46
|
-
|
47
|
-
render( { html: content }.merge(options) )
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
include Render
|
52
|
-
|
53
35
|
module Result
|
54
36
|
def result
|
55
37
|
@_result
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Trailblazer::Rails::Controller::Cell
|
2
|
+
private
|
3
|
+
|
4
|
+
module Render
|
5
|
+
def render(cell=nil, options={}, *, &block)
|
6
|
+
return super unless cell.kind_of?(::Cell::ViewModel)
|
7
|
+
render_cell(cell, options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def render_cell(cell, options)
|
11
|
+
options = options.reverse_merge(layout: true)
|
12
|
+
|
13
|
+
# render the cell.
|
14
|
+
content = cell.()
|
15
|
+
|
16
|
+
render( { html: content }.merge(options) )
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
include Render
|
21
|
+
end
|
@@ -36,6 +36,7 @@ module Trailblazer
|
|
36
36
|
initializer "trailblazer.application_controller" do
|
37
37
|
reloader_class.to_prepare do
|
38
38
|
ApplicationController.send :include, Trailblazer::Rails::Controller
|
39
|
+
ApplicationController.send :include, Trailblazer::Rails::Controller::Cell if defined?(::Cell)
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
data/trailblazer-rails.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency "trailblazer", ">= 2.0.0
|
19
|
+
spec.add_dependency "trailblazer", ">= 2.0.0", "< 2.1.0"
|
20
20
|
spec.add_dependency "trailblazer-loader", ">= 0.1.0"
|
21
21
|
spec.add_dependency "reform-rails", ">= 0.1.4", "< 0.2.0"
|
22
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trailblazer
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.0
|
19
|
+
version: 2.0.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.1.0
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.0.0
|
29
|
+
version: 2.0.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.1.0
|
@@ -165,6 +165,7 @@ files:
|
|
165
165
|
- lib/trailblazer/operation/responder.rb
|
166
166
|
- lib/trailblazer/rails.rb
|
167
167
|
- lib/trailblazer/rails/controller.rb
|
168
|
+
- lib/trailblazer/rails/controller/cell.rb
|
168
169
|
- lib/trailblazer/rails/form.rb
|
169
170
|
- lib/trailblazer/rails/railtie.rb
|
170
171
|
- lib/trailblazer/rails/test/integration.rb
|