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 +4 -4
- data/README.md +3 -4
- data/lib/as_foo/as_html.rb +13 -6
- data/lib/as_foo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c015c7baaf1bf6ef7df94264e0cda609b65ccff
|
4
|
+
data.tar.gz: 2efb3140001087926e31725a9c085e5f478d8298
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/as_foo/as_html.rb
CHANGED
@@ -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
|
-
|
22
|
-
|
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
|
-
|
26
|
-
|
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
|
-
|
37
|
-
|
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}")
|
data/lib/as_foo/version.rb
CHANGED