bookscan 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bookscan.gemspec +1 -1
  3. data/lib/bookscan/commands.rb +15 -5
  4. metadata +19 -19
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bookscan}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
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"]
@@ -84,7 +84,16 @@ module Bookscan
84
84
  gs[i].books = @agent.books(gs[i]) if gs[i]
85
85
  else
86
86
  gs.each_index do |index|
87
- gs[index].books = @cache.books(gs[index]) rescue {}
87
+ books = @cache.books(gs[index]) rescue {}
88
+
89
+ if gs[index].completed?
90
+ if (books == nil or books.length == 0)
91
+ gs[index].books = @agent.books(gs[index])
92
+ else
93
+ gs[index].books = books
94
+ end
95
+ end
96
+
88
97
  end
89
98
  end
90
99
  ts = @agent.tuned
@@ -105,12 +114,13 @@ module Bookscan
105
114
 
106
115
  opt = OptionParser.new
107
116
  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 }
117
+ browsing = true;
118
+ opt.on('-g HASH','--group=HASH', 'group hash') { |v| hash = v; browsing = false }
119
+ opt.on('-t TYPE','--tuned=TYPE', 'download tuned') { |v| type = v; browsing = false }
120
+ opt.on('-m PATTERN','--match=PATTERN','pattern match') { |v| pattern = v; browsing = false }
111
121
  opt.parse!(@command_options)
112
122
 
113
- if hash
123
+ if hash or browsing
114
124
  puts ask_group(hash,gs).books.to_s
115
125
  else
116
126
  if type
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: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yoshihiro TAKAHARA
@@ -20,6 +20,7 @@ default_executable: bookscan
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  type: :development
23
+ name: shoulda
23
24
  version_requirements: &id001 !ruby/object:Gem::Requirement
24
25
  none: false
25
26
  requirements:
@@ -29,11 +30,11 @@ dependencies:
29
30
  segments:
30
31
  - 0
31
32
  version: "0"
32
- requirement: *id001
33
33
  prerelease: false
34
- name: shoulda
34
+ requirement: *id001
35
35
  - !ruby/object:Gem::Dependency
36
36
  type: :development
37
+ name: bundler
37
38
  version_requirements: &id002 !ruby/object:Gem::Requirement
38
39
  none: false
39
40
  requirements:
@@ -45,11 +46,11 @@ dependencies:
45
46
  - 0
46
47
  - 0
47
48
  version: 1.0.0
48
- requirement: *id002
49
49
  prerelease: false
50
- name: bundler
50
+ requirement: *id002
51
51
  - !ruby/object:Gem::Dependency
52
52
  type: :development
53
+ name: jeweler
53
54
  version_requirements: &id003 !ruby/object:Gem::Requirement
54
55
  none: false
55
56
  requirements:
@@ -61,11 +62,11 @@ dependencies:
61
62
  - 5
62
63
  - 2
63
64
  version: 1.5.2
64
- requirement: *id003
65
65
  prerelease: false
66
- name: jeweler
66
+ requirement: *id003
67
67
  - !ruby/object:Gem::Dependency
68
68
  type: :development
69
+ name: rcov
69
70
  version_requirements: &id004 !ruby/object:Gem::Requirement
70
71
  none: false
71
72
  requirements:
@@ -75,11 +76,11 @@ dependencies:
75
76
  segments:
76
77
  - 0
77
78
  version: "0"
78
- requirement: *id004
79
79
  prerelease: false
80
- name: rcov
80
+ requirement: *id004
81
81
  - !ruby/object:Gem::Dependency
82
82
  type: :runtime
83
+ name: mutter
83
84
  version_requirements: &id005 !ruby/object:Gem::Requirement
84
85
  none: false
85
86
  requirements:
@@ -89,11 +90,11 @@ dependencies:
89
90
  segments:
90
91
  - 0
91
92
  version: "0"
92
- requirement: *id005
93
93
  prerelease: false
94
- name: mutter
94
+ requirement: *id005
95
95
  - !ruby/object:Gem::Dependency
96
96
  type: :runtime
97
+ name: keystorage
97
98
  version_requirements: &id006 !ruby/object:Gem::Requirement
98
99
  none: false
99
100
  requirements:
@@ -104,11 +105,11 @@ dependencies:
104
105
  - 0
105
106
  - 1
106
107
  version: "0.1"
107
- requirement: *id006
108
108
  prerelease: false
109
- name: keystorage
109
+ requirement: *id006
110
110
  - !ruby/object:Gem::Dependency
111
111
  type: :runtime
112
+ name: mechanize
112
113
  version_requirements: &id007 !ruby/object:Gem::Requirement
113
114
  none: false
114
115
  requirements:
@@ -120,11 +121,11 @@ dependencies:
120
121
  - 0
121
122
  - 0
122
123
  version: 1.0.0
123
- requirement: *id007
124
124
  prerelease: false
125
- name: mechanize
125
+ requirement: *id007
126
126
  - !ruby/object:Gem::Dependency
127
127
  type: :runtime
128
+ name: highline
128
129
  version_requirements: &id008 !ruby/object:Gem::Requirement
129
130
  none: false
130
131
  requirements:
@@ -135,9 +136,8 @@ dependencies:
135
136
  - 1
136
137
  - 6
137
138
  version: "1.6"
138
- requirement: *id008
139
139
  prerelease: false
140
- name: highline
140
+ requirement: *id008
141
141
  description: This is a scraper of Bookscan (http://www.bookscan.co.jp) Service.This is *NOT* a official software of Bookscan.
142
142
  email: y.takahara@gmail.com
143
143
  executables: