bookscan 0.5.7 → 0.5.8

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.7
1
+ 0.5.8
@@ -5,14 +5,15 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bookscan}
8
- s.version = "0.5.7"
8
+ s.version = "0.5.8"
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-05-13}
11
+ s.authors = ["Yoshihiro TAKAHARA"]
12
+ s.date = %q{2011-05-31}
13
+ s.default_executable = %q{bookscan}
13
14
  s.description = %q{This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT* a official software of Bookscan.}
14
15
  s.email = %q{y.takahara@gmail.com}
15
- s.executables = [%q{bookscan}]
16
+ s.executables = ["bookscan"]
16
17
  s.extra_rdoc_files = [
17
18
  "LICENSE.txt",
18
19
  "README.rdoc"
@@ -37,9 +38,9 @@ Gem::Specification.new do |s|
37
38
  "test/test_bookscan.rb"
38
39
  ]
39
40
  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.1}
41
+ s.licenses = ["MIT"]
42
+ s.require_paths = ["lib"]
43
+ s.rubygems_version = %q{1.6.2}
43
44
  s.summary = %q{BookScan Scraper}
44
45
  s.test_files = [
45
46
  "test/helper.rb",
@@ -39,6 +39,7 @@ module Bookscan
39
39
  groups.each do |g|
40
40
  return g.books if g.hash == group.hash
41
41
  end
42
+ return {}
42
43
  else
43
44
  bs = Books.new
44
45
  groups.each do |g|
@@ -105,7 +105,7 @@ module Bookscan
105
105
  books = @cache.books(gs[index]) rescue {}
106
106
 
107
107
  if gs[index].completed?
108
- if (books == nil or books.length == 0)
108
+ if (books == nil or books.length == 0 or !books.is_a?(Books))
109
109
  gs[index].books = @agent.books(gs[index])
110
110
  else
111
111
  gs[index].books = books
@@ -249,7 +249,7 @@ module Bookscan
249
249
  cache["tuned"] = @agent.tuned
250
250
  end
251
251
  end
252
- @cache.books.each { |book|
252
+ @cache.books(hash).each { |book|
253
253
  next unless /#{pattern}/ =~ book.title
254
254
  unless @cache.tuned?(book,type)
255
255
  # tune
@@ -312,7 +312,6 @@ module Bookscan
312
312
  end
313
313
  end
314
314
  raise SystemExit if hash == "q"
315
-
316
315
  gs.by_hash(hash)
317
316
  end
318
317
 
@@ -15,13 +15,15 @@ module Bookscan
15
15
 
16
16
  def by_hash(hash)
17
17
  i = to_index(hash)
18
- at(i) if i
18
+ return nil unless i
19
+ at(i)
19
20
  end
20
21
 
21
22
  def to_index(hash)
22
23
  each_index do |i|
23
24
  return i if hash == at(i).hash
24
25
  end
26
+ nil
25
27
  end
26
28
 
27
29
  def to_s
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: 5
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 7
10
- version: 0.5.7
9
+ - 8
10
+ version: 0.5.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yoshihiro TAKAHARA
@@ -15,11 +15,13 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-13 00:00:00 Z
18
+ date: 2011-05-31 00:00:00 +09:00
19
+ default_executable: bookscan
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: mutter
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ type: :runtime
24
+ requirement: &id001 !ruby/object:Gem::Requirement
23
25
  none: false
24
26
  requirements:
25
27
  - - ">="
@@ -28,12 +30,12 @@ dependencies:
28
30
  segments:
29
31
  - 0
30
32
  version: "0"
33
+ name: mutter
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
31
36
  prerelease: false
32
37
  type: :runtime
33
- requirement: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: keystorage
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
+ requirement: &id002 !ruby/object:Gem::Requirement
37
39
  none: false
38
40
  requirements:
39
41
  - - ">"
@@ -43,12 +45,12 @@ dependencies:
43
45
  - 0
44
46
  - 1
45
47
  version: "0.1"
48
+ name: keystorage
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
46
51
  prerelease: false
47
52
  type: :runtime
48
- requirement: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: mechanize
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
53
+ requirement: &id003 !ruby/object:Gem::Requirement
52
54
  none: false
53
55
  requirements:
54
56
  - - ">="
@@ -59,12 +61,12 @@ dependencies:
59
61
  - 0
60
62
  - 0
61
63
  version: 1.0.0
64
+ name: mechanize
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
62
67
  prerelease: false
63
68
  type: :runtime
64
- requirement: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: highline
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
69
+ requirement: &id004 !ruby/object:Gem::Requirement
68
70
  none: false
69
71
  requirements:
70
72
  - - ">"
@@ -74,12 +76,12 @@ dependencies:
74
76
  - 1
75
77
  - 6
76
78
  version: "1.6"
79
+ name: highline
80
+ version_requirements: *id004
81
+ - !ruby/object:Gem::Dependency
77
82
  prerelease: false
78
83
  type: :runtime
79
- requirement: *id004
80
- - !ruby/object:Gem::Dependency
81
- name: progressbar
82
- version_requirements: &id005 !ruby/object:Gem::Requirement
84
+ requirement: &id005 !ruby/object:Gem::Requirement
83
85
  none: false
84
86
  requirements:
85
87
  - - ">="
@@ -90,12 +92,12 @@ dependencies:
90
92
  - 9
91
93
  - 0
92
94
  version: 0.9.0
95
+ name: progressbar
96
+ version_requirements: *id005
97
+ - !ruby/object:Gem::Dependency
93
98
  prerelease: false
94
99
  type: :runtime
95
- requirement: *id005
96
- - !ruby/object:Gem::Dependency
97
- name: httpclient
98
- version_requirements: &id006 !ruby/object:Gem::Requirement
100
+ requirement: &id006 !ruby/object:Gem::Requirement
99
101
  none: false
100
102
  requirements:
101
103
  - - ">="
@@ -107,12 +109,12 @@ dependencies:
107
109
  - 6
108
110
  - 1
109
111
  version: 2.1.6.1
110
- prerelease: false
111
- type: :runtime
112
- requirement: *id006
112
+ name: httpclient
113
+ version_requirements: *id006
113
114
  - !ruby/object:Gem::Dependency
114
- name: shoulda
115
- version_requirements: &id007 !ruby/object:Gem::Requirement
115
+ prerelease: false
116
+ type: :development
117
+ requirement: &id007 !ruby/object:Gem::Requirement
116
118
  none: false
117
119
  requirements:
118
120
  - - ">="
@@ -121,12 +123,12 @@ dependencies:
121
123
  segments:
122
124
  - 0
123
125
  version: "0"
126
+ name: shoulda
127
+ version_requirements: *id007
128
+ - !ruby/object:Gem::Dependency
124
129
  prerelease: false
125
130
  type: :development
126
- requirement: *id007
127
- - !ruby/object:Gem::Dependency
128
- name: bundler
129
- version_requirements: &id008 !ruby/object:Gem::Requirement
131
+ requirement: &id008 !ruby/object:Gem::Requirement
130
132
  none: false
131
133
  requirements:
132
134
  - - ~>
@@ -137,12 +139,12 @@ dependencies:
137
139
  - 0
138
140
  - 0
139
141
  version: 1.0.0
142
+ name: bundler
143
+ version_requirements: *id008
144
+ - !ruby/object:Gem::Dependency
140
145
  prerelease: false
141
146
  type: :development
142
- requirement: *id008
143
- - !ruby/object:Gem::Dependency
144
- name: jeweler
145
- version_requirements: &id009 !ruby/object:Gem::Requirement
147
+ requirement: &id009 !ruby/object:Gem::Requirement
146
148
  none: false
147
149
  requirements:
148
150
  - - ~>
@@ -153,12 +155,12 @@ dependencies:
153
155
  - 5
154
156
  - 2
155
157
  version: 1.5.2
158
+ name: jeweler
159
+ version_requirements: *id009
160
+ - !ruby/object:Gem::Dependency
156
161
  prerelease: false
157
162
  type: :development
158
- requirement: *id009
159
- - !ruby/object:Gem::Dependency
160
- name: rcov
161
- version_requirements: &id010 !ruby/object:Gem::Requirement
163
+ requirement: &id010 !ruby/object:Gem::Requirement
162
164
  none: false
163
165
  requirements:
164
166
  - - ">="
@@ -167,9 +169,8 @@ dependencies:
167
169
  segments:
168
170
  - 0
169
171
  version: "0"
170
- prerelease: false
171
- type: :development
172
- requirement: *id010
172
+ name: rcov
173
+ version_requirements: *id010
173
174
  description: This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT* a official software of Bookscan.
174
175
  email: y.takahara@gmail.com
175
176
  executables:
@@ -197,6 +198,7 @@ files:
197
198
  - lib/bookscan/groups.rb
198
199
  - test/helper.rb
199
200
  - test/test_bookscan.rb
201
+ has_rdoc: true
200
202
  homepage: http://github.com/tumf/bookscan
201
203
  licenses:
202
204
  - MIT
@@ -226,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
228
  requirements: []
227
229
 
228
230
  rubyforge_project:
229
- rubygems_version: 1.8.1
231
+ rubygems_version: 1.6.2
230
232
  signing_key:
231
233
  specification_version: 3
232
234
  summary: BookScan Scraper