html2haml 1.0.0.beta.1 → 1.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/html2haml.gemspec +5 -5
- data/lib/html2haml.rb +1 -1
- data/lib/html2haml/html.rb +1 -1
- data/lib/html2haml/version.rb +1 -1
- data/test/html2haml_test.rb +6 -0
- metadata +133 -115
data/README.md
CHANGED
data/html2haml.gemspec
CHANGED
@@ -15,11 +15,11 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Html2haml::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency 'hpricot'
|
18
|
+
gem.add_dependency 'hpricot', '~> 0.8.6'
|
19
|
+
gem.add_dependency 'erubis', '~> 2.7.0'
|
20
|
+
gem.add_dependency 'ruby_parser', '~> 3.1.1'
|
19
21
|
gem.add_dependency 'haml', '>= 3.2.0.beta.1'
|
20
|
-
gem.add_development_dependency '
|
21
|
-
gem.add_development_dependency '
|
22
|
-
gem.add_development_dependency 'simplecov'
|
22
|
+
gem.add_development_dependency 'simplecov', '~> 0.7.1'
|
23
|
+
gem.add_development_dependency 'minitest', '~> 4.4.0'
|
23
24
|
gem.add_development_dependency 'rake'
|
24
|
-
gem.add_development_dependency 'minitest'
|
25
25
|
end
|
data/lib/html2haml.rb
CHANGED
data/lib/html2haml/html.rb
CHANGED
@@ -319,7 +319,7 @@ module Haml
|
|
319
319
|
if child.is_a?(::Hpricot::Text)
|
320
320
|
if !child.to_s.include?("\n")
|
321
321
|
text = child.to_haml(tabs + 1, options)
|
322
|
-
return output + " " + text.lstrip.gsub(/^\\/, '') unless text.chomp.include?("\n")
|
322
|
+
return output + " " + text.lstrip.gsub(/^\\/, '') unless text.chomp.include?("\n") || text.empty?
|
323
323
|
return output + "\n" + text
|
324
324
|
elsif ["pre", "textarea"].include?(name) ||
|
325
325
|
(name == "code" && parent.is_a?(::Hpricot::Elem) && parent.name == "pre")
|
data/lib/html2haml/version.rb
CHANGED
data/test/html2haml_test.rb
CHANGED
@@ -290,6 +290,12 @@ HAML
|
|
290
290
|
HTML
|
291
291
|
end
|
292
292
|
|
293
|
+
def test_haml_tags_should_be_on_new_line_after_tag_with_blank_content
|
294
|
+
xml = "<weight> </weight>\n<pages>102</pages>"
|
295
|
+
haml = "%weight\n%pages 102"
|
296
|
+
assert_equal haml, render(xml)
|
297
|
+
end
|
298
|
+
|
293
299
|
# Encodings
|
294
300
|
|
295
301
|
unless RUBY_VERSION < "1.9"
|
metadata
CHANGED
@@ -1,136 +1,146 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: html2haml
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 309340781
|
5
5
|
prerelease: 6
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
- beta
|
11
|
+
- 2
|
12
|
+
version: 1.0.0.beta.2
|
6
13
|
platform: ruby
|
7
|
-
authors:
|
14
|
+
authors:
|
8
15
|
- Norman Clarke
|
9
16
|
autorequire:
|
10
17
|
bindir: bin
|
11
18
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
19
|
+
|
20
|
+
date: 2013-01-14 00:00:00 Z
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: 3.2.0.beta.1
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 51
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 8
|
33
|
+
- 6
|
34
|
+
version: 0.8.6
|
38
35
|
type: :runtime
|
36
|
+
name: hpricot
|
37
|
+
version_requirements: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
39
|
prerelease: false
|
40
|
-
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 19
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 7
|
49
|
+
- 0
|
50
|
+
version: 2.7.0
|
51
|
+
type: :runtime
|
47
52
|
name: erubis
|
48
|
-
|
49
|
-
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :development
|
53
|
+
version_requirements: *id002
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
55
|
prerelease: false
|
56
|
-
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 1
|
62
|
+
segments:
|
63
|
+
- 3
|
64
|
+
- 1
|
65
|
+
- 1
|
66
|
+
version: 3.1.1
|
67
|
+
type: :runtime
|
63
68
|
name: ruby_parser
|
64
|
-
|
65
|
-
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
69
|
+
version_requirements: *id003
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
71
|
prerelease: false
|
72
|
-
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 309340683
|
78
|
+
segments:
|
79
|
+
- 3
|
80
|
+
- 2
|
81
|
+
- 0
|
82
|
+
- beta
|
83
|
+
- 1
|
84
|
+
version: 3.2.0.beta.1
|
85
|
+
type: :runtime
|
86
|
+
name: haml
|
87
|
+
version_requirements: *id004
|
88
|
+
- !ruby/object:Gem::Dependency
|
87
89
|
prerelease: false
|
88
|
-
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ! '>='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: rake
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
90
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
97
91
|
none: false
|
98
|
-
requirements:
|
99
|
-
- -
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
|
92
|
+
requirements:
|
93
|
+
- - ~>
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: 1
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
- 7
|
99
|
+
- 1
|
100
|
+
version: 0.7.1
|
102
101
|
type: :development
|
102
|
+
name: simplecov
|
103
|
+
version_requirements: *id005
|
104
|
+
- !ruby/object:Gem::Dependency
|
103
105
|
prerelease: false
|
104
|
-
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: minitest
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
113
107
|
none: false
|
114
|
-
requirements:
|
115
|
-
- -
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
108
|
+
requirements:
|
109
|
+
- - ~>
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
hash: 47
|
112
|
+
segments:
|
113
|
+
- 4
|
114
|
+
- 4
|
115
|
+
- 0
|
116
|
+
version: 4.4.0
|
118
117
|
type: :development
|
118
|
+
name: minitest
|
119
|
+
version_requirements: *id006
|
120
|
+
- !ruby/object:Gem::Dependency
|
119
121
|
prerelease: false
|
120
|
-
|
122
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
121
123
|
none: false
|
122
|
-
requirements:
|
123
|
-
- -
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
hash: 3
|
128
|
+
segments:
|
129
|
+
- 0
|
130
|
+
version: "0"
|
131
|
+
type: :development
|
132
|
+
name: rake
|
133
|
+
version_requirements: *id007
|
126
134
|
description: Converts HTML into Haml
|
127
|
-
email:
|
135
|
+
email:
|
128
136
|
- norman@njclarke.com
|
129
|
-
executables:
|
137
|
+
executables:
|
130
138
|
- html2haml
|
131
139
|
extensions: []
|
140
|
+
|
132
141
|
extra_rdoc_files: []
|
133
|
-
|
142
|
+
|
143
|
+
files:
|
134
144
|
- .gitignore
|
135
145
|
- .travis.yml
|
136
146
|
- Gemfile
|
@@ -149,32 +159,40 @@ files:
|
|
149
159
|
- test/test_helper.rb
|
150
160
|
homepage: http://haml.info
|
151
161
|
licenses: []
|
162
|
+
|
152
163
|
post_install_message:
|
153
164
|
rdoc_options: []
|
154
|
-
|
165
|
+
|
166
|
+
require_paths:
|
155
167
|
- lib
|
156
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
168
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
157
169
|
none: false
|
158
|
-
requirements:
|
159
|
-
- -
|
160
|
-
- !ruby/object:Gem::Version
|
161
|
-
|
162
|
-
segments:
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
hash: 3
|
174
|
+
segments:
|
163
175
|
- 0
|
164
|
-
|
165
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
|
+
version: "0"
|
177
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
178
|
none: false
|
167
|
-
requirements:
|
168
|
-
- -
|
169
|
-
- !ruby/object:Gem::Version
|
179
|
+
requirements:
|
180
|
+
- - ">"
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
hash: 25
|
183
|
+
segments:
|
184
|
+
- 1
|
185
|
+
- 3
|
186
|
+
- 1
|
170
187
|
version: 1.3.1
|
171
188
|
requirements: []
|
189
|
+
|
172
190
|
rubyforge_project:
|
173
191
|
rubygems_version: 1.8.24
|
174
192
|
signing_key:
|
175
193
|
specification_version: 3
|
176
194
|
summary: Converts HTML into Haml
|
177
|
-
test_files:
|
195
|
+
test_files:
|
178
196
|
- test/erb_test.rb
|
179
197
|
- test/html2haml_test.rb
|
180
198
|
- test/test_helper.rb
|