cells 3.11.1 → 3.11.2
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/CHANGES.md +8 -0
- data/Gemfile +4 -0
- data/README.md +99 -1
- data/cells.gemspec +2 -1
- data/lib/cell/twin.rb +38 -0
- data/lib/cell/view_model.rb +21 -9
- data/lib/cells/version.rb +1 -1
- data/test/rails/view_model_test.rb +19 -2
- data/test/twin_test.rb +30 -0
- metadata +151 -32
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9fb9e1377ed4ea72e0d162fd29e524e0f9b67b6
|
|
4
|
+
data.tar.gz: b661b6b504610a68198751905d6b186ed18c0dbb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6d39c7b449b5f8ab11973e953dee4895e1aa062e086449e1bf477214235b6a72fa8a450e91aaee9bbd8d559b71cb1d5eb6ea9559d0d0a9f0376be1a9f5e64b1
|
|
7
|
+
data.tar.gz: 3acac5e4ef165a75ea79763c5db07b450d128aaa44a438588aa29f3c69d55e642a6e8567234812cd46bd6893058d69538709cf85c242de6c4c175dc3c3d5ad82
|
data/CHANGES.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 3.11.2
|
|
2
|
+
|
|
3
|
+
* `ViewModel#call` now accepts a block and yields `self` (the cell instance) to it. This is handy to use with `content_for`.
|
|
4
|
+
```ruby
|
|
5
|
+
= cell(:song, Song.last).call(:show) do |cell|
|
|
6
|
+
content_for :footer, cell.footer
|
|
7
|
+
```
|
|
8
|
+
|
|
1
9
|
## 3.11.1
|
|
2
10
|
|
|
3
11
|
* Override `ActionView::Helpers::UrlHelper#url_for` in Rails 4.x as it is troublesome. That removes the annoying
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -14,13 +14,15 @@ Basically, cells can be rendered anywhere in your code. Most people use them in
|
|
|
14
14
|
|
|
15
15
|
## View Models
|
|
16
16
|
|
|
17
|
-
Since version 3.9 cells comes with two "dialects": You can still use a cell like a controller. However, the new [view model](https://github.com/apotonick/cells#view-models-explained) "dialect" allows you to treat a cell more object-oriented while providing an alternative approach to helpers.
|
|
17
|
+
Since version 3.9 cells comes with two "dialects": You can still use a cell like a controller. However, the new [view model](https://github.com/apotonick/cells#view-models-explained) "dialect" supercedes the traditional cell. It allows you to treat a cell more object-oriented while providing an alternative approach to helpers.
|
|
18
18
|
|
|
19
19
|
While the old dialect still works, we strongly recommend using a cell as a view model.
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
24
|
+
Cells run with all Rails >= 3.0. For 2.3 support [see below](#rails-23-note).
|
|
25
|
+
|
|
24
26
|
```ruby
|
|
25
27
|
gem 'cells'
|
|
26
28
|
```
|
|
@@ -214,8 +216,14 @@ Sometimes you need to render a global partial from `app/views` within a cell. Fo
|
|
|
214
216
|
```ruby
|
|
215
217
|
class MapCell < Cell::Rails
|
|
216
218
|
append_view_path "app/views"
|
|
219
|
+
|
|
220
|
+
def show
|
|
221
|
+
render partial: 'shared/map_form'
|
|
222
|
+
end
|
|
217
223
|
```
|
|
218
224
|
|
|
225
|
+
Note that you have to use `render partial:` which will then look in the global view directory and render the partial found at `app/views/shared/map_form.html.haml`.
|
|
226
|
+
|
|
219
227
|
|
|
220
228
|
## View Inheritance
|
|
221
229
|
|
|
@@ -510,6 +518,96 @@ end
|
|
|
510
518
|
|
|
511
519
|
You can now safely use `#title` in the view (and, in the cell class), it is delegated to `model.title`.
|
|
512
520
|
|
|
521
|
+
### Call
|
|
522
|
+
|
|
523
|
+
The `#call` method also accepts a block and yields `self` (the cell instance) to it. This is extremely helpful for using `content_for` outside of the cell.
|
|
524
|
+
|
|
525
|
+
```ruby
|
|
526
|
+
= cell(:song, Song.last).call(:show) do |cell|
|
|
527
|
+
content_for :footer, cell.footer
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
Note how the block is run in the global view's context, allowing you to use global helpers like `content_for`.
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
## Using Decorators (Twins)
|
|
534
|
+
|
|
535
|
+
You need to include the `disposable` gem in order to use this.
|
|
536
|
+
|
|
537
|
+
````ruby
|
|
538
|
+
gem "disposable"
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
With Cells 3.12, a new experimental concept enters the stage: Decorators in view models. As the view model should only contain logic related to presentation (which can get quite a bit), decorators - called _Twins_ - can be defined and automatically setup for your model.
|
|
542
|
+
|
|
543
|
+
Twins are a general concept in Trailblazer and are used everywhere where representers, forms, operations or cells need additional logic that has to be shared between layers. So, this extra step allows re-using your decorator for presentations other than the cell, e.g. in a JSON API, tests, etc.
|
|
544
|
+
|
|
545
|
+
Also, logic that simply doesn't belong to in a view-related class goes into a twin. That could be code to figure out if a user in logged in.
|
|
546
|
+
|
|
547
|
+
```ruby
|
|
548
|
+
class SongCell < Cell::ViewModel
|
|
549
|
+
include Properties
|
|
550
|
+
|
|
551
|
+
class Twin < Cell::Twin # this is your decorator
|
|
552
|
+
property :title
|
|
553
|
+
property :id
|
|
554
|
+
option :in_stock?
|
|
555
|
+
end
|
|
556
|
+
|
|
557
|
+
properties Twin
|
|
558
|
+
|
|
559
|
+
def show
|
|
560
|
+
if in_stock?
|
|
561
|
+
"You're lucky #{title} (#{id}) is in stock!"
|
|
562
|
+
end
|
|
563
|
+
end
|
|
564
|
+
end
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
In this example, we define the twin _in_ the cell itself. That could be done anywhere, as long as you tell the cell where to find the twin (`properties Twin`).
|
|
568
|
+
|
|
569
|
+
### Creating A Twin Cell
|
|
570
|
+
|
|
571
|
+
You create your cell as follows.
|
|
572
|
+
|
|
573
|
+
```ruby
|
|
574
|
+
cell("song", Song.find(1), in_stock?: true)
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
Internally, a twin is created from the arguments and passed to the view model. The view model cell now only works on the twin, not on the model anymore.
|
|
578
|
+
|
|
579
|
+
The twin simply acts as a delegator between the cell and the model: attributes defined with `property` are copied from the model, `option` values _have_ to be passed explicitely to the constructor. The twin defines an _interface_ for using your cell.
|
|
580
|
+
|
|
581
|
+
Another awesome thing is that you can now easily test your cell by "mocking" values.
|
|
582
|
+
|
|
583
|
+
```ruby
|
|
584
|
+
it "renders nicely" do
|
|
585
|
+
cell("song", song, in_stock?: true, title: "Mocked Song Title").must_match ...
|
|
586
|
+
end
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
The twin will simply use the passed `:title` and not copy the title from the song model, making it really easy to test edge cases in your view model.
|
|
590
|
+
|
|
591
|
+
### Extending Decorators
|
|
592
|
+
|
|
593
|
+
A decorator without any logic only gives you a tiny improvement, they become really helpful when including your own decorator logic.
|
|
594
|
+
|
|
595
|
+
```ruby
|
|
596
|
+
class Twin < Cell::Twin # this is your decorator
|
|
597
|
+
property :title
|
|
598
|
+
property :id
|
|
599
|
+
option :in_stock?
|
|
600
|
+
|
|
601
|
+
def title
|
|
602
|
+
super.downcase # super to retrieve the original title from model!
|
|
603
|
+
end
|
|
604
|
+
end
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
The same logic can now be used in a cell, a JSON or XML API endpoint or in the model layer.
|
|
608
|
+
|
|
609
|
+
Note: If there's enough interest, this could also be extended to work with draper and other decoration gems.
|
|
610
|
+
|
|
513
611
|
### Nested Rendering
|
|
514
612
|
|
|
515
613
|
When extracting parts of your view into a partial, as we did for the author section, you're free to render additional views using `#render`. Again, wrap render calls in instance methods, otherwise you'll end up with too much logic in your view.
|
data/cells.gemspec
CHANGED
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
|
21
21
|
|
|
22
22
|
s.add_dependency "actionpack", ">= 3.0"
|
|
23
23
|
s.add_dependency "railties", ">= 3.0"
|
|
24
|
-
s.add_dependency "uber", "~> 0.0.
|
|
24
|
+
s.add_dependency "uber", "~> 0.0.8"
|
|
25
25
|
|
|
26
26
|
s.add_development_dependency "rake"
|
|
27
27
|
s.add_development_dependency "haml"
|
|
@@ -31,4 +31,5 @@ Gem::Specification.new do |s|
|
|
|
31
31
|
s.add_development_dependency "activemodel"
|
|
32
32
|
s.add_development_dependency "capybara"
|
|
33
33
|
s.add_development_dependency "sprockets"
|
|
34
|
+
s.add_development_dependency "disposable", "~> 0.0.6"
|
|
34
35
|
end
|
data/lib/cell/twin.rb
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require 'disposable/twin'
|
|
2
|
+
require 'disposable/twin/option'
|
|
3
|
+
module Cell
|
|
4
|
+
class Twin < Disposable::Twin
|
|
5
|
+
include Option
|
|
6
|
+
|
|
7
|
+
def self.property_names
|
|
8
|
+
representer_class.representable_attrs.collect(&:name)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
module Properties
|
|
12
|
+
def self.included(base)
|
|
13
|
+
base.extend Uber::InheritableAttr
|
|
14
|
+
base.inheritable_attr :twin_class
|
|
15
|
+
base.extend ClassMethods
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
module ClassMethods
|
|
19
|
+
def properties(twin_class)
|
|
20
|
+
twin_class.property_names.each { |name| property name }
|
|
21
|
+
self.twin_class = twin_class
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
alias_method :twin, :properties
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def initialize(controller, model, options={})
|
|
28
|
+
super(controller, build_twin(model, options))
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
def build_twin(*args)
|
|
34
|
+
self.class.twin_class.new(*args)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/cell/view_model.rb
CHANGED
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
# call "helpers" in class
|
|
6
6
|
|
|
7
7
|
# TODO: warn when using ::property but not passing in model in constructor.
|
|
8
|
+
require 'uber/delegates'
|
|
8
9
|
|
|
9
10
|
# ViewModel is only supported in Rails +3.1. If you need it in Rails 3.0, let me know.
|
|
10
11
|
class Cell::ViewModel < Cell::Rails
|
|
11
12
|
abstract!
|
|
12
13
|
|
|
14
|
+
extend Uber::Delegates
|
|
15
|
+
|
|
13
16
|
include Cell::OptionsConstructor
|
|
14
17
|
#include ActionView::Helpers::UrlHelper
|
|
15
18
|
include ActionView::Context # this includes CompiledTemplates, too.
|
|
@@ -39,7 +42,7 @@ class Cell::ViewModel < Cell::Rails
|
|
|
39
42
|
|
|
40
43
|
class << self
|
|
41
44
|
def property(*names)
|
|
42
|
-
|
|
45
|
+
delegates :model, *names # Uber::Delegates.
|
|
43
46
|
end
|
|
44
47
|
|
|
45
48
|
include Helpers
|
|
@@ -55,20 +58,21 @@ class Cell::ViewModel < Cell::Rails
|
|
|
55
58
|
_prepare_context # happens in AV::Base at the bottom.
|
|
56
59
|
end
|
|
57
60
|
|
|
61
|
+
# render :show
|
|
58
62
|
def render(options={})
|
|
59
|
-
|
|
60
|
-
options.reverse_merge!(:view => state_for_implicit_render)
|
|
61
|
-
else
|
|
62
|
-
options = {:view => options.to_s}
|
|
63
|
-
end
|
|
63
|
+
options = options_for(options, caller) # TODO: call render methods with call(:show), call(:comments) instead of directly #comments?
|
|
64
64
|
|
|
65
65
|
super
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
+
# Invokes the passed state (defaults to :show) by using +render_state+. This will respect caching.
|
|
69
|
+
# Yields +self+ (the cell instance) to an optional block.
|
|
68
70
|
def call(state=:show)
|
|
69
71
|
# it is ok to call to_s.html_safe here as #call is a defined rendering method.
|
|
70
72
|
# DISCUSS: IN CONCEPT: render( view: implicit_state)
|
|
71
|
-
render_state(state)
|
|
73
|
+
content = render_state(state)
|
|
74
|
+
yield self if block_given?
|
|
75
|
+
content.to_s.html_safe
|
|
72
76
|
end
|
|
73
77
|
|
|
74
78
|
private
|
|
@@ -76,8 +80,16 @@ private
|
|
|
76
80
|
self
|
|
77
81
|
end
|
|
78
82
|
|
|
79
|
-
def
|
|
80
|
-
|
|
83
|
+
def options_for(options, caller)
|
|
84
|
+
if options.is_a?(Hash)
|
|
85
|
+
options.reverse_merge(:view => state_for_implicit_render(caller)) # TODO: test implicit render!
|
|
86
|
+
else
|
|
87
|
+
{:view => options.to_s}
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def state_for_implicit_render(caller)
|
|
92
|
+
caller[0].match(/`(\w+)/)[1]
|
|
81
93
|
end
|
|
82
94
|
|
|
83
95
|
# def implicit_state
|
data/lib/cells/version.rb
CHANGED
|
@@ -81,12 +81,20 @@ if Cell.rails_version >= 3.1
|
|
|
81
81
|
|
|
82
82
|
attr_accessor :count
|
|
83
83
|
cache :count
|
|
84
|
+
|
|
85
|
+
def title
|
|
86
|
+
super.upcase
|
|
87
|
+
end
|
|
84
88
|
end
|
|
85
89
|
|
|
86
|
-
let (:song) { Song.new(:title => "
|
|
87
|
-
|
|
90
|
+
let (:song) { Song.new(:title => "Sixtyfive", artist: "Boss") }
|
|
91
|
+
|
|
92
|
+
# ::property creates accessor.
|
|
88
93
|
it { HitCell.new(nil, song).artist.must_equal "Boss" }
|
|
89
94
|
|
|
95
|
+
# ::property accessor can be overridden and call super.
|
|
96
|
+
it { HitCell.new(nil, song).title.must_equal "SIXTYFIVE" }
|
|
97
|
+
|
|
90
98
|
|
|
91
99
|
describe "#call" do
|
|
92
100
|
let (:cell) { HitCell.new(nil, song) }
|
|
@@ -118,6 +126,15 @@ if Cell.rails_version >= 3.1
|
|
|
118
126
|
cell.count = 2
|
|
119
127
|
cell.call(:count).must_equal "1"
|
|
120
128
|
end
|
|
129
|
+
|
|
130
|
+
# call(:show) do .. end
|
|
131
|
+
it do
|
|
132
|
+
cell.call(:show) do |c|
|
|
133
|
+
c.instance_variable_set(:@volume, 9)
|
|
134
|
+
end.must_equal "Great!"
|
|
135
|
+
|
|
136
|
+
cell.instance_variable_get(:@volume).must_equal 9
|
|
137
|
+
end
|
|
121
138
|
end
|
|
122
139
|
|
|
123
140
|
|
data/test/twin_test.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
require 'cell/twin'
|
|
3
|
+
|
|
4
|
+
if Cell.rails_version >= 3.1
|
|
5
|
+
|
|
6
|
+
class TwinTest < MiniTest::Spec
|
|
7
|
+
class SongCell < Cell::ViewModel
|
|
8
|
+
class Twin < Cell::Twin
|
|
9
|
+
property :title
|
|
10
|
+
option :online?
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
include Cell::Twin::Properties
|
|
14
|
+
properties Twin
|
|
15
|
+
|
|
16
|
+
def show
|
|
17
|
+
"#{title} is #{online?}"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def title
|
|
21
|
+
super.downcase
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
let (:model) { OpenStruct.new(:title => "Kenny") }
|
|
26
|
+
|
|
27
|
+
it { SongCell.new(nil, model, :online? => true).call.must_equal "kenny is true" }
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
metadata
CHANGED
|
@@ -1,169 +1,183 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cells
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.11.
|
|
4
|
+
version: 3.11.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Sutterer
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionpack
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '3.0'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '3.0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: railties
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '3.0'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '3.0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: uber
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - ~>
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 0.0.
|
|
47
|
+
version: 0.0.8
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - ~>
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 0.0.
|
|
54
|
+
version: 0.0.8
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rake
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '0'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: haml
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- -
|
|
73
|
+
- - ">="
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
75
|
version: '0'
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- -
|
|
80
|
+
- - ">="
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '0'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: slim
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- -
|
|
87
|
+
- - ">="
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: '0'
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- -
|
|
94
|
+
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: tzinfo
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- -
|
|
101
|
+
- - ">="
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
103
|
version: '0'
|
|
104
104
|
type: :development
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
|
-
- -
|
|
108
|
+
- - ">="
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: minitest
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
|
-
- -
|
|
115
|
+
- - ">="
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
117
|
version: 4.7.5
|
|
118
118
|
type: :development
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
|
-
- -
|
|
122
|
+
- - ">="
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: 4.7.5
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: activemodel
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
128
128
|
requirements:
|
|
129
|
-
- -
|
|
129
|
+
- - ">="
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
131
|
version: '0'
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
|
-
- -
|
|
136
|
+
- - ">="
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
138
|
version: '0'
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
140
|
name: capybara
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
|
142
142
|
requirements:
|
|
143
|
-
- -
|
|
143
|
+
- - ">="
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
145
|
version: '0'
|
|
146
146
|
type: :development
|
|
147
147
|
prerelease: false
|
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
|
150
|
-
- -
|
|
150
|
+
- - ">="
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
152
|
version: '0'
|
|
153
153
|
- !ruby/object:Gem::Dependency
|
|
154
154
|
name: sprockets
|
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
|
156
156
|
requirements:
|
|
157
|
-
- -
|
|
157
|
+
- - ">="
|
|
158
158
|
- !ruby/object:Gem::Version
|
|
159
159
|
version: '0'
|
|
160
160
|
type: :development
|
|
161
161
|
prerelease: false
|
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
|
163
163
|
requirements:
|
|
164
|
-
- -
|
|
164
|
+
- - ">="
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
166
|
version: '0'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: disposable
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - "~>"
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: 0.0.6
|
|
174
|
+
type: :development
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - "~>"
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: 0.0.6
|
|
167
181
|
description: Cells are view components for Rails. They are lightweight controllers,
|
|
168
182
|
can be rendered in views and thus provide an elegant and fast way for encapsulation
|
|
169
183
|
and component-orientation.
|
|
@@ -173,8 +187,8 @@ executables: []
|
|
|
173
187
|
extensions: []
|
|
174
188
|
extra_rdoc_files: []
|
|
175
189
|
files:
|
|
176
|
-
- .gitignore
|
|
177
|
-
- .travis.yml
|
|
190
|
+
- ".gitignore"
|
|
191
|
+
- ".travis.yml"
|
|
178
192
|
- CHANGES.md
|
|
179
193
|
- Gemfile
|
|
180
194
|
- README.md
|
|
@@ -206,6 +220,7 @@ files:
|
|
|
206
220
|
- lib/cell/rails4_1_strategy.rb
|
|
207
221
|
- lib/cell/rendering.rb
|
|
208
222
|
- lib/cell/test_case.rb
|
|
223
|
+
- lib/cell/twin.rb
|
|
209
224
|
- lib/cell/view_model.rb
|
|
210
225
|
- lib/cells.rb
|
|
211
226
|
- lib/cells/cells.rake
|
|
@@ -336,6 +351,7 @@ files:
|
|
|
336
351
|
- test/self_contained_test.rb
|
|
337
352
|
- test/test_case_test.rb
|
|
338
353
|
- test/test_helper.rb
|
|
354
|
+
- test/twin_test.rb
|
|
339
355
|
homepage: http://cells.rubyforge.org
|
|
340
356
|
licenses:
|
|
341
357
|
- MIT
|
|
@@ -346,18 +362,121 @@ require_paths:
|
|
|
346
362
|
- lib
|
|
347
363
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
348
364
|
requirements:
|
|
349
|
-
- -
|
|
365
|
+
- - ">="
|
|
350
366
|
- !ruby/object:Gem::Version
|
|
351
367
|
version: '0'
|
|
352
368
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
353
369
|
requirements:
|
|
354
|
-
- -
|
|
370
|
+
- - ">="
|
|
355
371
|
- !ruby/object:Gem::Version
|
|
356
372
|
version: '0'
|
|
357
373
|
requirements: []
|
|
358
374
|
rubyforge_project:
|
|
359
|
-
rubygems_version: 2.2.
|
|
375
|
+
rubygems_version: 2.2.1
|
|
360
376
|
signing_key:
|
|
361
377
|
specification_version: 4
|
|
362
378
|
summary: View Components for Rails.
|
|
363
|
-
test_files:
|
|
379
|
+
test_files:
|
|
380
|
+
- test/app/cells/album/views/cover.haml
|
|
381
|
+
- test/app/cells/bad_guitarist/_dii.html.erb
|
|
382
|
+
- test/app/cells/bad_guitarist_cell.rb
|
|
383
|
+
- test/app/cells/bassist/_dii.html.erb
|
|
384
|
+
- test/app/cells/bassist/ahem.html.erb
|
|
385
|
+
- test/app/cells/bassist/compose.html.erb
|
|
386
|
+
- test/app/cells/bassist/contact_form.html.erb
|
|
387
|
+
- test/app/cells/bassist/form_for.erb
|
|
388
|
+
- test/app/cells/bassist/form_for_in_haml.haml
|
|
389
|
+
- test/app/cells/bassist/jam.html.erb
|
|
390
|
+
- test/app/cells/bassist/play.html.erb
|
|
391
|
+
- test/app/cells/bassist/play.js.erb
|
|
392
|
+
- test/app/cells/bassist/pose.html.erb
|
|
393
|
+
- test/app/cells/bassist/promote.html.erb
|
|
394
|
+
- test/app/cells/bassist/provoke.html.erb
|
|
395
|
+
- test/app/cells/bassist/shout.html.erb
|
|
396
|
+
- test/app/cells/bassist/sing.html.haml
|
|
397
|
+
- test/app/cells/bassist/slap.html.erb
|
|
398
|
+
- test/app/cells/bassist/yell.en.html.erb
|
|
399
|
+
- test/app/cells/bassist_cell.rb
|
|
400
|
+
- test/app/cells/club_security.rb
|
|
401
|
+
- test/app/cells/club_security/guard/help.html.erb
|
|
402
|
+
- test/app/cells/club_security/guard_cell.rb
|
|
403
|
+
- test/app/cells/club_security/medic/help.html.erb
|
|
404
|
+
- test/app/cells/club_security/medic_cell.rb
|
|
405
|
+
- test/app/cells/layouts/b.erb
|
|
406
|
+
- test/app/cells/layouts/metal.html.erb
|
|
407
|
+
- test/app/cells/rails_helper_api_test/bassist/edit.html.erb
|
|
408
|
+
- test/app/cells/shouter/sing.html.erb
|
|
409
|
+
- test/app/cells/song/dashboard.haml
|
|
410
|
+
- test/app/cells/song/details.html.haml
|
|
411
|
+
- test/app/cells/song/info.html.haml
|
|
412
|
+
- test/app/cells/song/lyrics.html.haml
|
|
413
|
+
- test/app/cells/song/plays.haml
|
|
414
|
+
- test/app/cells/song/scale.haml
|
|
415
|
+
- test/app/cells/song/show.html.haml
|
|
416
|
+
- test/app/cells/song/title.html.haml
|
|
417
|
+
- test/app/cells/trumpeter/promote.html.erb
|
|
418
|
+
- test/app/cells/trumpeter_cell.rb
|
|
419
|
+
- test/app/cells/view_model_test/comments/show.haml
|
|
420
|
+
- test/app/concepts/record/views/layout.haml
|
|
421
|
+
- test/app/concepts/record/views/show.erb
|
|
422
|
+
- test/app/concepts/record/views/song.erb
|
|
423
|
+
- test/app/views/shared/_dong.html.erb
|
|
424
|
+
- test/cell_generator_test.rb
|
|
425
|
+
- test/cell_module_test.rb
|
|
426
|
+
- test/cell_test.rb
|
|
427
|
+
- test/cells_module_test.rb
|
|
428
|
+
- test/concept_generator_test.rb
|
|
429
|
+
- test/concept_test.rb
|
|
430
|
+
- test/deprecations_test.rb
|
|
431
|
+
- test/dummy/Rakefile
|
|
432
|
+
- test/dummy/app/assets/javascripts/application.js
|
|
433
|
+
- test/dummy/app/cells/album/assets/album.js
|
|
434
|
+
- test/dummy/app/concepts/song/assets/songs.js
|
|
435
|
+
- test/dummy/app/controllers/application_controller.rb
|
|
436
|
+
- test/dummy/app/helpers/application_helper.rb
|
|
437
|
+
- test/dummy/app/views/layouts/application.html.erb
|
|
438
|
+
- test/dummy/app/views/musician/featured.html.erb
|
|
439
|
+
- test/dummy/app/views/musician/featured_with_block.html.erb
|
|
440
|
+
- test/dummy/app/views/musician/hamlet.html.haml
|
|
441
|
+
- test/dummy/app/views/musician/title.erb
|
|
442
|
+
- test/dummy/config.ru
|
|
443
|
+
- test/dummy/config/application.rb
|
|
444
|
+
- test/dummy/config/boot.rb
|
|
445
|
+
- test/dummy/config/database.yml
|
|
446
|
+
- test/dummy/config/environment.rb
|
|
447
|
+
- test/dummy/config/environments/development.rb
|
|
448
|
+
- test/dummy/config/environments/production.rb
|
|
449
|
+
- test/dummy/config/environments/test.rb
|
|
450
|
+
- test/dummy/config/locales/en.yml
|
|
451
|
+
- test/dummy/config/routes.rb
|
|
452
|
+
- test/dummy/db/test.sqlite3
|
|
453
|
+
- test/dummy/label/app/cells/label/show.erb
|
|
454
|
+
- test/dummy/label/app/cells/label_cell.rb
|
|
455
|
+
- test/dummy/label/label.gemspec
|
|
456
|
+
- test/dummy/label/lib/label.rb
|
|
457
|
+
- test/dummy/label/lib/label/version.rb
|
|
458
|
+
- test/dummy/log/production.log
|
|
459
|
+
- test/dummy/log/server.log
|
|
460
|
+
- test/dummy/public/404.html
|
|
461
|
+
- test/dummy/public/422.html
|
|
462
|
+
- test/dummy/public/500.html
|
|
463
|
+
- test/dummy/public/favicon.ico
|
|
464
|
+
- test/dummy/public/stylesheets/.gitkeep
|
|
465
|
+
- test/dummy/script/rails
|
|
466
|
+
- test/helper_test.rb
|
|
467
|
+
- test/prefixes_test.rb
|
|
468
|
+
- test/rack_test.rb
|
|
469
|
+
- test/rails/asset_pipeline_test.rb
|
|
470
|
+
- test/rails/caching_test.rb
|
|
471
|
+
- test/rails/cells_test.rb
|
|
472
|
+
- test/rails/forms_test.rb
|
|
473
|
+
- test/rails/integration_test.rb
|
|
474
|
+
- test/rails/render_test.rb
|
|
475
|
+
- test/rails/view_model_test.rb
|
|
476
|
+
- test/rails/view_test.rb
|
|
477
|
+
- test/rails_helper_api_test.rb
|
|
478
|
+
- test/self_contained_test.rb
|
|
479
|
+
- test/test_case_test.rb
|
|
480
|
+
- test/test_helper.rb
|
|
481
|
+
- test/twin_test.rb
|
|
482
|
+
has_rdoc:
|