bookscan 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -21,22 +21,12 @@ This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT*
21
21
  * login
22
22
  * logout
23
23
  * update [-a,--all] [-g,--group=HASH]
24
- * download [--dry-run] [-g,--group=HASH] [-d,--directory=DIR] [-t,--tuned=TYPE] _id_|all
25
- * tune [--dry-run] _id_|all _type_
26
- * list
27
- * tuned
24
+ * download [--dry-run] [-g,--group=HASH] [-t,--tuned=TYPE] [-m,--match=PATTERN] _id_ | all
25
+ * tune [--dry-run] [-m,--match=PATTERN] _id_ | all _type_
26
+ * list [-g,--group=HASH] [-t,--tuned=TYPE] [-m,--match=PATTERN]
28
27
  * tuning
29
28
  * groups
30
29
 
31
- == Depends
32
-
33
- === gems
34
-
35
- * highline > 1.6
36
- * mechanize >= 1.0
37
- * keystorage > 0.1
38
-
39
-
40
30
  == Contributing to bookscan
41
31
 
42
32
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
@@ -49,6 +39,5 @@ This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT*
49
39
 
50
40
  == Copyright
51
41
 
52
- Copyright (c) 2011 Yoshihiro TAKAHARA. See LICENSE.txt for
53
- further details.
42
+ Copyright (c) 2011 Yoshihiro TAKAHARA. See LICENSE.txt for further details.
54
43
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
data/bookscan.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bookscan}
8
- s.version = "0.3.0"
8
+ s.version = "0.4.0"
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"]
@@ -104,12 +104,22 @@ module Bookscan
104
104
  gs = @cache.groups
105
105
 
106
106
  opt = OptionParser.new
107
- hash = nil
108
- opt.on('-g HASH','--group=HASH', 'group hash') do |v|
109
- hash = v
110
- end
107
+ hash = nil;type = nil;pattern = ".*"
108
+ opt.on('-g HASH','--group=HASH', 'group hash') { |v| hash = v }
109
+ opt.on('-t TYPE','--tuned=TYPE', 'download tuned') { |v| type = v }
110
+ opt.on('-m PATTERN','--match=PATTERN','pattern match') { |v| pattern = v }
111
111
  opt.parse!(@command_options)
112
- puts ask_group(hash,gs).books.to_s
112
+
113
+ if hash
114
+ puts ask_group(hash,gs).books.to_s
115
+ else
116
+ if type
117
+ bs = @cache.tuned.delete_if { |i| !(/#{pattern}/ =~ i.title) or i.tune_type != type }
118
+ else
119
+ bs = @cache.books.delete_if { |i| !(/#{pattern}/ =~ i.title) }
120
+ end
121
+ puts bs.to_s
122
+ end
113
123
  end
114
124
 
115
125
  def download
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: 19
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yoshihiro TAKAHARA