bookscan 0.5.4 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -37,6 +37,7 @@ Rcov::RcovTask.new do |test|
37
37
  test.libs << 'test'
38
38
  test.pattern = 'test/**/test_*.rb'
39
39
  test.verbose = true
40
+ test.rcov_opts << '-x /usr -x .rvm -x rvm -x vendor'
40
41
  end
41
42
 
42
43
  task :default => :test
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.6
@@ -5,12 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bookscan}
8
- s.version = "0.5.4"
8
+ s.version = "0.5.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Yoshihiro TAKAHARA"]
12
- s.date = %q{2011-02-06}
13
- s.default_executable = %q{bookscan}
12
+ s.date = %q{2011-04-30}
14
13
  s.description = %q{This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT* a official software of Bookscan.}
15
14
  s.email = %q{y.takahara@gmail.com}
16
15
  s.executables = ["bookscan"]
@@ -40,7 +39,7 @@ Gem::Specification.new do |s|
40
39
  s.homepage = %q{http://github.com/tumf/bookscan}
41
40
  s.licenses = ["MIT"]
42
41
  s.require_paths = ["lib"]
43
- s.rubygems_version = %q{1.5.0}
42
+ s.rubygems_version = %q{1.7.2}
44
43
  s.summary = %q{BookScan Scraper}
45
44
  s.test_files = [
46
45
  "test/helper.rb",
@@ -75,7 +75,11 @@ module Bookscan
75
75
  false
76
76
  end
77
77
 
78
- def tune(book,type,is_premium = true)
78
+ # def tune(book,type,is_premium = true)
79
+ def tune(book,options)
80
+ type = options[:type]
81
+ is_premium = true
82
+ is_premium = options[:is_premium]
79
83
  max_queue = 1
80
84
  max_queue = 10 if is_premium
81
85
 
@@ -88,6 +92,9 @@ module Bookscan
88
92
  getr(book.tune_url)
89
93
  page.forms.first["optimize_type"] = type;
90
94
  page.forms.first["cover_flg"] = "1";
95
+ if options[:to] == "dropbox"
96
+ page.forms.first["dropbox_flg"] = "1";
97
+ end
91
98
  page.forms.first.submit
92
99
  tuned = book.clone
93
100
  tuned.title = type +"_"+book.title
@@ -222,7 +222,7 @@ module Bookscan
222
222
 
223
223
  def tune
224
224
  opt = OptionParser.new
225
- hash = nil; pattern = ".*"; dry_run = false
225
+ hash = nil; pattern = ".*"; dry_run = false; to = nil
226
226
  opt.on('-g HASH','--group=HASH', 'group hash') do |v|
227
227
  hash = v
228
228
  end
@@ -232,6 +232,9 @@ module Bookscan
232
232
  opt.on('-m PATTERN','--match=PATTERN','pattern match') do |v|
233
233
  pattern = v
234
234
  end
235
+ opt.on('--to=dest', 'file to external storage: e.g. Dropbox') do |v|
236
+ to = v
237
+ end
235
238
  opt.parse!(@command_options)
236
239
  @banner = "[command options] isbn|all tune_type"
237
240
  return opt if @help
@@ -250,7 +253,7 @@ module Bookscan
250
253
  next unless /#{pattern}/ =~ book.title
251
254
  unless @cache.tuned?(book,type)
252
255
  # tune
253
- puts "tune for %s: %s" % [type, book.title] if dry_run or @agent.tune(book,type)
256
+ puts "tune for %s: %s" % [type, book.title] if dry_run or @agent.tune(book,{:type => type, :to => to})
254
257
  # puts "tune for %s: %s" % [type, book.title]
255
258
  end
256
259
  }
@@ -260,7 +263,7 @@ module Bookscan
260
263
  puts "tune for %s: %s" % [type, book.title]
261
264
  unless dry_run
262
265
  start
263
- @agent.tune(book,type)
266
+ @agent.tune(book,{:to => to,:type => type})
264
267
  end
265
268
  end
266
269
  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: 3
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 4
10
- version: 0.5.4
9
+ - 6
10
+ version: 0.5.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yoshihiro TAKAHARA
@@ -15,11 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-06 00:00:00 +09:00
19
- default_executable: bookscan
18
+ date: 2011-04-30 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ type: :runtime
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
23
  none: false
24
24
  requirements:
25
25
  - - ">="
@@ -28,12 +28,12 @@ dependencies:
28
28
  segments:
29
29
  - 0
30
30
  version: "0"
31
- version_requirements: *id001
32
- name: mutter
31
+ requirement: *id001
33
32
  prerelease: false
34
- type: :runtime
33
+ name: mutter
35
34
  - !ruby/object:Gem::Dependency
36
- requirement: &id002 !ruby/object:Gem::Requirement
35
+ type: :runtime
36
+ version_requirements: &id002 !ruby/object:Gem::Requirement
37
37
  none: false
38
38
  requirements:
39
39
  - - ">"
@@ -43,12 +43,12 @@ dependencies:
43
43
  - 0
44
44
  - 1
45
45
  version: "0.1"
46
- version_requirements: *id002
47
- name: keystorage
46
+ requirement: *id002
48
47
  prerelease: false
49
- type: :runtime
48
+ name: keystorage
50
49
  - !ruby/object:Gem::Dependency
51
- requirement: &id003 !ruby/object:Gem::Requirement
50
+ type: :runtime
51
+ version_requirements: &id003 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ">="
@@ -59,12 +59,12 @@ dependencies:
59
59
  - 0
60
60
  - 0
61
61
  version: 1.0.0
62
- version_requirements: *id003
63
- name: mechanize
62
+ requirement: *id003
64
63
  prerelease: false
65
- type: :runtime
64
+ name: mechanize
66
65
  - !ruby/object:Gem::Dependency
67
- requirement: &id004 !ruby/object:Gem::Requirement
66
+ type: :runtime
67
+ version_requirements: &id004 !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements:
70
70
  - - ">"
@@ -74,12 +74,12 @@ dependencies:
74
74
  - 1
75
75
  - 6
76
76
  version: "1.6"
77
- version_requirements: *id004
78
- name: highline
77
+ requirement: *id004
79
78
  prerelease: false
80
- type: :runtime
79
+ name: highline
81
80
  - !ruby/object:Gem::Dependency
82
- requirement: &id005 !ruby/object:Gem::Requirement
81
+ type: :runtime
82
+ version_requirements: &id005 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ">="
@@ -90,12 +90,12 @@ dependencies:
90
90
  - 9
91
91
  - 0
92
92
  version: 0.9.0
93
- version_requirements: *id005
94
- name: progressbar
93
+ requirement: *id005
95
94
  prerelease: false
96
- type: :runtime
95
+ name: progressbar
97
96
  - !ruby/object:Gem::Dependency
98
- requirement: &id006 !ruby/object:Gem::Requirement
97
+ type: :runtime
98
+ version_requirements: &id006 !ruby/object:Gem::Requirement
99
99
  none: false
100
100
  requirements:
101
101
  - - ">="
@@ -107,12 +107,12 @@ dependencies:
107
107
  - 6
108
108
  - 1
109
109
  version: 2.1.6.1
110
- version_requirements: *id006
111
- name: httpclient
110
+ requirement: *id006
112
111
  prerelease: false
113
- type: :runtime
112
+ name: httpclient
114
113
  - !ruby/object:Gem::Dependency
115
- requirement: &id007 !ruby/object:Gem::Requirement
114
+ type: :development
115
+ version_requirements: &id007 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ">="
@@ -121,12 +121,12 @@ dependencies:
121
121
  segments:
122
122
  - 0
123
123
  version: "0"
124
- version_requirements: *id007
125
- name: shoulda
124
+ requirement: *id007
126
125
  prerelease: false
127
- type: :development
126
+ name: shoulda
128
127
  - !ruby/object:Gem::Dependency
129
- requirement: &id008 !ruby/object:Gem::Requirement
128
+ type: :development
129
+ version_requirements: &id008 !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
132
132
  - - ~>
@@ -137,12 +137,12 @@ dependencies:
137
137
  - 0
138
138
  - 0
139
139
  version: 1.0.0
140
- version_requirements: *id008
141
- name: bundler
140
+ requirement: *id008
142
141
  prerelease: false
143
- type: :development
142
+ name: bundler
144
143
  - !ruby/object:Gem::Dependency
145
- requirement: &id009 !ruby/object:Gem::Requirement
144
+ type: :development
145
+ version_requirements: &id009 !ruby/object:Gem::Requirement
146
146
  none: false
147
147
  requirements:
148
148
  - - ~>
@@ -153,12 +153,12 @@ dependencies:
153
153
  - 5
154
154
  - 2
155
155
  version: 1.5.2
156
- version_requirements: *id009
157
- name: jeweler
156
+ requirement: *id009
158
157
  prerelease: false
159
- type: :development
158
+ name: jeweler
160
159
  - !ruby/object:Gem::Dependency
161
- requirement: &id010 !ruby/object:Gem::Requirement
160
+ type: :development
161
+ version_requirements: &id010 !ruby/object:Gem::Requirement
162
162
  none: false
163
163
  requirements:
164
164
  - - ">="
@@ -167,10 +167,9 @@ dependencies:
167
167
  segments:
168
168
  - 0
169
169
  version: "0"
170
- version_requirements: *id010
171
- name: rcov
170
+ requirement: *id010
172
171
  prerelease: false
173
- type: :development
172
+ name: rcov
174
173
  description: This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT* a official software of Bookscan.
175
174
  email: y.takahara@gmail.com
176
175
  executables:
@@ -198,7 +197,6 @@ files:
198
197
  - lib/bookscan/groups.rb
199
198
  - test/helper.rb
200
199
  - test/test_bookscan.rb
201
- has_rdoc: true
202
200
  homepage: http://github.com/tumf/bookscan
203
201
  licenses:
204
202
  - MIT
@@ -228,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
226
  requirements: []
229
227
 
230
228
  rubyforge_project:
231
- rubygems_version: 1.5.0
229
+ rubygems_version: 1.7.2
232
230
  signing_key:
233
231
  specification_version: 3
234
232
  summary: BookScan Scraper