gzlib 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 89dd29cb4c602cf54f1ff47bb5107be2bf4da55a
4
- data.tar.gz: da3742748335c616041e6f7978dfe4f5ca03d439
2
+ SHA256:
3
+ metadata.gz: c5e194f2d449b800e33771d78fbf405f8e5b233d02499af28385e7d1ee51d435
4
+ data.tar.gz: 8eb2ad278eaae83ab5eeefebd58a3206d5b5cf56f3280fc5068ceac2bafc4a66
5
5
  SHA512:
6
- metadata.gz: c3de53f9a4b374f5c9850e53b3c36bc1e5e9b2ce6cf9f6577e97a0e167218e83869415afcca2cd13d2df62e964fa20a92b8f80daf4815ded9508c8e9cfbfa255
7
- data.tar.gz: f800a2fc5456d5404e22641959fcf19b05f8301ef6fee0f4a74686446d1cdb944d4512e12ce4f8b2f5838e2cb34e42b89ac3b07f4b85f7e7f093b8a5510048ca
6
+ metadata.gz: 79f60d04ca2f827b6e0cdd38038dac3f614d3535519d453d220af6bd30765eebead1ff6e2bfc6d1fb37568d69efa239ee1521de067ef44db418832dfcd8ae7ef
7
+ data.tar.gz: e1e8d72951bd3fe0d50cda2d66cf8216dbc8d6e7347c5fba49fa951b084d86fba1394428937068f219d3c1b0cb41fe4fcd6f5830f9ae435f6ac662129bc8e005
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  *.gem
11
11
  *.swp
12
+ .ruby-version
@@ -17,9 +17,10 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = ['gzlib']
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_development_dependency 'bundler', '~> 1.9'
20
+ spec.add_development_dependency 'bundler', '> 1.9'
21
21
  spec.add_development_dependency 'rake', '~> 10.0'
22
22
  spec.add_development_dependency 'minitest', '~> 5.0'
23
23
 
24
24
  spec.add_dependency 'nokogiri', '~> 1.6'
25
+ spec.add_dependency 'webrick', '~> 1.7'
25
26
  end
@@ -24,8 +24,8 @@ module Gzlib
24
24
  end
25
25
 
26
26
  def fetch_json id
27
- json_file = open "#{Search}#{id}"
28
- @json = JSON.parse json_file.read
27
+ json = Net::HTTP.get(URI("#{Search}#{id}"))
28
+ @json = JSON.parse json
29
29
  end
30
30
 
31
31
  def merge_holding_loan
@@ -1,6 +1,6 @@
1
1
  require 'webrick/httputils'
2
2
  require 'nokogiri'
3
- require 'open-uri'
3
+ require 'net/http'
4
4
  require 'gzlib/book'
5
5
 
6
6
  module Gzlib
@@ -58,7 +58,8 @@ module Gzlib
58
58
  private
59
59
 
60
60
  def getHtml
61
- Nokogiri::HTML(open "#{Search}#{para}")
61
+ html = Net::HTTP.get(URI("#{Search}#{para}"))
62
+ Nokogiri::HTML(html)
62
63
  end
63
64
 
64
65
  def escape(str)
@@ -83,5 +84,9 @@ module Gzlib
83
84
  @para.merge!({page: curPage+1})
84
85
  end
85
86
 
87
+ def open(str)
88
+ Net::HTTP.get(URI(str))
89
+ end
90
+
86
91
  end
87
92
  end
@@ -1,3 +1,3 @@
1
1
  module Gzlib
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gzlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-31 00:00:00.000000000 Z
11
+ date: 2021-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.9'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.9'
27
27
  - !ruby/object:Gem::Dependency
@@ -66,7 +66,21 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.6'
69
- description:
69
+ - !ruby/object:Gem::Dependency
70
+ name: webrick
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.7'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.7'
83
+ description:
70
84
  email:
71
85
  - block24block@gmail.com
72
86
  executables:
@@ -93,7 +107,7 @@ homepage: https://github.com/turnon/gzlib
93
107
  licenses:
94
108
  - MIT
95
109
  metadata: {}
96
- post_install_message:
110
+ post_install_message:
97
111
  rdoc_options: []
98
112
  require_paths:
99
113
  - lib
@@ -108,9 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
122
  - !ruby/object:Gem::Version
109
123
  version: '0'
110
124
  requirements: []
111
- rubyforge_project:
112
- rubygems_version: 2.4.8
113
- signing_key:
125
+ rubygems_version: 3.2.3
126
+ signing_key:
114
127
  specification_version: 4
115
128
  summary: search books on http://opac.gzlib.gov.cn/
116
129
  test_files: []