webget 0.1.0 → 0.1.1

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: 6e0feb02f55f01692b3353f5aaf15ab2201dfb02
4
- data.tar.gz: da3d146f2fc6db90e2a34c9c385d7e9e9d3c272c
3
+ metadata.gz: f30b181118ed0b78e2617246be67187afbc82b06
4
+ data.tar.gz: a70be1694115592004e896f2b762db231896fdf2
5
5
  SHA512:
6
- metadata.gz: 49fb39362398e09eac27d929f0689a604234818f8ff6fc2422217977e6312fe46bf0273059d9310ba9b40dea62b75bc437b6e90cc36d5e39456d1927e36739ee
7
- data.tar.gz: b81245bc4a7029eae5712aa94f48784240b6666d48ddc270c360980bc6f5599508ff49c7d128bafdff8419b378ab1c6d83282090a6ec10ad1a77a228fb70232a
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/webget](https://github.com/rubycoco/webget)
6
- * bugs :: [github.com/rubycoco/webget/issues](https://github.com/rubycoco/webget/issues)
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
 
@@ -3,7 +3,7 @@ class Webget
3
3
 
4
4
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
5
5
  MINOR = 1
6
- PATCH = 0
6
+ PATCH = 1
7
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
8
8
 
9
9
  def self.version
@@ -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 ) cache.read( url ); end
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2020-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc