cells-haml 0.0.1 → 0.0.2
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 -0
- data/cells-haml.gemspec +7 -6
- data/gemfiles/rails_4.2-tilt-1.4.gemfile +15 -0
- data/gemfiles/rails_4.2-tilt-2.0.gemfile +13 -0
- data/gemfiles/rails_4.2-tilt-3.0.gemfile +13 -0
- data/lib/cell/haml.rb +1 -2
- data/lib/cell/haml/version.rb +5 -0
- data/lib/{cells/haml.rb → cells-haml.rb} +0 -0
- data/test/dummy/app/cells/song/with_content_tag.haml +1 -0
- data/test/dummy/app/cells/song/with_content_tag_and_content_tag.haml +4 -0
- data/test/dummy/app/cells/song/with_form_tag_and_content_tag.haml +8 -0
- data/test/dummy/app/cells/song_cell.rb +42 -0
- data/test/haml_test.rb +36 -3
- data/test/test_helper.rb +5 -8
- metadata +23 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d164d78990344d5558e5e9a0e599a025e6e9edf
|
4
|
+
data.tar.gz: 9ecf73ac5ef7ab21a6ac190730a0a5277f9dba64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58dec84fbd28d6a92506d64fe92d30e11dd7a3df4b1e13aebfbc1211854d5faee464e5f7eeaec3849a363d97e1a800c0d43445b71b18ca222cfc9fea6d6a63b2
|
7
|
+
data.tar.gz: 7204ba46aeb830d110493064adc5cc3426bfe9da4a2e59772160d14772872224be7a5446b9f3aeb775de6a85975f1d96d8bc4d3179c60c0aad512dfd5877bdec
|
data/.travis.yml
ADDED
data/cells-haml.gemspec
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
|
2
|
-
lib
|
3
|
-
|
1
|
+
lib = File.expand_path('../lib/', __FILE__)
|
2
|
+
$:.unshift lib unless $:.include?(lib)
|
3
|
+
|
4
|
+
require 'cell/haml/version'
|
4
5
|
|
5
6
|
Gem::Specification.new do |spec|
|
6
7
|
spec.name = 'cells-haml'
|
7
|
-
spec.version =
|
8
|
+
spec.version = Cell::Haml::VERSION
|
8
9
|
spec.authors = ['Abdelkader Boudih', 'Nick Sutterer']
|
9
10
|
spec.email = %w(terminale@gmail.com apotonick@gmail.com)
|
10
11
|
spec.summary = 'Haml integration for Cells'
|
@@ -18,6 +19,6 @@ Gem::Specification.new do |spec|
|
|
18
19
|
|
19
20
|
spec.add_runtime_dependency 'cells', '~> 4.0.0.beta'
|
20
21
|
spec.add_runtime_dependency 'haml', '~> 4.0'
|
21
|
-
spec.add_development_dependency 'bundler'
|
22
|
-
spec.add_development_dependency 'rake'
|
22
|
+
spec.add_development_dependency 'bundler'
|
23
|
+
spec.add_development_dependency 'rake'
|
23
24
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "cells", :github => "apotonick/cells"
|
6
|
+
#gem "cells", path: "../../cells"
|
7
|
+
gem "appraisal"
|
8
|
+
gem "railties", "~> 4.2.0"
|
9
|
+
gem "activemodel"
|
10
|
+
gem "minitest", "~> 5.2"
|
11
|
+
gem "tilt", "~> 1.4"
|
12
|
+
|
13
|
+
gemspec :path => "../"
|
14
|
+
|
15
|
+
# gem "erbse", path: "../../erbse"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "cells", :github => "apotonick/cells"
|
6
|
+
#gem "cells", path: "../../cells"
|
7
|
+
gem "appraisal"
|
8
|
+
gem "railties", "~> 4.2.0"
|
9
|
+
gem "activemodel"
|
10
|
+
gem "minitest", "~> 5.2"
|
11
|
+
gem "tilt", "~> 2.0"
|
12
|
+
|
13
|
+
gemspec :path => "../"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "cells", :github => "apotonick/cells"
|
6
|
+
#gem "cells", path: "../../cells"
|
7
|
+
gem "appraisal"
|
8
|
+
gem "railties", "~> 4.2.0"
|
9
|
+
gem "activemodel"
|
10
|
+
gem "minitest", "~> 5.2"
|
11
|
+
gem "tilt", "~> 3.0"
|
12
|
+
|
13
|
+
gemspec :path => "../"
|
data/lib/cell/haml.rb
CHANGED
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
= content_tag(:div) { "Beachparty" }
|
@@ -0,0 +1,42 @@
|
|
1
|
+
class SongCell < Cell::ViewModel
|
2
|
+
self.view_paths = ["test/dummy/app/cells"]
|
3
|
+
|
4
|
+
include ActionView::Helpers::FormHelper
|
5
|
+
|
6
|
+
def with_form_tag_and_content_tag
|
7
|
+
render
|
8
|
+
end
|
9
|
+
|
10
|
+
def with_content_tag_and_content_tag
|
11
|
+
render
|
12
|
+
end
|
13
|
+
|
14
|
+
def with_content_tag
|
15
|
+
render
|
16
|
+
end
|
17
|
+
|
18
|
+
def with_block
|
19
|
+
render
|
20
|
+
end
|
21
|
+
|
22
|
+
def with_capture
|
23
|
+
render
|
24
|
+
end
|
25
|
+
|
26
|
+
def with_form_tag
|
27
|
+
form_tag("/songs") + content_tag(:span) + "</form>"
|
28
|
+
end
|
29
|
+
|
30
|
+
def with_link_to
|
31
|
+
render
|
32
|
+
end
|
33
|
+
|
34
|
+
def with_form_for_block
|
35
|
+
render
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
def cap
|
40
|
+
"yay, #{with_output_buffer { yield } }"
|
41
|
+
end
|
42
|
+
end
|
data/test/haml_test.rb
CHANGED
@@ -1,7 +1,40 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class HamlTest < MiniTest::
|
4
|
-
|
5
|
-
|
3
|
+
class HamlTest < MiniTest::Spec
|
4
|
+
it { Cell::ViewModel.template_engine.must_equal :haml }
|
5
|
+
|
6
|
+
|
7
|
+
let (:controller) { ApplicationController.new.tap { |ctl| ctl.send("request=", ActionDispatch::Request.new({})) } }
|
8
|
+
let (:song_cell) { SongCell.new(controller) }
|
9
|
+
|
10
|
+
|
11
|
+
# URL helpers work in cell instance.
|
12
|
+
it { song_cell.songs_path.must_equal "/songs" }
|
13
|
+
|
14
|
+
# content_tag { }
|
15
|
+
it { song_cell.(:with_content_tag).must_equal "<div>Beachparty</div>\n" }
|
16
|
+
|
17
|
+
# content_tag { content_tag { } }
|
18
|
+
it do song_cell.(:with_content_tag_and_content_tag).must_equal %{<span>Title:
|
19
|
+
<div>Still Knee Deep
|
20
|
+
</div>
|
21
|
+
</span>
|
22
|
+
}
|
6
23
|
end
|
24
|
+
|
25
|
+
# form_tag { content_tag { } }
|
26
|
+
it( "xxx") do
|
27
|
+
form_tag = "<form action=\"/erubis/is/horribly/outdated\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" />"
|
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
|
+
|
30
|
+
song_cell.(:with_form_tag_and_content_tag).must_equal %{Word.
|
31
|
+
#{form_tag}
|
32
|
+
<a href=\"/rails/sucks\">hallo
|
33
|
+
</a>
|
34
|
+
<ul>Hallo
|
35
|
+
</ul>
|
36
|
+
</form>
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
7
40
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,13 +1,10 @@
|
|
1
|
-
|
2
|
-
require 'byebug'
|
3
|
-
rescue LoadError
|
4
|
-
end
|
5
|
-
require 'minitest/reporters'
|
6
|
-
Minitest::Reporters.use! [Minitest::Reporters::ProgressReporter.new]
|
1
|
+
require "pp"
|
7
2
|
require 'minitest/autorun'
|
8
3
|
|
9
4
|
ENV['RAILS_ENV'] = 'test'
|
10
5
|
|
11
|
-
|
6
|
+
|
7
|
+
require "cells"
|
12
8
|
require_relative 'dummy/config/environment'
|
13
|
-
|
9
|
+
|
10
|
+
require "cells-haml"
|
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.2
|
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-
|
12
|
+
date: 2015-05-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cells
|
@@ -45,28 +45,28 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rake
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '0'
|
70
70
|
description: Haml integration for Cells
|
71
71
|
email:
|
72
72
|
- terminale@gmail.com
|
@@ -76,15 +76,24 @@ extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
78
|
- ".gitignore"
|
79
|
+
- ".travis.yml"
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE.txt
|
81
82
|
- README.md
|
82
83
|
- Rakefile
|
83
84
|
- cells-haml.gemspec
|
85
|
+
- gemfiles/rails_4.2-tilt-1.4.gemfile
|
86
|
+
- gemfiles/rails_4.2-tilt-2.0.gemfile
|
87
|
+
- gemfiles/rails_4.2-tilt-3.0.gemfile
|
84
88
|
- lib/cell/haml.rb
|
85
|
-
- lib/
|
89
|
+
- lib/cell/haml/version.rb
|
90
|
+
- lib/cells-haml.rb
|
86
91
|
- test/cell_generator_test.rb
|
87
92
|
- test/dummy/Rakefile
|
93
|
+
- test/dummy/app/cells/song/with_content_tag.haml
|
94
|
+
- test/dummy/app/cells/song/with_content_tag_and_content_tag.haml
|
95
|
+
- test/dummy/app/cells/song/with_form_tag_and_content_tag.haml
|
96
|
+
- test/dummy/app/cells/song_cell.rb
|
88
97
|
- test/dummy/app/controllers/application_controller.rb
|
89
98
|
- test/dummy/config.ru
|
90
99
|
- test/dummy/config/application.rb
|
@@ -116,13 +125,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
125
|
version: '0'
|
117
126
|
requirements: []
|
118
127
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.2.2
|
120
129
|
signing_key:
|
121
130
|
specification_version: 4
|
122
131
|
summary: Haml integration for Cells
|
123
132
|
test_files:
|
124
133
|
- test/cell_generator_test.rb
|
125
134
|
- test/dummy/Rakefile
|
135
|
+
- test/dummy/app/cells/song/with_content_tag.haml
|
136
|
+
- test/dummy/app/cells/song/with_content_tag_and_content_tag.haml
|
137
|
+
- test/dummy/app/cells/song/with_form_tag_and_content_tag.haml
|
138
|
+
- test/dummy/app/cells/song_cell.rb
|
126
139
|
- test/dummy/app/controllers/application_controller.rb
|
127
140
|
- test/dummy/config.ru
|
128
141
|
- test/dummy/config/application.rb
|
@@ -134,4 +147,3 @@ test_files:
|
|
134
147
|
- test/dummy/config/routes.rb
|
135
148
|
- test/haml_test.rb
|
136
149
|
- test/test_helper.rb
|
137
|
-
has_rdoc:
|