as_foo 1.0.3 → 1.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15806f9b676702f523658aa4b6fa37b9aa7a36c0
4
- data.tar.gz: d31a85c8805a37da5f5cf491a83a93a16eaf687b
3
+ metadata.gz: 5c015c7baaf1bf6ef7df94264e0cda609b65ccff
4
+ data.tar.gz: 2efb3140001087926e31725a9c085e5f478d8298
5
5
  SHA512:
6
- metadata.gz: 3bfc53849c17db94c6a5d2c717f7a13bc79e36cc25799abf37d99496ae9daf9e22bcbff31792526954f03fd18e319669da4519d807acad94b457b32b2995f2a0
7
- data.tar.gz: e81e7ad3cf1f15f1bd5d7ad2fee5f7f64a58191558b79cb9ce581fd02ce9446ff4ebafff31afde7d02b160c5180f6f568660f19cb34fd1507efec1ca4dfbc6b6
6
+ metadata.gz: 3bdd3a0a1ecdaa8a7133d25a6e5c844fda24b1bf70f6c20446df7a552b0ef0c37a71ab367bca95c7874e078540a3abe53cec60456098d99b02c8f89abfe3b053
7
+ data.tar.gz: 3a36bec2dbe81264a51f71a4bcd73f71b472c514aa23d3689934430a5f61cee48e0c4089741dddf863e08667155a0cbde3023878a4567d7469dc36bb5c4a56a1
data/README.md CHANGED
@@ -36,18 +36,17 @@ MARKDOWN
36
36
  => "# Sample\n- a\n- b\n"
37
37
  >> md.as_markdown
38
38
  => "<h1>Sample</h1>\n\n<ul>\n<li>a</li>\n<li>b</li>\n</ul>\n"
39
- >> md.as_markdown.as_html
39
+ >> puts md.as_markdown.as_html
40
40
  Sample
41
41
 
42
42
  • a
43
43
  • b
44
44
 
45
45
  => nil
46
- >>
47
46
 
48
47
  >> require 'open-uri'
49
48
  => true
50
- >> open("https://www.google.com/?hl=en").read.as_html
49
+ >> puts open("https://www.google.com/?hl=en").read.as_html
51
50
  Search Images Maps Play YouTube Gmail Drive Calendar More >>
52
51
  Web History | Settings | Sign in
53
52
 
@@ -69,7 +68,7 @@ Japan
69
68
 
70
69
  => nil
71
70
 
72
- >> open("https://www.google.com/?hl=en").read.as_html(with: :lynx)
71
+ >> puts open("https://www.google.com/?hl=en").read.as_html(with: :lynx)
73
72
 
74
73
  Search Images Maps Play YouTube Gmail Drive Calendar More ?
75
74
  Web History | Settings | Sign in
@@ -1,4 +1,5 @@
1
1
  require 'tempfile'
2
+ require 'open3'
2
3
 
3
4
  module AsFoo
4
5
  module AsHtml
@@ -18,12 +19,16 @@ module AsFoo
18
19
 
19
20
  case pager
20
21
  when :w3m
21
- IO.popen("w3m -dump -T text/html", "w") do |w3m|
22
- w3m.puts self.to_s
22
+ Open3.popen3("w3m -dump -T text/html") do |stdin, stdout, stderr|
23
+ stdin.puts self.to_s
24
+ stdin.close
25
+ stdout.read
23
26
  end
24
27
  when :lynx
25
- IO.popen("lynx -dump -nonumbers -nolist -stdin", "w") do |lynx|
26
- lynx.puts self.to_s
28
+ Open3.popen3("lynx -dump -nonumbers -nolist -stdin") do |stdin, stdout, stderr|
29
+ stdin.puts self.to_s
30
+ stdin.close
31
+ stdout.read
27
32
  end
28
33
  when :links
29
34
  Tempfile.open ["as_foo", ".html"] do |src|
@@ -33,8 +38,10 @@ module AsFoo
33
38
  `links -dump #{src.path}`
34
39
  end
35
40
  when :elinks
36
- IO.popen("elinks -dump -no-numbering -no-references", "w") do |elinks|
37
- elinks.puts self.to_s
41
+ Open3.popen3("elinks -dump -no-numbering -no-references") do |stdin, stdout, stderr|
42
+ stdin.puts self.to_s
43
+ stdin.close
44
+ stdout.read
38
45
  end
39
46
  else
40
47
  raise ArgumentError.new("unexpected method #{pager}")
@@ -1,3 +1,3 @@
1
1
  module AsFoo
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: as_foo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - tmaeda