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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f37fd47f8e8cde52354688edf77cabfcfe54c085
4
- data.tar.gz: 9a955bc735b0186850175356731e5c0244046ae9
3
+ metadata.gz: 3cf8c3a411e8572f6e8d0909cc12be8689003dee
4
+ data.tar.gz: 85c774a47cd27eb23a12f420c88bd4cfff2d0ee9
5
5
  SHA512:
6
- metadata.gz: 3acaa655a1c916f0fbff8bf069fe1cf7f821f5401878e57149183f8b1ed61ac70d51ae14023a5a8e6ce8f19703447172f038aa582dfb66483f53e0284cccb980
7
- data.tar.gz: ea0e8baa2a51e023bced7d7a4a814d1a883afa7661056485e57e78a28fc4a6a8c7ce66fe394c978af2c00cbc5a37d9990c47e3af6a6d1db4414d0244dce9d62c
6
+ metadata.gz: dd1d1b28b4567de47ae22578741094cabc6afb8cccfa0e2b82238a8d14a70378257390f4bcf090c28b62b7f3995445c4f7cbd80b5a0cb16ed12fa703aedd5c83
7
+ data.tar.gz: 9a818102898e9a6685e4f6871a39c7faa5c2924377f86f2f3067cabf7dc2ea1048d7dfd799e88e51af39b76bacd2157d54708f7f644dc1240e1b89ea64d0a0e4
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.1
2
+
3
+ * Allow using this gem without `cells,` by loading cells support only when the `cells` gem got detected. Thanks to @promisedlandt.
4
+
1
5
  # 1.0.0
2
6
 
3
7
  * Runs only with >= Trailblazer 2.0.0.
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
 
@@ -8,6 +8,7 @@ end
8
8
  require "reform/rails"
9
9
 
10
10
  require "trailblazer/rails/controller"
11
+ require "trailblazer/rails/controller/cell"
11
12
  require "trailblazer/rails/form"
12
13
  require "trailblazer/rails/railtie"
13
14
  require "trailblazer"
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  module Rails
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -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.beta1", "< 2.1.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.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: 2016-12-15 00:00:00.000000000 Z
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.beta1
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.beta1
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