cells 4.0.5 → 4.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -14
- data/CHANGES.md +34 -7
- data/Gemfile +2 -2
- data/README.md +18 -88
- data/benchmarks/class_builder.rb +37 -0
- data/benchmarks/collection.rb +47 -0
- data/cells.gemspec +5 -7
- data/lib/cell.rb +2 -11
- data/lib/cell/builder.rb +16 -0
- data/lib/cell/collection.rb +54 -0
- data/lib/cell/concept.rb +6 -7
- data/lib/cell/escaped.rb +1 -0
- data/lib/cell/layout.rb +50 -14
- data/lib/cell/testing.rb +6 -5
- data/lib/cell/util.rb +10 -1
- data/lib/cell/version.rb +1 -1
- data/lib/cell/view_model.rb +27 -56
- data/lib/cells.rb +1 -1
- data/test/builder_test.rb +4 -2
- data/test/cell_test.rb +9 -2
- data/test/concept_test.rb +9 -16
- data/test/context_test.rb +33 -0
- data/test/fixtures/cell_test/song/show_with_block.erb +1 -0
- data/test/fixtures/comment/layout/show.erb +1 -0
- data/test/fixtures/comment/show/show.erb +1 -0
- data/test/fixtures/song/with_block.erb +1 -0
- data/test/layout_test.rb +34 -1
- data/test/prefixes_test.rb +3 -3
- data/test/public_test.rb +43 -9
- data/test/render_test.rb +7 -3
- data/test/test_helper.rb +2 -38
- data/test/{test_case_test.rb → testing_test.rb} +2 -2
- metadata +16 -159
- data/gemfiles/rails3.2.gemfile +0 -16
- data/gemfiles/rails4.0.gemfile +0 -12
- data/gemfiles/rails4.1.gemfile +0 -12
- data/gemfiles/rails4.2.gemfile +0 -10
- data/lib/cell/caching/notification.rb +0 -15
- data/lib/cell/rails.rb +0 -98
- data/lib/cell/railtie.rb +0 -69
- data/lib/cell/test_case.rb +0 -12
- data/lib/cell/translation.rb +0 -19
- data/lib/rails/generators/cell/cell_generator.rb +0 -43
- data/lib/rails/generators/cell/templates/cell.rb.erb +0 -8
- data/lib/rails/generators/cell/templates/view.erb +0 -7
- data/lib/rails/generators/cell/templates/view.haml +0 -4
- data/lib/rails/generators/cell/templates/view.slim +0 -2
- data/lib/rails/generators/concept/concept_generator.rb +0 -38
- data/lib/rails/generators/concept/templates/concept.rb.erb +0 -7
- data/lib/rails/generators/concept/templates/view.erb +0 -7
- data/lib/rails/generators/concept/templates/view.haml +0 -4
- data/lib/rails/generators/concept/templates/view.slim +0 -2
- data/lib/rails/generators/test_unit/cell/cell_generator.rb +0 -21
- data/lib/rails/generators/test_unit/cell/templates/unit_test.rb.erb +0 -11
- data/lib/rails/generators/test_unit/concept/concept_generator.rb +0 -21
- data/lib/rails/generators/test_unit/concept/templates/unit_test.rb.erb +0 -11
- data/test/caching_test.rb +0 -305
- data/test/cell_generator_test.rb +0 -90
- data/test/concept_generator_test.rb +0 -40
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/assets/javascripts/application.js +0 -2
- data/test/dummy/app/cells/album/assets/album.js +0 -1
- data/test/dummy/app/concepts/song/assets/songs.js +0 -1
- data/test/dummy/app/controllers/application_controller.rb +0 -4
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/app/views/musician/featured.html.erb +0 -1
- data/test/dummy/app/views/musician/featured_with_block.html.erb +0 -4
- data/test/dummy/app/views/musician/hamlet.html.erb +0 -1
- data/test/dummy/app/views/musician/title.erb +0 -1
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -41
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/database.yml +0 -22
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/routes.rb +0 -5
- data/test/dummy/script/rails +0 -6
- data/test/rails/translation_test.rb +0 -45
- data/test/rails4.2/.gitignore +0 -13
- data/test/rails4.2/Gemfile +0 -18
- data/test/rails4.2/README.rdoc +0 -3
- data/test/rails4.2/Rakefile +0 -6
- data/test/rails4.2/app/assets/images/.keep +0 -0
- data/test/rails4.2/app/assets/stylesheets/application.css.erb +0 -19
- data/test/rails4.2/app/cells/form_for/show.erb +0 -7
- data/test/rails4.2/app/cells/form_for_cell.rb +0 -7
- data/test/rails4.2/app/cells/form_tag/show.erb +0 -5
- data/test/rails4.2/app/cells/form_tag_cell.rb +0 -5
- data/test/rails4.2/app/cells/formtastic/show.erb +0 -12
- data/test/rails4.2/app/cells/formtastic_cell.rb +0 -9
- data/test/rails4.2/app/cells/simple_form/show.erb +0 -7
- data/test/rails4.2/app/cells/simple_form_cell.rb +0 -11
- data/test/rails4.2/app/cells/song/song.css +0 -1
- data/test/rails4.2/app/cells/song/with_escaped.erb +0 -1
- data/test/rails4.2/app/cells/song_cell.rb +0 -18
- data/test/rails4.2/app/controllers/application_controller.rb +0 -5
- data/test/rails4.2/app/controllers/concerns/.keep +0 -0
- data/test/rails4.2/app/controllers/index_controller.rb +0 -7
- data/test/rails4.2/app/controllers/songs_controller.rb +0 -25
- data/test/rails4.2/app/helpers/application_helper.rb +0 -2
- data/test/rails4.2/app/mailers/.keep +0 -0
- data/test/rails4.2/app/models/.keep +0 -0
- data/test/rails4.2/app/models/artist.rb +0 -25
- data/test/rails4.2/app/models/concerns/.keep +0 -0
- data/test/rails4.2/app/models/song.rb +0 -25
- data/test/rails4.2/app/views/index/index.html.erb +0 -6
- data/test/rails4.2/app/views/layouts/application.html.erb +0 -13
- data/test/rails4.2/app/views/songs/show.html.erb +0 -1
- data/test/rails4.2/app/views/songs/with_escaped.html.erb +0 -1
- data/test/rails4.2/bin/bundle +0 -3
- data/test/rails4.2/bin/rails +0 -4
- data/test/rails4.2/bin/rake +0 -4
- data/test/rails4.2/bin/setup +0 -29
- data/test/rails4.2/config.ru +0 -4
- data/test/rails4.2/config/application.rb +0 -38
- data/test/rails4.2/config/boot.rb +0 -3
- data/test/rails4.2/config/environment.rb +0 -5
- data/test/rails4.2/config/environments/development.rb +0 -25
- data/test/rails4.2/config/environments/production.rb +0 -64
- data/test/rails4.2/config/environments/test.rb +0 -42
- data/test/rails4.2/config/initializers/backtrace_silencers.rb +0 -7
- data/test/rails4.2/config/initializers/cookies_serializer.rb +0 -3
- data/test/rails4.2/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/rails4.2/config/initializers/formtastic.rb +0 -2
- data/test/rails4.2/config/initializers/inflections.rb +0 -16
- data/test/rails4.2/config/initializers/mime_types.rb +0 -4
- data/test/rails4.2/config/initializers/session_store.rb +0 -3
- data/test/rails4.2/config/initializers/wrap_parameters.rb +0 -9
- data/test/rails4.2/config/locales/en.yml +0 -23
- data/test/rails4.2/config/routes.rb +0 -9
- data/test/rails4.2/config/secrets.yml +0 -22
- data/test/rails4.2/db/seeds.rb +0 -7
- data/test/rails4.2/engines/my_engine/.gitignore +0 -3
- data/test/rails4.2/engines/my_engine/Gemfile +0 -15
- data/test/rails4.2/engines/my_engine/MIT-LICENSE +0 -20
- data/test/rails4.2/engines/my_engine/README.rdoc +0 -3
- data/test/rails4.2/engines/my_engine/Rakefile +0 -24
- data/test/rails4.2/engines/my_engine/app/assets/images/my_engine/.keep +0 -0
- data/test/rails4.2/engines/my_engine/app/assets/stylesheets/my_engine/application.css +0 -15
- data/test/rails4.2/engines/my_engine/app/concepts/user/cell.rb +0 -8
- data/test/rails4.2/engines/my_engine/app/concepts/user/views/show.erb +0 -1
- data/test/rails4.2/engines/my_engine/app/concepts/user/views/user.scss +0 -3
- data/test/rails4.2/engines/my_engine/app/controllers/my_engine/application_controller.rb +0 -4
- data/test/rails4.2/engines/my_engine/app/controllers/my_engine/user_controller.rb +0 -7
- data/test/rails4.2/engines/my_engine/app/helpers/my_engine/application_helper.rb +0 -4
- data/test/rails4.2/engines/my_engine/app/models/my_engine/user.rb +0 -4
- data/test/rails4.2/engines/my_engine/app/views/layouts/my_engine/application.html.erb +0 -14
- data/test/rails4.2/engines/my_engine/app/views/my_engine/user/show.html.erb +0 -3
- data/test/rails4.2/engines/my_engine/bin/rails +0 -12
- data/test/rails4.2/engines/my_engine/config/routes.rb +0 -3
- data/test/rails4.2/engines/my_engine/db/migrate/20150530135920_create_my_engine_users.rb +0 -8
- data/test/rails4.2/engines/my_engine/lib/my_engine.rb +0 -6
- data/test/rails4.2/engines/my_engine/lib/my_engine/engine.rb +0 -9
- data/test/rails4.2/engines/my_engine/lib/my_engine/version.rb +0 -3
- data/test/rails4.2/engines/my_engine/lib/tasks/my_engine_tasks.rake +0 -4
- data/test/rails4.2/engines/my_engine/my_engine.gemspec +0 -24
- data/test/rails4.2/engines/my_engine/test/fixtures/my_engine/users.yml +0 -11
- data/test/rails4.2/engines/my_engine/test/models/my_engine/user_test.rb +0 -9
- data/test/rails4.2/lib/assets/.keep +0 -0
- data/test/rails4.2/lib/tasks/.keep +0 -0
- data/test/rails4.2/log/.keep +0 -0
- data/test/rails4.2/test/integration/asset_pipeline_test.rb +0 -17
- data/test/rails4.2/test/integration/controller_test.rb +0 -16
- data/test/rails4.2/test/integration/form_for_test.rb +0 -10
- data/test/rails4.2/test/integration/form_tag_test.rb +0 -11
- data/test/rails4.2/test/integration/formtastic_test.rb +0 -12
- data/test/rails4.2/test/integration/simple_form_test.rb +0 -11
- data/test/rails4.2/test/integration/url_helper_test.rb +0 -47
- data/test/rails4.2/test/test_helper.rb +0 -14
- data/test/rails4.2/vendor/assets/stylesheets/.keep +0 -0
- data/test/rails_extensions_test.rb +0 -51
@@ -0,0 +1,33 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class ContextTest < MiniTest::Spec
|
4
|
+
class ParentCell < Cell::ViewModel
|
5
|
+
def user
|
6
|
+
context[:user]
|
7
|
+
end
|
8
|
+
|
9
|
+
def controller
|
10
|
+
context[:controller]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
let (:model) { Object.new }
|
15
|
+
let (:user) { Object.new }
|
16
|
+
let (:controller) { Object.new }
|
17
|
+
|
18
|
+
it do
|
19
|
+
cell = ParentCell.(model, admin: true, context: { user: user, controller: controller })
|
20
|
+
# cell.extend(ParentController)
|
21
|
+
|
22
|
+
cell.model.must_equal model
|
23
|
+
cell.controller.must_equal controller
|
24
|
+
cell.user.must_equal user
|
25
|
+
|
26
|
+
# nested cell
|
27
|
+
child = cell.cell("context_test/parent", "")
|
28
|
+
|
29
|
+
child.model.must_equal ""
|
30
|
+
child.controller.must_equal controller
|
31
|
+
child.user.must_equal user
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<b><%= yield %></b>
|
@@ -0,0 +1 @@
|
|
1
|
+
$layout.erb{<%= yield %>, <%= context.inspect %>}
|
@@ -0,0 +1 @@
|
|
1
|
+
$show.erb, <%= context.inspect %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Yo! <%= yield %>
|
data/test/layout_test.rb
CHANGED
@@ -55,4 +55,37 @@ class LayoutTest < MiniTest::Spec
|
|
55
55
|
|
56
56
|
# with ::layout and :layout, :layout wins.
|
57
57
|
it { SongWithLayoutOnClassCell.new(nil).show_with_layout.must_equal "Happy Friday!" }
|
58
|
-
end
|
58
|
+
end
|
59
|
+
|
60
|
+
module Comment
|
61
|
+
class ShowCell < Cell::ViewModel
|
62
|
+
self.view_paths = ['test/fixtures']
|
63
|
+
include Layout::External
|
64
|
+
|
65
|
+
def show
|
66
|
+
render + render
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
class LayoutCell < Cell::ViewModel
|
71
|
+
self.view_paths = ['test/fixtures']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
class ExternalLayoutTest < Minitest::Spec
|
76
|
+
it do
|
77
|
+
Comment::ShowCell.new(nil, layout: Comment::LayoutCell, context: { beer: true }).
|
78
|
+
().must_equal "$layout.erb{$show.erb, {:beer=>true}\n$show.erb, {:beer=>true}\n, {:beer=>true}}\n"
|
79
|
+
end
|
80
|
+
|
81
|
+
# collection :layout
|
82
|
+
it do
|
83
|
+
Cell::ViewModel.cell("comment/show", collection: [Object, Module], layout: Comment::LayoutCell).().
|
84
|
+
must_equal "$layout.erb{$show.erb, nil
|
85
|
+
$show.erb, nil
|
86
|
+
$show.erb, nil
|
87
|
+
$show.erb, nil
|
88
|
+
, nil}
|
89
|
+
"
|
90
|
+
end
|
91
|
+
end
|
data/test/prefixes_test.rb
CHANGED
@@ -42,8 +42,8 @@ class PrefixesTest < MiniTest::Spec
|
|
42
42
|
|
43
43
|
|
44
44
|
describe "::controller_path" do
|
45
|
-
it { ::BassistCell.new(@controller).controller_path.must_equal "bassist" }
|
46
|
-
it { SingerCell.new(@controller).controller_path.must_equal "prefixes_test/singer" }
|
45
|
+
it { ::BassistCell.new(@controller).class.controller_path.must_equal "bassist" }
|
46
|
+
it { SingerCell.new(@controller).class.controller_path.must_equal "prefixes_test/singer" }
|
47
47
|
end
|
48
48
|
|
49
49
|
describe "#_prefixes" do
|
@@ -130,4 +130,4 @@ class InheritViewsTest < MiniTest::Spec
|
|
130
130
|
it { cell('inherit_views_test/popper').call(:play).must_equal 'Dooom!' }
|
131
131
|
# Popper renders its tap
|
132
132
|
it { cell('inherit_views_test/popper').call(:tap).must_equal "TTttttap I'm not good enough!" }
|
133
|
-
end
|
133
|
+
end
|
data/test/public_test.rb
CHANGED
@@ -21,27 +21,61 @@ class PublicTest < MiniTest::Spec
|
|
21
21
|
|
22
22
|
# ViewModel.cell returns the cell instance.
|
23
23
|
it { Cell::ViewModel.cell("public_test/song").must_be_instance_of SongCell }
|
24
|
+
it { Cell::ViewModel.cell(PublicTest::SongCell).must_be_instance_of SongCell }
|
24
25
|
|
25
26
|
# Concept.cell simply camelizes the string before constantizing.
|
26
27
|
it { Cell::Concept.cell("public_test/songs").must_be_instance_of Songs }
|
27
28
|
|
29
|
+
it { Cell::Concept.cell(PublicTest::Songs).must_be_instance_of Songs }
|
30
|
+
|
28
31
|
# ViewModel.cell passes options to cell.
|
29
32
|
it { Cell::ViewModel.cell("public_test/song", Object, genre: "Metal").initialize_args.must_equal [Object, {genre:"Metal"}] }
|
30
33
|
|
31
34
|
# ViewModel.cell(collection: []) renders cells.
|
32
|
-
it { Cell::ViewModel.cell(
|
35
|
+
it { Cell::ViewModel.cell("public_test/song", collection: [Object, Module]).to_s.must_equal '[Object, {}][Module, {}]' }
|
33
36
|
|
34
37
|
# ViewModel.cell(collection: []) renders cells with custom join.
|
35
|
-
it { Cell::ViewModel.cell(
|
36
|
-
|
37
|
-
# ViewModel.cell(collection: []) renders html_safe.
|
38
|
-
it { Cell::ViewModel.cell("public_test/song", collection: [Object]).class.must_equal ActiveSupport::SafeBuffer }
|
38
|
+
it { Cell::ViewModel.cell("public_test/song", collection: [Object, Module], collection_join: '<br/>').to_s.must_equal '[Object, {}]<br/>[Module, {}]' }
|
39
39
|
|
40
40
|
# ViewModel.cell(collection: []) passes generic options to cell.
|
41
|
-
it { Cell::ViewModel.cell(
|
41
|
+
it { Cell::ViewModel.cell("public_test/song", collection: [Object, Module], genre: 'Metal', context: { ready: true }).to_s.must_equal "[Object, {:genre=>\"Metal\", :context=>{:ready=>true}}][Module, {:genre=>\"Metal\", :context=>{:ready=>true}}]" }
|
42
42
|
|
43
43
|
# ViewModel.cell(collection: [], method: :detail) invokes #detail instead of #show.
|
44
|
-
|
45
|
-
|
44
|
+
# TODO: remove in 5.0.
|
45
|
+
it { Cell::ViewModel.cell("public_test/song", collection: [Object, Module], method: :detail).to_s.must_equal '* [Object, {}]* [Module, {}]' }
|
46
|
+
|
47
|
+
# ViewModel.cell(collection: []).() invokes #show.
|
48
|
+
it { Cell::ViewModel.cell("public_test/song", collection: [Object, Module]).().must_equal '[Object, {}][Module, {}]' }
|
49
|
+
|
50
|
+
# ViewModel.cell(collection: []).(:detail) invokes #detail instead of #show.
|
51
|
+
it { Cell::ViewModel.cell("public_test/song", collection: [Object, Module]).(:detail).must_equal '* [Object, {}]* [Module, {}]' }
|
52
|
+
|
53
|
+
# #cell(collection: [], genre: "Fusion").() doesn't change options hash.
|
54
|
+
it do
|
55
|
+
Cell::ViewModel.cell("public_test/song", options = { genre: "Fusion", collection: [Object] }).()
|
56
|
+
options.to_s.must_equal "{:genre=>\"Fusion\", :collection=>[Object]}"
|
57
|
+
end
|
46
58
|
|
47
|
-
#
|
59
|
+
# it do
|
60
|
+
# content = ""
|
61
|
+
# Cell::ViewModel.cell("public_test/song", collection: [Object, Module]).each_with_index do |cell, i|
|
62
|
+
# content += (i == 1 ? cell.(:detail) : cell.())
|
63
|
+
# end
|
64
|
+
|
65
|
+
# content.must_equal '[Object, {}]* [Module, {}]'
|
66
|
+
# end
|
67
|
+
|
68
|
+
# cell(collection: []).join captures return value and joins it for you.
|
69
|
+
it do
|
70
|
+
Cell::ViewModel.cell("public_test/song", collection: [Object, Module]).join do |cell, i|
|
71
|
+
i == 1 ? cell.(:detail) : cell.()
|
72
|
+
end.must_equal '[Object, {}]* [Module, {}]'
|
73
|
+
end
|
74
|
+
|
75
|
+
# cell(collection: []).join("<") captures return value and joins it for you with join.
|
76
|
+
it do
|
77
|
+
Cell::ViewModel.cell("public_test/song", collection: [Object, Module]).join(">") do |cell, i|
|
78
|
+
i == 1 ? cell.(:detail) : cell.()
|
79
|
+
end.must_equal '[Object, {}]>* [Module, {}]'
|
80
|
+
end
|
81
|
+
end
|
data/test/render_test.rb
CHANGED
@@ -47,6 +47,10 @@ class SongCell < Cell::ViewModel
|
|
47
47
|
"send"
|
48
48
|
end
|
49
49
|
|
50
|
+
def with_block
|
51
|
+
render { "Clean Sheets" + render(:with_html) }
|
52
|
+
end
|
53
|
+
|
50
54
|
private
|
51
55
|
def title
|
52
56
|
"Papertiger"
|
@@ -72,9 +76,6 @@ class RenderTest < MiniTest::Spec
|
|
72
76
|
# works with state called `send`
|
73
77
|
it { SongCell.new(nil).call(:send).must_equal "send" }
|
74
78
|
|
75
|
-
# #call returns html_safe.
|
76
|
-
it { SongCell.new(nil).call.must_be_instance_of ActiveSupport::SafeBuffer }
|
77
|
-
|
78
79
|
# throws an exception when not found.
|
79
80
|
it do
|
80
81
|
exception = assert_raises(Cell::TemplateMissingError) { SongCell.new(nil).unknown }
|
@@ -99,6 +100,9 @@ class RenderTest < MiniTest::Spec
|
|
99
100
|
|
100
101
|
# doesn't escape HTML.
|
101
102
|
it { SongCell.new(nil).call(:with_html).must_equal "<p>Yew!</p>" }
|
103
|
+
|
104
|
+
# render {} with block
|
105
|
+
it { SongCell.new(nil).with_block.must_equal "Yo! Clean Sheets<p>Yew!</p>\n" }
|
102
106
|
end
|
103
107
|
|
104
108
|
# test inheritance
|
data/test/test_helper.rb
CHANGED
@@ -1,13 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
require 'minitest/autorun'
|
5
|
-
|
6
|
-
require 'minitest/reporters'
|
7
|
-
Minitest::Reporters.use! [Minitest::Reporters::ProgressReporter.new]
|
8
|
-
require "rails/test_help" # adds stuff like @routes, etc.
|
9
|
-
|
10
|
-
require 'cells'
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "cells"
|
11
3
|
require "cells-erb"
|
12
4
|
|
13
5
|
Cell::ViewModel.send(:include, Cell::Erb) if Cell.const_defined?(:Erb) # FIXME: should happen in inititalizer.
|
@@ -19,31 +11,3 @@ end
|
|
19
11
|
class BassistCell < Cell::ViewModel
|
20
12
|
self.view_paths = ['test/fixtures']
|
21
13
|
end
|
22
|
-
|
23
|
-
class MusicianController < ActionController::Base
|
24
|
-
def view_with_concept_with_show
|
25
|
-
render inline: %{<%= concept("view_extensions_test/cell", "Up For Breakfast", volume: 1).show %>} # TODO: concept doesn't need .call
|
26
|
-
end
|
27
|
-
|
28
|
-
def view_with_concept_without_call
|
29
|
-
render inline: %{<%= concept("view_extensions_test/cell", "A Tale That Wasn't Right") %>} # this tests ViewModel#to_s.
|
30
|
-
end
|
31
|
-
|
32
|
-
def view_with_concept_with_call
|
33
|
-
render inline: %{<%= concept("view_extensions_test/cell", "A Tale That Wasn't Right").call %>}
|
34
|
-
end
|
35
|
-
|
36
|
-
def view_with_cell_with_call
|
37
|
-
render inline: %{<%= cell("view_extensions_test/song", "A Tale That Wasn't Right").call %>}
|
38
|
-
end
|
39
|
-
|
40
|
-
def action_with_concept_with_call
|
41
|
-
render text: concept("view_extensions_test/cell", "A Tale That Wasn't Right").call
|
42
|
-
end
|
43
|
-
|
44
|
-
def action_with_cell_with_call
|
45
|
-
render text: cell("view_extensions_test/song", "A Tale That Wasn't Right").call
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
Rails.backtrace_cleaner.remove_silencers! # YES, stacktraces are awesome!
|
@@ -21,7 +21,7 @@ class TestCaseTest < MiniTest::Spec
|
|
21
21
|
it { subject.must_be_instance_of SongCell }
|
22
22
|
it { subject.model.must_equal song }
|
23
23
|
|
24
|
-
it { cell("test_case_test/song", collection: [song, song]).must_equal "Give It All!Give It All!" }
|
24
|
+
it { cell("test_case_test/song", collection: [song, song]).().must_equal "Give It All!Give It All!" }
|
25
25
|
end
|
26
26
|
|
27
27
|
|
@@ -51,7 +51,7 @@ class CapybaraTest < MiniTest::Spec
|
|
51
51
|
|
52
52
|
it { subject.(:show).has_selector?('b').must_equal true }
|
53
53
|
|
54
|
-
it { cell("capybara_test/capybara", collection: [1, 2]).has_selector?('b').must_equal true }
|
54
|
+
it { cell("capybara_test/capybara", collection: [1, 2]).().has_selector?('b').must_equal true }
|
55
55
|
|
56
56
|
# FIXME: this kinda sucks, what if you want the string in a Capybara environment?
|
57
57
|
it { subject.(:show).to_s.must_match "<b>Grunt</b>" }
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cells
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.1.0.rc1
|
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-04
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uber
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.0.9
|
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: 0.0.9
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -58,20 +58,6 @@ dependencies:
|
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: minitest-reporters
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '0'
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0'
|
75
61
|
- !ruby/object:Gem::Dependency
|
76
62
|
name: capybara
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,74 +101,38 @@ files:
|
|
115
101
|
- README.md
|
116
102
|
- Rakefile
|
117
103
|
- TODO.md
|
104
|
+
- benchmarks/class_builder.rb
|
105
|
+
- benchmarks/collection.rb
|
118
106
|
- cells.gemspec
|
119
|
-
- gemfiles/rails3.2.gemfile
|
120
|
-
- gemfiles/rails4.0.gemfile
|
121
|
-
- gemfiles/rails4.1.gemfile
|
122
|
-
- gemfiles/rails4.2.gemfile
|
123
107
|
- lib/cell.rb
|
124
108
|
- lib/cell/abstract.rb
|
109
|
+
- lib/cell/builder.rb
|
125
110
|
- lib/cell/caching.rb
|
126
|
-
- lib/cell/
|
111
|
+
- lib/cell/collection.rb
|
127
112
|
- lib/cell/concept.rb
|
128
113
|
- lib/cell/development.rb
|
129
114
|
- lib/cell/escaped.rb
|
130
115
|
- lib/cell/layout.rb
|
131
116
|
- lib/cell/partial.rb
|
132
117
|
- lib/cell/prefixes.rb
|
133
|
-
- lib/cell/rails.rb
|
134
|
-
- lib/cell/railtie.rb
|
135
118
|
- lib/cell/self_contained.rb
|
136
119
|
- lib/cell/templates.rb
|
137
|
-
- lib/cell/test_case.rb
|
138
120
|
- lib/cell/testing.rb
|
139
|
-
- lib/cell/translation.rb
|
140
121
|
- lib/cell/twin.rb
|
141
122
|
- lib/cell/util.rb
|
142
123
|
- lib/cell/version.rb
|
143
124
|
- lib/cell/view_model.rb
|
144
125
|
- lib/cells.rb
|
145
|
-
- lib/rails/generators/cell/cell_generator.rb
|
146
|
-
- lib/rails/generators/cell/templates/cell.rb.erb
|
147
|
-
- lib/rails/generators/cell/templates/view.erb
|
148
|
-
- lib/rails/generators/cell/templates/view.haml
|
149
|
-
- lib/rails/generators/cell/templates/view.slim
|
150
|
-
- lib/rails/generators/concept/concept_generator.rb
|
151
|
-
- lib/rails/generators/concept/templates/concept.rb.erb
|
152
|
-
- lib/rails/generators/concept/templates/view.erb
|
153
|
-
- lib/rails/generators/concept/templates/view.haml
|
154
|
-
- lib/rails/generators/concept/templates/view.slim
|
155
|
-
- lib/rails/generators/test_unit/cell/cell_generator.rb
|
156
|
-
- lib/rails/generators/test_unit/cell/templates/unit_test.rb.erb
|
157
|
-
- lib/rails/generators/test_unit/concept/concept_generator.rb
|
158
|
-
- lib/rails/generators/test_unit/concept/templates/unit_test.rb.erb
|
159
126
|
- lib/tasks/cells.rake
|
160
127
|
- test/builder_test.rb
|
161
|
-
- test/caching_test.rb
|
162
128
|
- test/cell_benchmark.rb
|
163
|
-
- test/cell_generator_test.rb
|
164
129
|
- test/cell_test.rb
|
165
|
-
- test/concept_generator_test.rb
|
166
130
|
- test/concept_test.rb
|
167
|
-
- test/
|
168
|
-
- test/dummy/app/assets/javascripts/application.js
|
169
|
-
- test/dummy/app/cells/album/assets/album.js
|
170
|
-
- test/dummy/app/concepts/song/assets/songs.js
|
171
|
-
- test/dummy/app/controllers/application_controller.rb
|
172
|
-
- test/dummy/app/views/layouts/application.html.erb
|
173
|
-
- test/dummy/app/views/musician/featured.html.erb
|
174
|
-
- test/dummy/app/views/musician/featured_with_block.html.erb
|
175
|
-
- test/dummy/app/views/musician/hamlet.html.erb
|
176
|
-
- test/dummy/app/views/musician/title.erb
|
177
|
-
- test/dummy/config.ru
|
178
|
-
- test/dummy/config/application.rb
|
179
|
-
- test/dummy/config/boot.rb
|
180
|
-
- test/dummy/config/database.yml
|
181
|
-
- test/dummy/config/environment.rb
|
182
|
-
- test/dummy/config/locales/en.yml
|
183
|
-
- test/dummy/config/routes.rb
|
184
|
-
- test/dummy/script/rails
|
131
|
+
- test/context_test.rb
|
185
132
|
- test/fixtures/bassist/play.erb
|
133
|
+
- test/fixtures/cell_test/song/show_with_block.erb
|
134
|
+
- test/fixtures/comment/layout/show.erb
|
135
|
+
- test/fixtures/comment/show/show.erb
|
186
136
|
- test/fixtures/concepts/record/views/layout.erb
|
187
137
|
- test/fixtures/concepts/record/views/show.erb
|
188
138
|
- test/fixtures/concepts/record/views/song.erb
|
@@ -194,6 +144,7 @@ files:
|
|
194
144
|
- test/fixtures/partials/_show.xml.erb
|
195
145
|
- test/fixtures/song/ivar.erb
|
196
146
|
- test/fixtures/song/show.erb
|
147
|
+
- test/fixtures/song/with_block.erb
|
197
148
|
- test/fixtures/song/with_erb.erb
|
198
149
|
- test/fixtures/song/with_html.erb
|
199
150
|
- test/fixtures/song/with_locals.erb
|
@@ -213,104 +164,10 @@ files:
|
|
213
164
|
- test/prefixes_test.rb
|
214
165
|
- test/property_test.rb
|
215
166
|
- test/public_test.rb
|
216
|
-
- test/rails/translation_test.rb
|
217
|
-
- test/rails4.2/.gitignore
|
218
|
-
- test/rails4.2/Gemfile
|
219
|
-
- test/rails4.2/README.rdoc
|
220
|
-
- test/rails4.2/Rakefile
|
221
|
-
- test/rails4.2/app/assets/images/.keep
|
222
|
-
- test/rails4.2/app/assets/stylesheets/application.css.erb
|
223
|
-
- test/rails4.2/app/cells/form_for/show.erb
|
224
|
-
- test/rails4.2/app/cells/form_for_cell.rb
|
225
|
-
- test/rails4.2/app/cells/form_tag/show.erb
|
226
|
-
- test/rails4.2/app/cells/form_tag_cell.rb
|
227
|
-
- test/rails4.2/app/cells/formtastic/show.erb
|
228
|
-
- test/rails4.2/app/cells/formtastic_cell.rb
|
229
|
-
- test/rails4.2/app/cells/simple_form/show.erb
|
230
|
-
- test/rails4.2/app/cells/simple_form_cell.rb
|
231
|
-
- test/rails4.2/app/cells/song/song.css
|
232
|
-
- test/rails4.2/app/cells/song/with_escaped.erb
|
233
|
-
- test/rails4.2/app/cells/song_cell.rb
|
234
|
-
- test/rails4.2/app/controllers/application_controller.rb
|
235
|
-
- test/rails4.2/app/controllers/concerns/.keep
|
236
|
-
- test/rails4.2/app/controllers/index_controller.rb
|
237
|
-
- test/rails4.2/app/controllers/songs_controller.rb
|
238
|
-
- test/rails4.2/app/helpers/application_helper.rb
|
239
|
-
- test/rails4.2/app/mailers/.keep
|
240
|
-
- test/rails4.2/app/models/.keep
|
241
|
-
- test/rails4.2/app/models/artist.rb
|
242
|
-
- test/rails4.2/app/models/concerns/.keep
|
243
|
-
- test/rails4.2/app/models/song.rb
|
244
|
-
- test/rails4.2/app/views/index/index.html.erb
|
245
|
-
- test/rails4.2/app/views/layouts/application.html.erb
|
246
|
-
- test/rails4.2/app/views/songs/show.html.erb
|
247
|
-
- test/rails4.2/app/views/songs/with_escaped.html.erb
|
248
|
-
- test/rails4.2/bin/bundle
|
249
|
-
- test/rails4.2/bin/rails
|
250
|
-
- test/rails4.2/bin/rake
|
251
|
-
- test/rails4.2/bin/setup
|
252
|
-
- test/rails4.2/config.ru
|
253
|
-
- test/rails4.2/config/application.rb
|
254
|
-
- test/rails4.2/config/boot.rb
|
255
|
-
- test/rails4.2/config/environment.rb
|
256
|
-
- test/rails4.2/config/environments/development.rb
|
257
|
-
- test/rails4.2/config/environments/production.rb
|
258
|
-
- test/rails4.2/config/environments/test.rb
|
259
|
-
- test/rails4.2/config/initializers/backtrace_silencers.rb
|
260
|
-
- test/rails4.2/config/initializers/cookies_serializer.rb
|
261
|
-
- test/rails4.2/config/initializers/filter_parameter_logging.rb
|
262
|
-
- test/rails4.2/config/initializers/formtastic.rb
|
263
|
-
- test/rails4.2/config/initializers/inflections.rb
|
264
|
-
- test/rails4.2/config/initializers/mime_types.rb
|
265
|
-
- test/rails4.2/config/initializers/session_store.rb
|
266
|
-
- test/rails4.2/config/initializers/wrap_parameters.rb
|
267
|
-
- test/rails4.2/config/locales/en.yml
|
268
|
-
- test/rails4.2/config/routes.rb
|
269
|
-
- test/rails4.2/config/secrets.yml
|
270
|
-
- test/rails4.2/db/seeds.rb
|
271
|
-
- test/rails4.2/engines/my_engine/.gitignore
|
272
|
-
- test/rails4.2/engines/my_engine/Gemfile
|
273
|
-
- test/rails4.2/engines/my_engine/MIT-LICENSE
|
274
|
-
- test/rails4.2/engines/my_engine/README.rdoc
|
275
|
-
- test/rails4.2/engines/my_engine/Rakefile
|
276
|
-
- test/rails4.2/engines/my_engine/app/assets/images/my_engine/.keep
|
277
|
-
- test/rails4.2/engines/my_engine/app/assets/stylesheets/my_engine/application.css
|
278
|
-
- test/rails4.2/engines/my_engine/app/concepts/user/cell.rb
|
279
|
-
- test/rails4.2/engines/my_engine/app/concepts/user/views/show.erb
|
280
|
-
- test/rails4.2/engines/my_engine/app/concepts/user/views/user.scss
|
281
|
-
- test/rails4.2/engines/my_engine/app/controllers/my_engine/application_controller.rb
|
282
|
-
- test/rails4.2/engines/my_engine/app/controllers/my_engine/user_controller.rb
|
283
|
-
- test/rails4.2/engines/my_engine/app/helpers/my_engine/application_helper.rb
|
284
|
-
- test/rails4.2/engines/my_engine/app/models/my_engine/user.rb
|
285
|
-
- test/rails4.2/engines/my_engine/app/views/layouts/my_engine/application.html.erb
|
286
|
-
- test/rails4.2/engines/my_engine/app/views/my_engine/user/show.html.erb
|
287
|
-
- test/rails4.2/engines/my_engine/bin/rails
|
288
|
-
- test/rails4.2/engines/my_engine/config/routes.rb
|
289
|
-
- test/rails4.2/engines/my_engine/db/migrate/20150530135920_create_my_engine_users.rb
|
290
|
-
- test/rails4.2/engines/my_engine/lib/my_engine.rb
|
291
|
-
- test/rails4.2/engines/my_engine/lib/my_engine/engine.rb
|
292
|
-
- test/rails4.2/engines/my_engine/lib/my_engine/version.rb
|
293
|
-
- test/rails4.2/engines/my_engine/lib/tasks/my_engine_tasks.rake
|
294
|
-
- test/rails4.2/engines/my_engine/my_engine.gemspec
|
295
|
-
- test/rails4.2/engines/my_engine/test/fixtures/my_engine/users.yml
|
296
|
-
- test/rails4.2/engines/my_engine/test/models/my_engine/user_test.rb
|
297
|
-
- test/rails4.2/lib/assets/.keep
|
298
|
-
- test/rails4.2/lib/tasks/.keep
|
299
|
-
- test/rails4.2/log/.keep
|
300
|
-
- test/rails4.2/test/integration/asset_pipeline_test.rb
|
301
|
-
- test/rails4.2/test/integration/controller_test.rb
|
302
|
-
- test/rails4.2/test/integration/form_for_test.rb
|
303
|
-
- test/rails4.2/test/integration/form_tag_test.rb
|
304
|
-
- test/rails4.2/test/integration/formtastic_test.rb
|
305
|
-
- test/rails4.2/test/integration/simple_form_test.rb
|
306
|
-
- test/rails4.2/test/integration/url_helper_test.rb
|
307
|
-
- test/rails4.2/test/test_helper.rb
|
308
|
-
- test/rails4.2/vendor/assets/stylesheets/.keep
|
309
|
-
- test/rails_extensions_test.rb
|
310
167
|
- test/render_test.rb
|
311
168
|
- test/templates_test.rb
|
312
|
-
- test/test_case_test.rb
|
313
169
|
- test/test_helper.rb
|
170
|
+
- test/testing_test.rb
|
314
171
|
- test/twin_test.rb
|
315
172
|
homepage: https://github.com/apotonick/cells
|
316
173
|
licenses:
|
@@ -327,9 +184,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
327
184
|
version: '0'
|
328
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
329
186
|
requirements:
|
330
|
-
- - "
|
187
|
+
- - ">"
|
331
188
|
- !ruby/object:Gem::Version
|
332
|
-
version:
|
189
|
+
version: 1.3.1
|
333
190
|
requirements: []
|
334
191
|
rubyforge_project:
|
335
192
|
rubygems_version: 2.4.8
|