html2slim 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html2slim/converter.rb +1 -1
- data/lib/html2slim/hpricot_monkeypatches.rb +3 -3
- data/lib/html2slim/version.rb +1 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eece9c3c64833b43a38e67031800308ca6575ca
|
4
|
+
data.tar.gz: 63335c0229a9e8161aab1e8ac29c18a4e08703ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3bb20dd62fa408f22657ee9fda3bb3a10b9d157ccd97e42aa0c4b5e4d6c1615d43818f896b2566e76e102d86b6890506fa8a80ee42fa63eaeb6625f2d0e2195
|
7
|
+
data.tar.gz: 654678b5831303841e368fbda3935b4963b79ccbce5258d9a703cd48562e44849db37ae306421e37ff03af15213771a01e4ee6eb892462df6132617bc7266fcb
|
data/lib/html2slim/converter.rb
CHANGED
@@ -27,7 +27,7 @@ module HTML2Slim
|
|
27
27
|
# when
|
28
28
|
erb.gsub!(/<%-?\s*(when .+?)\s*-?%>/){ %(</ruby><ruby code="#{$1}">) }
|
29
29
|
erb.gsub!(/<%\s*(end|}|end\s+-)\s*%>/, %(</ruby>))
|
30
|
-
erb.gsub!(/<%(.+?)\s
|
30
|
+
erb.gsub!(/<%(.+?)\s*-?%>/m){ %(<ruby code="#{$1.gsub(/"/, '"')}"></ruby>) }
|
31
31
|
@slim ||= Hpricot(erb).to_slim
|
32
32
|
end
|
33
33
|
end
|
@@ -47,7 +47,7 @@ class Hpricot::Elem
|
|
47
47
|
def slim(lvl=0)
|
48
48
|
r = ' ' * lvl
|
49
49
|
|
50
|
-
return r + slim_ruby_code if ruby?
|
50
|
+
return r + slim_ruby_code(r) if ruby?
|
51
51
|
|
52
52
|
r += name unless skip_tag_name?
|
53
53
|
r += slim_id
|
@@ -66,8 +66,8 @@ class Hpricot::Elem
|
|
66
66
|
|
67
67
|
private
|
68
68
|
|
69
|
-
def slim_ruby_code
|
70
|
-
(code.strip[0] == "=" ? "" : "- ") + code.strip
|
69
|
+
def slim_ruby_code(r)
|
70
|
+
(code.strip[0] == "=" ? "" : "- ") + code.strip.gsub(/\n/, "\n#{r}- ")
|
71
71
|
end
|
72
72
|
|
73
73
|
def code
|
data/lib/html2slim/version.rb
CHANGED
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html2slim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maiz Lulkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hpricot
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: slim
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.0.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.0.0
|
69
69
|
description: Convert HTML to Slim templates. Because HTML sux and Slim rules. That's
|
@@ -90,22 +90,22 @@ licenses: []
|
|
90
90
|
metadata: {}
|
91
91
|
post_install_message:
|
92
92
|
rdoc_options:
|
93
|
-
- --charset=UTF-8
|
93
|
+
- "--charset=UTF-8"
|
94
94
|
require_paths:
|
95
95
|
- lib
|
96
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
|
-
- -
|
98
|
+
- - ">="
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- -
|
103
|
+
- - ">="
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.2.2
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: HTML to Slim converter.
|