bookscan 0.5.10 → 0.5.11

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.10
1
+ 0.5.11
@@ -4,15 +4,15 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{bookscan}
8
- s.version = "0.5.10"
7
+ s.name = "bookscan"
8
+ s.version = "0.5.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Yoshihiro TAKAHARA}]
12
- s.date = %q{2011-08-09}
13
- s.description = %q{This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT* a official software of Bookscan.}
14
- s.email = %q{y.takahara@gmail.com}
15
- s.executables = [%q{bookscan}]
11
+ s.authors = ["Yoshihiro TAKAHARA"]
12
+ s.date = "2011-09-20"
13
+ s.description = "This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT* a official software of Bookscan."
14
+ s.email = "y.takahara@gmail.com"
15
+ s.executables = ["bookscan"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE.txt",
18
18
  "README.rdoc"
@@ -36,11 +36,11 @@ Gem::Specification.new do |s|
36
36
  "test/helper.rb",
37
37
  "test/test_bookscan.rb"
38
38
  ]
39
- s.homepage = %q{http://github.com/tumf/bookscan}
40
- s.licenses = [%q{MIT}]
41
- s.require_paths = [%q{lib}]
42
- s.rubygems_version = %q{1.8.5}
43
- s.summary = %q{BookScan Scraper}
39
+ s.homepage = "http://github.com/tumf/bookscan"
40
+ s.licenses = ["MIT"]
41
+ s.require_paths = ["lib"]
42
+ s.rubygems_version = "1.8.10"
43
+ s.summary = "BookScan Scraper"
44
44
  s.test_files = [
45
45
  "test/helper.rb",
46
46
  "test/test_bookscan.rb"
@@ -163,13 +163,15 @@ module Bookscan
163
163
  def download(url,path)
164
164
  url = URI.parse(url)
165
165
  cli = HTTPClient.new
166
- cookie_jar.cookies(url).each do |cookie|
166
+
167
+ @cookie_jar && @cookie_jar.cookies(url).each do |cookie|
167
168
  cli.cookie_manager.parse(cookie.to_s,url)
168
169
  end
169
170
 
170
171
  length = 0;total = 0
171
172
  res = cli.head(url)
172
173
  url = URI.parse(res.header["Location"].to_s) if res.status == 302
174
+
173
175
  total = cli.head(url).header["Content-Length"].to_s.to_i
174
176
  t = Thread.new {
175
177
  conn = cli.get_async(url)
@@ -37,7 +37,7 @@ module Bookscan
37
37
  def books(group = nil)
38
38
  if group
39
39
  groups.each do |g|
40
- return g.books if g.hash == group.hash
40
+ return g.books if g.hash == group
41
41
  end
42
42
  return {}
43
43
  else
@@ -5,10 +5,8 @@ require 'pp'
5
5
  class TestBookscan < Test::Unit::TestCase
6
6
  context "Bookscan::Agent" do
7
7
  should "access to bookscan" do
8
- Bookscan::Agent.new {|agent|
9
- agent.getr("/")
10
- assert(/ブックスキャン/ =~ agent.page.body,"access to top")
11
- }
8
+ agent = Bookscan::Agent.new
9
+ agent.getr("/")
12
10
  end
13
11
  end
14
12
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookscan
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 10
10
- version: 0.5.10
9
+ - 11
10
+ version: 0.5.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yoshihiro TAKAHARA
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-09 00:00:00 Z
18
+ date: 2011-09-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -27,10 +27,10 @@ dependencies:
27
27
  segments:
28
28
  - 0
29
29
  version: "0"
30
- type: :runtime
31
30
  requirement: *id001
32
31
  prerelease: false
33
32
  name: mutter
33
+ type: :runtime
34
34
  - !ruby/object:Gem::Dependency
35
35
  version_requirements: &id002 !ruby/object:Gem::Requirement
36
36
  none: false
@@ -43,10 +43,10 @@ dependencies:
43
43
  - 4
44
44
  - 7
45
45
  version: 0.4.7
46
- type: :runtime
47
46
  requirement: *id002
48
47
  prerelease: false
49
48
  name: keystorage
49
+ type: :runtime
50
50
  - !ruby/object:Gem::Dependency
51
51
  version_requirements: &id003 !ruby/object:Gem::Requirement
52
52
  none: false
@@ -59,10 +59,10 @@ dependencies:
59
59
  - 0
60
60
  - 1
61
61
  version: 2.0.1
62
- type: :runtime
63
62
  requirement: *id003
64
63
  prerelease: false
65
64
  name: mechanize
65
+ type: :runtime
66
66
  - !ruby/object:Gem::Dependency
67
67
  version_requirements: &id004 !ruby/object:Gem::Requirement
68
68
  none: false
@@ -74,10 +74,10 @@ dependencies:
74
74
  - 1
75
75
  - 6
76
76
  version: "1.6"
77
- type: :runtime
78
77
  requirement: *id004
79
78
  prerelease: false
80
79
  name: highline
80
+ type: :runtime
81
81
  - !ruby/object:Gem::Dependency
82
82
  version_requirements: &id005 !ruby/object:Gem::Requirement
83
83
  none: false
@@ -90,10 +90,10 @@ dependencies:
90
90
  - 9
91
91
  - 0
92
92
  version: 0.9.0
93
- type: :runtime
94
93
  requirement: *id005
95
94
  prerelease: false
96
95
  name: progressbar
96
+ type: :runtime
97
97
  - !ruby/object:Gem::Dependency
98
98
  version_requirements: &id006 !ruby/object:Gem::Requirement
99
99
  none: false
@@ -107,10 +107,10 @@ dependencies:
107
107
  - 6
108
108
  - 1
109
109
  version: 2.1.6.1
110
- type: :runtime
111
110
  requirement: *id006
112
111
  prerelease: false
113
112
  name: httpclient
113
+ type: :runtime
114
114
  - !ruby/object:Gem::Dependency
115
115
  version_requirements: &id007 !ruby/object:Gem::Requirement
116
116
  none: false
@@ -121,10 +121,10 @@ dependencies:
121
121
  segments:
122
122
  - 0
123
123
  version: "0"
124
- type: :development
125
124
  requirement: *id007
126
125
  prerelease: false
127
126
  name: shoulda
127
+ type: :development
128
128
  - !ruby/object:Gem::Dependency
129
129
  version_requirements: &id008 !ruby/object:Gem::Requirement
130
130
  none: false
@@ -137,10 +137,10 @@ dependencies:
137
137
  - 0
138
138
  - 0
139
139
  version: 1.0.0
140
- type: :development
141
140
  requirement: *id008
142
141
  prerelease: false
143
142
  name: bundler
143
+ type: :development
144
144
  - !ruby/object:Gem::Dependency
145
145
  version_requirements: &id009 !ruby/object:Gem::Requirement
146
146
  none: false
@@ -153,10 +153,10 @@ dependencies:
153
153
  - 5
154
154
  - 2
155
155
  version: 1.5.2
156
- type: :development
157
156
  requirement: *id009
158
157
  prerelease: false
159
158
  name: jeweler
159
+ type: :development
160
160
  - !ruby/object:Gem::Dependency
161
161
  version_requirements: &id010 !ruby/object:Gem::Requirement
162
162
  none: false
@@ -167,10 +167,10 @@ dependencies:
167
167
  segments:
168
168
  - 0
169
169
  version: "0"
170
- type: :development
171
170
  requirement: *id010
172
171
  prerelease: false
173
172
  name: rcov
173
+ type: :development
174
174
  description: This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT* a official software of Bookscan.
175
175
  email: y.takahara@gmail.com
176
176
  executables:
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  requirements: []
228
228
 
229
229
  rubyforge_project:
230
- rubygems_version: 1.8.5
230
+ rubygems_version: 1.8.10
231
231
  signing_key:
232
232
  specification_version: 3
233
233
  summary: BookScan Scraper