dom 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dom.rb +3 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49c3fb432d27f5488f5955f5b99153e274ab55a1
4
- data.tar.gz: 41b6f84db64138f97586c68287bbf7b7e7f6c3ed
3
+ metadata.gz: d5fa791a4e500fdbd727915ccd58b8762d070543
4
+ data.tar.gz: 1906c21e96eed5e55d92bf54aa98b0cce3278759
5
5
  SHA512:
6
- metadata.gz: 8161f52adbecfdcc1ad7ffcdc473a73c5b5441cbe4d8d1fa0265280b1e65f21bcec23ebe612c2f5957c7d49a48063dbca59a901cb7aaca4b0db01fb74e6de06e
7
- data.tar.gz: 6fde54d4c5a320f265590de3532e28e69941e4f239119c93edbcc20e2ac16cce5d3c14193ac4010a5b6b6e6355b5438d1bb95b8b9738816892242b7a50def64c
6
+ metadata.gz: 57a57beacfe0992d5ca6f356aabe9c6aefa6efefac97ba858d3ae2c7be049081c5b11841c9ee3c8b1d02bfa5f40075092454333c77b4c46890afaef5d8db3a87
7
+ data.tar.gz: 4ce4864868494e6831319b8cd489a7476127fce1f69c6655975a24282693232bd65502a2cd414c622e784a18b77b7d89f94e093f61df02f4b437c55acd9af06e
data/lib/dom.rb CHANGED
@@ -31,7 +31,7 @@ end
31
31
  class String
32
32
  def dom tag, attr = {}
33
33
  "<#{Dom.hyphenize(tag)}#{Dom.attr(attr)}>"\
34
- "#{escape_html(tag)}"\
34
+ "#{escape_html(tag).ansi2html}"\
35
35
  "</#{Dom.hyphenize(tag)}>".escaped
36
36
  end
37
37
  def escape_html tag = nil
@@ -42,8 +42,6 @@ class String
42
42
  AnsiColor = {
43
43
  "1" => "bold",
44
44
  "4" => "underline",
45
- "5" => "blink",
46
- "7" => "inverse",
47
45
  "30" => "black",
48
46
  "31" => "red",
49
47
  "32" => "green",
@@ -62,7 +60,7 @@ class String
62
60
  "47" => "bg-white",
63
61
  }
64
62
  def ansi2html
65
- ansi = StringScanner.new(escape_html)
63
+ ansi = StringScanner.new(self)
66
64
  html = StringIO.new
67
65
  until ansi.eos?
68
66
  if ansi.scan(/\e\[0?m/)
@@ -73,7 +71,7 @@ class String
73
71
  html.print(ansi.scan(/./m))
74
72
  end
75
73
  end
76
- html.string.escaped
74
+ html.string
77
75
  end
78
76
  end
79
77
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawa
@@ -36,7 +36,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
36
36
  version: '0'
37
37
  requirements: []
38
38
  rubyforge_project:
39
- rubygems_version: 2.2.0.preview.1
39
+ rubygems_version: 2.1.10
40
40
  signing_key:
41
41
  specification_version: 4
42
42
  summary: Creates HTML DOM strings