webget 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/webget/version.rb +1 -1
- data/lib/webget/webcache.rb +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f30b181118ed0b78e2617246be67187afbc82b06
|
4
|
+
data.tar.gz: a70be1694115592004e896f2b762db231896fdf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2279af9b0b84949ef8e175acdda2e91cdf2d41bda3a6048bfd43e1759731fe3f92f8f9f4008137017659644d4d013257bb551fb7d823c3217f1808470df3a8cf
|
7
|
+
data.tar.gz: 5551d7778d4c8e2664a34aa6f873189be48fdf64681e4a6b84eb9e73f11ec5109ccf5e5b6a0cdba9ee6bcea7f35bc9a1337723d5fe9ff1b3c8ca74eacaed7963
|
data/README.md
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
webget gem - yet (another) network client for world wide web (www) requests via HTTP
|
4
4
|
|
5
|
-
* home :: [github.com/rubycoco/
|
6
|
-
* bugs :: [github.com/rubycoco/
|
5
|
+
* home :: [github.com/rubycoco/fetcher](https://github.com/rubycoco/fetcher)
|
6
|
+
* bugs :: [github.com/rubycoco/fetcher/issues](https://github.com/rubycoco/fetcher/issues)
|
7
7
|
* gem :: [rubygems.org/gems/webget](https://rubygems.org/gems/webget)
|
8
8
|
* rdoc :: [rubydoc.info/gems/webget](http://rubydoc.info/gems/webget)
|
9
9
|
|
data/lib/webget/version.rb
CHANGED
data/lib/webget/webcache.rb
CHANGED
@@ -62,7 +62,8 @@ module Webcache
|
|
62
62
|
alias_method :exist?, :cached?
|
63
63
|
end
|
64
64
|
def self.url_to_id( url ) cache.url_to_id( url ); end ## todo/check: rename to just id or something - why? why not?
|
65
|
-
def self.read( url )
|
65
|
+
def self.read( url ) cache.read( url ); end
|
66
|
+
def self.read_json( url ) cache.read_json( url ); end
|
66
67
|
|
67
68
|
|
68
69
|
class DiskCache
|
@@ -78,6 +79,14 @@ class DiskCache
|
|
78
79
|
File.open( body_path, 'r:utf-8' ) {|f| f.read }
|
79
80
|
end
|
80
81
|
|
82
|
+
def read_json( url )
|
83
|
+
body_path = "#{Webcache.root}/#{url_to_path( url )}"
|
84
|
+
txt = File.open( body_path, 'r:utf-8' ) {|f| f.read }
|
85
|
+
data = JSON.parse( txt )
|
86
|
+
data
|
87
|
+
end
|
88
|
+
|
89
|
+
|
81
90
|
|
82
91
|
## add more save / put / etc. aliases - why? why not?
|
83
92
|
## rename to record_html - why? why not?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|