dom 0.2.12 → 0.2.13
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 +9 -6
- 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: 5fcc9d16e2d98366cf60bcb4b83763a51453cff4
|
4
|
+
data.tar.gz: 2d1915dfd1d6f0a105f9cb50b81c0710d97bb000
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a31881d6d5ddf48288e53cf518f533e7eb36fdbce7f3d7ec647dd649ccec349c4567678e0cfa59f94346af8026f2771d85b68fae627f2176a2a92158b04d933b
|
7
|
+
data.tar.gz: 96a5e830017ddb0f9a29b90796e6225b65a04171cbe3a29a445ac376dc2af034a19769fe5c57989df217af5923e5b12678bbb7b033acebe61ac7813b8b920fd3
|
data/lib/dom.rb
CHANGED
@@ -12,15 +12,18 @@ module Dom
|
|
12
12
|
def self.compact; singleton_class.class_eval{alias join join_compact} end
|
13
13
|
def self.nested; singleton_class.class_eval{alias join join_nested} end
|
14
14
|
def self.pre; singleton_class.class_eval{alias join join_pre} end
|
15
|
-
def self.join_compact a, tag
|
16
|
-
a.map{|e| e.to_s.escape_html(tag)}.join
|
15
|
+
def self.join_compact a, tag
|
16
|
+
a.map{|e| e.to_s.escape_html(tag)}.join
|
17
17
|
end
|
18
18
|
def self.join_nested a, tag
|
19
|
-
|
19
|
+
a.map{|e| e.to_s.escape_html(tag).concat($/)}
|
20
|
+
.join.gsub(/^/o, Indent)
|
21
|
+
.prepend($/)
|
20
22
|
end
|
21
23
|
def self.join_pre a, tag
|
22
|
-
|
23
|
-
|
24
|
+
a.map{|e| e.to_s.escape_html(tag).prepend("-->".freeze).concat("<!--#$/".freeze)}
|
25
|
+
.join.gsub(/^/o, Indent)
|
26
|
+
.prepend("<!--#$/".freeze).concat("-->".freeze)
|
24
27
|
end
|
25
28
|
def self.attr h; h.map{|k, v| " %s=\"%s\"".freeze % [hyphenize(k), v]}.join end
|
26
29
|
def self.json_attr h; h.map{|k, v| [hyphenize(k), v]}.to_h end
|
@@ -109,4 +112,4 @@ class Array
|
|
109
112
|
def jsonml tag, attr = nil; [Dom.hyphenize(tag), *([Dom.json_attr(attr)] if attr), *self] end
|
110
113
|
end
|
111
114
|
|
112
|
-
Dom.
|
115
|
+
Dom.compact
|
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.2.
|
4
|
+
version: 0.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email: []
|