dom 0.2.20 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dom.rb +5 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45c2b9f780aa0382a519fa229b30d3f5280a5c3a
4
- data.tar.gz: ef72a2936d334ed7e37e32cfd1a28ddcd58372b6
3
+ metadata.gz: 725c0601cc16a957eb12880a87ce87e01eeb2b47
4
+ data.tar.gz: 17d99811b313bafb2e4cd609f445f07192e62359
5
5
  SHA512:
6
- metadata.gz: 11d629a8c050bfe6b18cfff7f6077c5270f4d5d10b04d07725ade66174bac1b46904fff57eb6ff8217579ace4a29956ed5702d5d9a363d4f6fb37f91b4dc057e
7
- data.tar.gz: 2d385cf363aebc140a76ba6af94798f79c7c9777237880e212d457b81dd8b1e4abc58ff1c05b455285ede13d454cab768ddf5290f161f099b4a9784d60de8577
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; h.map{|k, v| " %s=\"%s\"".freeze % [hyphenize(k), v]}.join end
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.2.20
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-01 00:00:00.000000000 Z
11
+ date: 2015-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities