domle 0.1.2 → 0.1.3

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: c830dcf992357cfe04748c13ec2dc18a9020c464
4
- data.tar.gz: a29e017b90fcdbf5ef4713a791e6f253bae1a141
3
+ metadata.gz: fb3013d941c1c1b1d0b13f23f9acf8b20f39997f
4
+ data.tar.gz: f8f62155e72a7dff085b873c80b99702b1ec534c
5
5
  SHA512:
6
- metadata.gz: 1779704903b8de04ac5480e6d30bbe9664fb3a8be90134f5cd3330618f757f802bd1f3e1db798aeae271319b5560a4eaf96e63c1d9c3a21768425c5f11723a4a
7
- data.tar.gz: 0024445bf1148f3fbf0f4ed7a92ebe841ae08b315754dff07d93277d603544dc6f002dc18308a3d337983c50da7df335cae161e3a541b67c98bd61f290714d2b
6
+ metadata.gz: e4fd7b2fd084715d8a920b7d5d693be8752e3d5cb81f122aa528a90035ffea30fe4a43287cff44f24eb9ec3bc4537df68b7759b6cff5e728b8d1e8d1f84f38a3
7
+ data.tar.gz: c83d09b5a84a56468ecb7aa87f6e23bb410c684c68bf3a8f8371c27a399e5a526e826e62a779d67bc30bacd49527fa193dc9a95a06f93144b1d33815a02f680f
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/domle.rb CHANGED
@@ -129,14 +129,13 @@ class Domle < Rexle
129
129
 
130
130
  raw_selector,raw_styles = entry.split(/{/,2)
131
131
 
132
- h = raw_styles.split(/;/).inject({}) do |r, x|
132
+ h = raw_styles.strip.split(/;/).inject({}) do |r, x|
133
133
  k, v = x.split(/:/,2).map(&:strip)
134
134
  r.merge(k.to_sym => v)
135
135
  end
136
136
 
137
137
  [raw_selector.split(/,\s*/).map(&:strip), h]
138
138
  end
139
-
140
139
 
141
140
  # add each CSS style attribute to the element
142
141
  # e.g. a = [[['line'],{stroke: 'green'}]]
@@ -176,25 +175,29 @@ class Domle < Rexle
176
175
  if children then
177
176
 
178
177
  children.each do |x|
178
+
179
179
  if x.is_a? Array then
180
180
 
181
181
  element.add_element scan_element(*x)
182
+
182
183
  elsif x.is_a? String then
183
184
 
184
- e = if x.is_a? String then
185
+ if x.is_a? String then
185
186
 
186
- x
187
+ element.add_element(x) if x.strip.length > 0
188
+
187
189
  elsif x.name == '![' then
188
190
 
189
- Rexle::CData.new(x)
191
+ e = Rexle::CData.new(x)
192
+ element.add_element e
190
193
 
191
194
  elsif x.name == '!-' then
192
195
 
193
- Rexle::Comment.new(x)
196
+ e = Rexle::Comment.new(x)
197
+ element.add_element e
194
198
 
195
199
  end
196
-
197
- element.add_element e
200
+
198
201
  end
199
202
  end
200
203
  end
data.tar.gz.sig CHANGED
@@ -1 +1,2 @@
1
- ���+�����ǻ�+����u,A2�h6,Of{f$��+�f����Yi
1
+ DI����\(�"����t&mh������Et��͏�K�o�x���uc<�h���6����m`�\��o�"��(M;��ie�r���@��]��C4��* 4fߟ)�BI��Ӄ�U��}��:W�����ϪN�%D�D������g�4%��D��_!ٍ&D��S��J͒��0�C���
2
+ ��-T^��vV?^�Ry=rW�<�W����u�5x�����$���k4������q�a���
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  muChG/wXkD8GIq07qcmVUML8wWvVNdAWtcW8E1gAnZxpblXiaPWUR2/GPHFIWD96
32
32
  MQgLkQyjNK0weA==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-11-27 00:00:00.000000000 Z
34
+ date: 2015-11-28 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexle
metadata.gz.sig CHANGED
Binary file