cells 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/Gemfile +1 -1
- data/lib/cell/concept.rb +2 -2
- data/lib/cell/railtie.rb +1 -2
- data/lib/cell/version.rb +1 -1
- data/test/concept_test.rb +12 -1
- data/test/rails4.2/app/cells/form_for_cell.rb +1 -2
- data/test/rails4.2/app/cells/form_tag/show.erb +5 -0
- data/test/rails4.2/app/cells/form_tag_cell.rb +5 -0
- data/test/rails4.2/app/cells/formtastic_cell.rb +1 -2
- data/test/rails4.2/app/cells/simple_form_cell.rb +1 -2
- data/test/rails4.2/config/initializers/formtastic.rb +2 -0
- data/test/rails4.2/engines/my_engine/my_engine.gemspec +3 -3
- data/test/rails4.2/test/integration/form_tag_test.rb +11 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b76f7af6aa82b7bb25811d8ee4f9234c4dab4e00
|
4
|
+
data.tar.gz: df30cb687c526aeaf05f0569bb977c600d881bd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efe44290055279cd22f795672004e21764c9b20b6c79634ff6cb4524b4349da0037cc9a5b9b911e9f781f34b194cf7ccbecaaf5deb1c20344363ee958ceb7a05
|
7
|
+
data.tar.gz: 641bb7d1f002bee65738623df08c331506a0fc511ca9b6bb66648b00463ca73ca7b6b99123be04082544b86c76188ef848bc76b9ef5b6c2d089baf6121dfbc08
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 4.0.2
|
2
|
+
|
3
|
+
* In Rails, include `ActionView::Helpers::FormHelper` into `ViewModel` so we already have (and pollute our cell with) `UrlHelper` and `FormTagHelper`. Helpers, so much fun.
|
4
|
+
* Concept cells will now infer their name properly even if the string `Cell` appears twice.
|
5
|
+
|
1
6
|
## 4.0.1
|
2
7
|
|
3
8
|
* Support forgery protection in `form_tag`.
|
data/Gemfile
CHANGED
data/lib/cell/concept.rb
CHANGED
@@ -10,7 +10,7 @@ module Cell
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def controller_path
|
13
|
-
@controller_path ||= util.underscore(name.sub(
|
13
|
+
@controller_path ||= util.underscore(name.sub(/(::Cell$|Cell::)/, ''))
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -23,4 +23,4 @@ module Cell
|
|
23
23
|
|
24
24
|
self_contained!
|
25
25
|
end
|
26
|
-
end
|
26
|
+
end
|
data/lib/cell/railtie.rb
CHANGED
@@ -36,11 +36,10 @@ module Cell
|
|
36
36
|
initializer "cells.include_default_helpers" do
|
37
37
|
# include asset helpers (image_path, font_path, ect)
|
38
38
|
ViewModel.class_eval do
|
39
|
-
include ActionView::Helpers::UrlHelper
|
39
|
+
include ActionView::Helpers::FormHelper # includes ActionView::Helpers::UrlHelper, ActionView::Helpers::FormTagHelper
|
40
40
|
include ::Cell::RailsExtensions::HelpersAreShit
|
41
41
|
|
42
42
|
include ActionView::Helpers::AssetTagHelper
|
43
|
-
include ActionView::Helpers::FormTagHelper
|
44
43
|
end
|
45
44
|
|
46
45
|
# set VM#cache_store, etc.
|
data/lib/cell/version.rb
CHANGED
data/test/concept_test.rb
CHANGED
@@ -6,7 +6,7 @@ end
|
|
6
6
|
|
7
7
|
# Trailblazer style:
|
8
8
|
module Record
|
9
|
-
class Cell < Cell::Concept # cell("record")
|
9
|
+
class Cell < ::Cell::Concept # cell("record")
|
10
10
|
include ::Cell::Erb
|
11
11
|
|
12
12
|
def show
|
@@ -32,6 +32,15 @@ module Record
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
module Record
|
36
|
+
module Cells
|
37
|
+
class Cell < ::Cell::Concept
|
38
|
+
class Song < ::Cell::Concept
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
35
44
|
# app/cells/comment/views
|
36
45
|
# app/cells/comment/form/views
|
37
46
|
# app/cells/comment/views/form inherit_views Comment::Cell, render form/show
|
@@ -41,6 +50,8 @@ class ConceptTest < MiniTest::Spec
|
|
41
50
|
describe "::controller_path" do
|
42
51
|
it { Record::Cell.new.controller_path.must_equal "record" }
|
43
52
|
it { Record::Cell::Song.new.controller_path.must_equal "record/song" }
|
53
|
+
it { Record::Cells::Cell.new.controller_path.must_equal "record/cells" }
|
54
|
+
it { Record::Cells::Cell::Song.new.controller_path.must_equal "record/cells/song" }
|
44
55
|
end
|
45
56
|
|
46
57
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
class SimpleFormCell < Cell::ViewModel
|
2
2
|
include ActionView::RecordIdentifier
|
3
|
-
include ActionView::Helpers::FormHelper
|
4
3
|
include SimpleForm::ActionViewExtensions::FormHelper
|
5
4
|
|
6
5
|
# include ActiveSupport::Configurable
|
@@ -9,4 +8,4 @@ class SimpleFormCell < Cell::ViewModel
|
|
9
8
|
def show
|
10
9
|
render
|
11
10
|
end
|
12
|
-
end
|
11
|
+
end
|
@@ -9,9 +9,9 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.version = MyEngine::VERSION
|
10
10
|
s.authors = ["Alexander Huber"]
|
11
11
|
s.email = ["alih83@gmx.de"]
|
12
|
-
s.homepage = "
|
13
|
-
s.summary = "
|
14
|
-
s.description = "
|
12
|
+
s.homepage = "https://github.com/apotonick/cells"
|
13
|
+
s.summary = "Summary of MyEngine."
|
14
|
+
s.description = "Description of MyEngine."
|
15
15
|
s.license = "MIT"
|
16
16
|
|
17
17
|
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class FormTagTestTest < MiniTest::Spec
|
4
|
+
include Cell::Testing
|
5
|
+
controller SongsController
|
6
|
+
|
7
|
+
it do
|
8
|
+
cell("form_tag").().gsub(/\s\s/, "").must_equal %{<form action=\"/songs\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" /> Second <input type=\"text\" name=\"id\" id=\"id\" /> <input type=\"submit\" name=\"commit\" value=\"Save\" />
|
9
|
+
</form>}
|
10
|
+
end
|
11
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cells
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.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: 2015-06-
|
11
|
+
date: 2015-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uber
|
@@ -220,6 +220,8 @@ files:
|
|
220
220
|
- test/rails4.2/app/assets/stylesheets/application.css.erb
|
221
221
|
- test/rails4.2/app/cells/form_for/show.erb
|
222
222
|
- test/rails4.2/app/cells/form_for_cell.rb
|
223
|
+
- test/rails4.2/app/cells/form_tag/show.erb
|
224
|
+
- test/rails4.2/app/cells/form_tag_cell.rb
|
223
225
|
- test/rails4.2/app/cells/formtastic/show.erb
|
224
226
|
- test/rails4.2/app/cells/formtastic_cell.rb
|
225
227
|
- test/rails4.2/app/cells/simple_form/show.erb
|
@@ -255,6 +257,7 @@ files:
|
|
255
257
|
- test/rails4.2/config/initializers/backtrace_silencers.rb
|
256
258
|
- test/rails4.2/config/initializers/cookies_serializer.rb
|
257
259
|
- test/rails4.2/config/initializers/filter_parameter_logging.rb
|
260
|
+
- test/rails4.2/config/initializers/formtastic.rb
|
258
261
|
- test/rails4.2/config/initializers/inflections.rb
|
259
262
|
- test/rails4.2/config/initializers/mime_types.rb
|
260
263
|
- test/rails4.2/config/initializers/session_store.rb
|
@@ -295,6 +298,7 @@ files:
|
|
295
298
|
- test/rails4.2/test/integration/asset_pipeline_test.rb
|
296
299
|
- test/rails4.2/test/integration/controller_test.rb
|
297
300
|
- test/rails4.2/test/integration/form_for_test.rb
|
301
|
+
- test/rails4.2/test/integration/form_tag_test.rb
|
298
302
|
- test/rails4.2/test/integration/formtastic_test.rb
|
299
303
|
- test/rails4.2/test/integration/simple_form_test.rb
|
300
304
|
- test/rails4.2/test/integration/url_helper_test.rb
|