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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10248a40af9eca0d333368d6df675d88f77be026
4
- data.tar.gz: b4fb151ae10270795f57f5a418d3e552424a2631
3
+ metadata.gz: b76f7af6aa82b7bb25811d8ee4f9234c4dab4e00
4
+ data.tar.gz: df30cb687c526aeaf05f0569bb977c600d881bd1
5
5
  SHA512:
6
- metadata.gz: bc18a9d14431f421008e3b758d2ac9e567c09cde38330fb0be8264c33682f98e3d32b38f96d1efce0111ff0b3981e60e8262d02ade5d0c5ac83573b6fe675dbc
7
- data.tar.gz: 3ba936fe9fa477efdf3504c6d2682f8251479b9cacf894bff4b5b95bac5025cc39c67bbc2fd005bf32febd6d519a833d366d299387336db9b281f996ae5cab8a
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
@@ -5,4 +5,4 @@ gem "activemodel", "~> 4.2.0"
5
5
  gem "minitest", "~> 5.2"
6
6
  gem "cells-erb", path: "../cells-erb"
7
7
 
8
- gemspec
8
+ gemspec
@@ -10,7 +10,7 @@ module Cell
10
10
  end
11
11
 
12
12
  def controller_path
13
- @controller_path ||= util.underscore(name.sub(/::Cell/, ''))
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
@@ -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.
@@ -1,3 +1,3 @@
1
1
  module Cell
2
- VERSION = "4.0.1"
2
+ VERSION = "4.0.2"
3
3
  end
@@ -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,8 +1,7 @@
1
1
  class FormForCell < Cell::ViewModel
2
2
  include ActionView::RecordIdentifier
3
- include ActionView::Helpers::FormHelper
4
3
 
5
4
  def show
6
5
  render
7
6
  end
8
- end
7
+ end
@@ -0,0 +1,5 @@
1
+ <%= form_tag songs_path do %>
2
+ Second
3
+ <%= text_field_tag :id %>
4
+ <%= submit_tag "Save" %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ class FormTagCell < Cell::ViewModel
2
+ def show
3
+ render
4
+ end
5
+ end
@@ -1,9 +1,8 @@
1
1
  class FormtasticCell < Cell::ViewModel
2
2
  include ActionView::RecordIdentifier
3
- include ActionView::Helpers::FormHelper
4
3
  include Formtastic::Helpers::FormHelper
5
4
 
6
5
  def show
7
6
  render
8
7
  end
9
- end
8
+ end
@@ -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
@@ -0,0 +1,2 @@
1
+ Formtastic::FormBuilder.action_class_finder = Formtastic::ActionClassFinder
2
+ Formtastic::FormBuilder.input_class_finder = Formtastic::InputClassFinder
@@ -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 = "TODO"
13
- s.summary = "TODO: Summary of MyEngine."
14
- s.description = "TODO: Description of MyEngine."
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=\"&#x2713;\" /> 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.1
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-23 00:00:00.000000000 Z
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