dom 0.2.20 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dom.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 725c0601cc16a957eb12880a87ce87e01eeb2b47
|
4
|
+
data.tar.gz: 17d99811b313bafb2e4cd609f445f07192e62359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a3e1d5914cb1f676c16bfda0c424857e73fb07f978aec79c702bcbf4ebf61de83185bf1644acd91af76dfd6a3d42610ee50009eda6a162a79426d7f6ca45a99
|
7
|
+
data.tar.gz: f3b0ae8b55c37bd98edb33b60dd7242d9375282d1d08a08ea05c7d382a9fc8587884975434ead579a53f404837aad88753764da4d86ef9671f9c3565a51bdcd6
|
data/lib/dom.rb
CHANGED
@@ -25,7 +25,11 @@ module Dom
|
|
25
25
|
.join.gsub(/^/o, Indent)
|
26
26
|
.prepend("<!--#$/".freeze).concat("-->".freeze)
|
27
27
|
end
|
28
|
-
def self.attr h
|
28
|
+
def self.attr h
|
29
|
+
" ".concat(h.map do
|
30
|
+
|k, v| ("%s=\"%s\"".freeze % [hyphenize(k), v == true ? "".freeze : v]) if v
|
31
|
+
end.compact.join" ".freeze)
|
32
|
+
end
|
29
33
|
def self.json_attr h; h.map{|k, v| [hyphenize(k), v]}.to_h end
|
30
34
|
def self.hyphenize sym; sym.to_s.tr("_".freeze, "-".freeze) end
|
31
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|