html2slim 0.0.7 → 0.0.8

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: 3bc3fada1656e8d16d5876c29d30f531e65fb010
4
- data.tar.gz: 334914f553df8a9a7f825531588fb60292633b14
3
+ metadata.gz: 28bcd8f53ea559fa98de58411e7a05d798b9f34a
4
+ data.tar.gz: 73b83d8151046b9490517db175ffe8e0246c4c5e
5
5
  SHA512:
6
- metadata.gz: f1da35f46338b2229ebbfb0397f6c9bfe38adf44c9e0597a6356222afbfdcee3a1c714302f9ca8f92a54afa75dc2b7efa04fbfbf214341fc45baa2dc52133b30
7
- data.tar.gz: 1f4767f0588c2f61446c9a339e0b214e45fd5c177d0cfc457bd0594a799b57eee8589ef34b4cd78b7cdadc32a6adab0e80f2880fe0df18d4926bafebba602587
6
+ metadata.gz: fc892a892be65315ddd54423431731f6aff146860437826bc2a708f67a8c2651fc860bb1c65b5332a5a5c6fe5f4d6975e460a327becb73ebec7c213ba9a82978
7
+ data.tar.gz: ee218a556404152cd3df416aff6bdb1e6541ab80917f7173b7417c5d62e30af2f7a417ed15cb2d884c46b736a9af322659f89a0e2247de8cef80eefa8e37d61b
@@ -1,7 +1,6 @@
1
1
  require_relative 'hpricot_monkeypatches'
2
2
 
3
3
  module HTML2Slim
4
- B
5
4
  class Converter
6
5
  def to_s
7
6
  @slim
@@ -28,7 +27,7 @@ module HTML2Slim
28
27
  # when
29
28
  erb.gsub!(/<%-?\s*(when .+?)\s*-?%>/){ %(</ruby><ruby code="#{$1}">) }
30
29
  erb.gsub!(/<%\s*(end|}|end\s+-)\s*%>/, %(</ruby>))
31
- erb.gsub!(/<%(.+?)\s*%>/){ %(<ruby code="#{$1.gsub(/"/, '&quot;')}"></ruby>) }
30
+ erb.gsub!(/<%(.+?)\s*-?%>/m){ %(<ruby code="#{$1.gsub(/"/, '&quot;')}"></ruby>) }
32
31
  @slim ||= Hpricot(erb).to_slim
33
32
  end
34
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
@@ -1,3 +1,3 @@
1
1
  module HTML2Slim
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
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.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maiz Lulkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-06 00:00:00.000000000 Z
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.0.6
108
+ rubygems_version: 2.2.2
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: HTML to Slim converter.