as_foo 1.0.1 → 1.0.2

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: cd3dd8ac8a58d77aa61b739976d031d6589f0574
4
- data.tar.gz: ca90df53dcfee806b29992cc38713665a89e1960
3
+ metadata.gz: c8de3a11e04f746a2d53eb97928d39a6c6d07919
4
+ data.tar.gz: 9465d20087508d53be79dfc29cac2c5db7ef5aa0
5
5
  SHA512:
6
- metadata.gz: cfdb32008d7f30c2b00a77f1d75f9c85d568c08ad637411207c66e3673d601bfd65dd0541674f47f5342c0d6eb5fe9e15ff12837bc10d3fe057cd2052433087c
7
- data.tar.gz: e4601e4b930a3dd7148ef30a248f02cb09f84195e29d879270ae5691c1437c4604d0fcb20ee1327b5c32ee00bc5ea9379ebd4a678d3daf46dcf8764a8496eeac
6
+ metadata.gz: 51c723d2f44906c77456200e8ee4b7d8a6435421a8c13c345f35136ee7aacf283602fc943659b3719c976aa577ae956d45fc9a94ab5967bff20bc00453bbd05b
7
+ data.tar.gz: d4f7ebe561669887c46683975cbda3154947aafdf006a2a9981c56839305de15b3e21edeffb1e4543576fe23f934ef54ad0d3d488c466cdef325c4e895a2c215
@@ -1,11 +1,29 @@
1
+ require 'tempfile'
2
+
1
3
  module AsFoo
2
4
  module AsHtml
5
+ # @return [String] converted string
3
6
  def as_html(with: :w3m, options: nil)
4
7
  case with
5
8
  when :w3m
6
9
  IO.popen("w3m -dump -T text/html", "w") do |w3m|
7
10
  w3m.puts self.to_s
8
11
  end
12
+ when :lynx
13
+ IO.popen("lynx -dump -nonumbers -nolist -stdin", "w") do |lynx|
14
+ lynx.puts self.to_s
15
+ end
16
+ when :links
17
+ Tempfile.open ["as_foo", ".html"] do |src|
18
+ src.puts self.to_s
19
+ src.flush
20
+
21
+ `links -dump #{src.path}`
22
+ end
23
+ when :elinks
24
+ IO.popen("elinks -dump -no-numbering -no-references", "w") do |elinks|
25
+ elinks.puts self.to_s
26
+ end
9
27
  else
10
28
  raise ArgumentError.new("unexpected method #{with}")
11
29
  end
@@ -1,3 +1,3 @@
1
1
  module AsFoo
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
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.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - tmaeda