cells-haml 0.0.4 → 0.0.5
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/.travis.yml +4 -3
- data/CHANGES.md +4 -0
- data/Gemfile +2 -1
- data/README.md +14 -1
- data/gemfiles/rails_3.2-tilt-1.4.gemfile +1 -0
- data/gemfiles/rails_4.2-tilt-2.0-rails-haml-0.9.gemfile +1 -2
- data/gemfiles/rails_4.2-tilt-2.0.gemfile +1 -0
- data/lib/cell/haml/version.rb +1 -1
- data/lib/cell/haml.rb +4 -0
- data/test/cell_generator_test.rb +3 -0
- data/test/dummy/app/cells/song/with_form_tag_and_content_tag.haml +6 -1
- data/test/haml_test.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd4c38d60926730d8aaeefa655c4d664f54b36db
|
4
|
+
data.tar.gz: 26c520c2ecd3c86539c5e09173f97c2de9355296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 867a4ba00077cc2a18e90f28c3d6fd8d60bb5cd88b759c6c3ffeb66a78addba373de26e34cc078a90de62b263e30892fd4dcf00725b21c7335a2d19ce4f8c8b9
|
7
|
+
data.tar.gz: 0569e7d9142a1c7223e9ba613424611442fc3c5cc2c3f0eca4359824a6b916c6d448a5ba1f5c7535f682ed76240ba748e0dd1a2f569860055be1856ccd366f78
|
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
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/
|
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
|
|
data/lib/cell/haml/version.rb
CHANGED
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
|
data/test/cell_generator_test.rb
CHANGED
@@ -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=\"✓\" />"
|
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=\"✓\" /></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=\"✓\" /><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=\"✓\" /></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=\"✓\" /><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=\"✓\" /></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
|
+
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-
|
12
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cells
|