cells-haml 0.0.4 → 0.0.5

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: 1cdad224d97c15e3ca642dcea8d9449b2b1298ae
4
- data.tar.gz: f665747209ac4d5d7cff32d680677b811be68a87
3
+ metadata.gz: bd4c38d60926730d8aaeefa655c4d664f54b36db
4
+ data.tar.gz: 26c520c2ecd3c86539c5e09173f97c2de9355296
5
5
  SHA512:
6
- metadata.gz: 6d3d433ac40e0cf825f3bca8a058739faa9bab14ed28f78fa48ff4a35ea38aed4bf7490ec7231367e3ae3135630c1e2f63811c9ef483bdfc87174b82fca5a6ef
7
- data.tar.gz: 33413f055c224c4157fe835f97820b59d24caec46c4e7fbf2b7be2bcdf7ad0f1687dc49f378e996174f826aa8a3afe3fb888558608a2cb0a0918e074637330ae
6
+ metadata.gz: 867a4ba00077cc2a18e90f28c3d6fd8d60bb5cd88b759c6c3ffeb66a78addba373de26e34cc078a90de62b263e30892fd4dcf00725b21c7335a2d19ce4f8c8b9
7
+ data.tar.gz: 0569e7d9142a1c7223e9ba613424611442fc3c5cc2c3f0eca4359824a6b916c6d448a5ba1f5c7535f682ed76240ba748e0dd1a2f569860055be1856ccd366f78
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
+ cache: bundler
1
2
  gemfile:
2
- - gemfiles/rails4.2-tilt-1.4.gemfile
3
- - gemfiles/rails4.2-tilt-2.0.gemfile
4
- - gemfiles/rails3.2-tilt-1.4.gemfile
3
+ - gemfiles/rails_4.2-tilt-1.4.gemfile
4
+ - gemfiles/rails_4.2-tilt-2.0.gemfile
5
+ - gemfiles/rails_3.2-tilt-1.4.gemfile
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.0.5
2
+
3
+ * Remove Haml's buggy `#form_for` version until Haml 4.1 is out, which fixes this by simply not overriding the helper at all. Include `Cell::Haml` after including the form helpers.
4
+
1
5
  # 0.0.4
2
6
 
3
7
  * Added `capture` helper to override Rails escaping.
data/Gemfile CHANGED
@@ -10,4 +10,5 @@ gem 'railties'
10
10
  gem 'actionpack'
11
11
  gem 'actionview'
12
12
  gem 'appraisal'
13
- gem 'minitest-reporters'
13
+ gem 'minitest-reporters'
14
+ # gem "haml", github: "haml/haml" # we need 4.1.
data/README.md CHANGED
@@ -29,7 +29,20 @@ class SongCell < Cell::ViewModel
29
29
  end
30
30
  ```
31
31
 
32
- If that doesn't work, [read the docs](http://trailblazerb.org/cells/gems/cells4.html#escaping).
32
+ If that doesn't work, [read the docs](http://trailblazerb.org/gems/cells/cells4.html#html-escaping).
33
+
34
+ ## `form_for` Problems
35
+
36
+ Haml < 4.1.0 overrides many Rails helpers and introduces bugs. They are fixed in Haml 4.1 (by simply removing the code). In case you're on 4.0.6 and `form_for` doesn't render properly, include `Cell::Haml`.
37
+
38
+ ```ruby
39
+ class SongCell < Cell::ViewModel
40
+ include ActionView::Helpers::FormHelper
41
+ include Cell::Haml # include Haml _after_ AV helpers.
42
+
43
+ # ..
44
+ end
45
+ ```
33
46
 
34
47
  ## Dependencies
35
48
 
@@ -9,5 +9,6 @@ gem "activemodel"
9
9
  gem "minitest", "~> 4.0"
10
10
  gem "tilt", "~> 1.4"
11
11
  gem "tzinfo"
12
+ # gem "haml", github: "haml/haml"
12
13
 
13
14
  gemspec :path => "../"
@@ -2,8 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # gem "cells", :github => "apotonick/cells"
6
- gem "cells", path: "../../cells"
5
+ gem "cells", github: "apotonick/cells"
7
6
  gem "appraisal"
8
7
  gem "railties", "~> 4.2.0"
9
8
  gem "activemodel"
@@ -4,6 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  # gem "cells", :github => "apotonick/cells"
6
6
  # gem "cells", path: "../../cells"
7
+ gem "cells", github: "apotonick/cells"
7
8
  gem "railties", "~> 4.2.0"
8
9
  gem "activemodel"
9
10
  gem "minitest", "~> 5.2"
@@ -1,5 +1,5 @@
1
1
  module Cell
2
2
  module Haml
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
data/lib/cell/haml.rb CHANGED
@@ -16,6 +16,10 @@ module Cell
16
16
  extra_tags = extra_tags_for_form(html_options)
17
17
  "#{tag(:form, html_options, true) + extra_tags}"
18
18
  end
19
+
20
+ def form_for(*args, &block) # TODO: remove this once Haml 4.1 is out. the form_for_with_haml is buggy.
21
+ form_for_without_haml(*args, &block)
22
+ end
19
23
  end
20
24
 
21
25
  ViewModel.template_engine = :haml
@@ -8,6 +8,7 @@ class CellGeneratorTest < Rails::Generators::TestCase
8
8
  setup :prepare_destination
9
9
 
10
10
  test 'create the standard assets' do
11
+ skip("need to be implemented")
11
12
  run_generator %w(blog post latest)
12
13
 
13
14
  assert_file 'app/cells/blog_cell.rb', /class BlogCell < Cell::ViewModel/
@@ -24,6 +25,7 @@ class CellGeneratorTest < Rails::Generators::TestCase
24
25
  end
25
26
 
26
27
  test 'work with namespaces' do
28
+ skip("need to be implemented")
27
29
  run_generator %w(blog/post latest)
28
30
  assert_file 'app/cells/blog/post_cell.rb', /class Blog::PostCell < Cell::ViewModel/
29
31
  assert_file 'app/cells/blog/post_cell.rb', /def show/
@@ -32,6 +34,7 @@ class CellGeneratorTest < Rails::Generators::TestCase
32
34
  end
33
35
 
34
36
  test 'work with namespaces and haml' do
37
+ skip("need to be implemented")
35
38
  run_generator %w(blog/post latest)
36
39
  assert_file 'app/cells/blog/post_cell.rb', /class Blog::PostCell < Cell::ViewModel/
37
40
  assert_file 'app/cells/blog/post/latest.haml', %r{app/cells/blog/post/latest\.haml}
@@ -1,6 +1,7 @@
1
1
  Word.
2
2
 
3
3
  = form_tag "/erubis/is/horribly/outdated" do
4
+ = text_field_tag :id
4
5
  = link_to "/rails/sucks" do
5
6
  hallo
6
7
 
@@ -26,4 +27,8 @@ Weiter!
26
27
  = breadcrumbs
27
28
 
28
29
  = current_page
29
- = form_tag_with_body( {url: "/rails/escapes/too/much"}, %{<input type="button"/>})
30
+ = form_tag_with_body( {url: "/rails/escapes/too/much"}, %{<input type="button"/>})
31
+
32
+
33
+ = form_for OpenStruct.new, url: "/", as: "open" do |f|
34
+ = f.text_field :id
data/test/haml_test.rb CHANGED
@@ -27,11 +27,18 @@ class HamlTest < MiniTest::Spec
27
27
  form_tag = "<form action=\"/erubis/is/horribly/outdated\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" />"
28
28
  form_tag = "<form accept-charset=\"UTF-8\" action=\"/erubis/is/horribly/outdated\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /></div>" if ActionPack::VERSION::MAJOR == 3
29
29
 
30
+ input_tag = %{<input type="text" name="id" id="id" />}
31
+ input_tag = "<input id=\"id\" name=\"id\" type=\"text\" />" if ActionPack::VERSION::MAJOR == 3
32
+
30
33
  form_with_body_tag = "<form url=\"/rails/escapes/too/much\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"button\"/></form>"
31
34
  form_with_body_tag = "<form method=\"post\" url=\"/rails/escapes/too/much\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /></div><input type=\"button\"/></form>" if ActionPack::VERSION::MAJOR == 3
32
35
 
36
+ form_for_tag = "<form class=\"new_open\" id=\"new_open\" action=\"/\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"text\" name=\"open[id]\" id=\"open_id\" />"
37
+ form_for_tag = "<form accept-charset=\"UTF-8\" action=\"/\" class=\"new_open\" id=\"new_open\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /></div><input id=\"open_id\" name=\"open[id]\" size=\"30\" type=\"text\" />" if ActionPack::VERSION::MAJOR == 3
38
+
33
39
  song_cell.(:with_form_tag_and_content_tag).must_equal %{Word.
34
40
  #{form_tag}
41
+ #{input_tag}
35
42
  <a href=\"/rails/sucks\">hallo
36
43
  </a>
37
44
  <ul>Hallo
@@ -45,6 +52,8 @@ Bonjour!
45
52
  <a href=\"/1\">1</a>+<a href=\"/2\">2</a>
46
53
  <b>No current page!<b>
47
54
  #{form_with_body_tag}
55
+ #{form_for_tag}
56
+ </form>
48
57
  }
49
58
  end
50
59
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cells-haml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-26 00:00:00.000000000 Z
12
+ date: 2015-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cells