ebooks_renamer 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9f7257c21f8c55e896e09e42e99e7b49b6888f5
4
- data.tar.gz: df8529d5805e298935a986addfac63ce008183bd
3
+ metadata.gz: c429f4b8b54fafc25b246dc7ad090b1481e1a934
4
+ data.tar.gz: fde7f6caee96c1da6e802a57906a730e90b14590
5
5
  SHA512:
6
- metadata.gz: ed69bff7b8c73342a6d56e9ee1d51dfbc26f414a27a134b91f81eda3ce22e46ad76a5c77a4f0f745ff64ccf8e0b100ae6bd6e31d7278bf68fad182194de5916d
7
- data.tar.gz: 6e21b5ac61b418a48f4cee814ed6c7bb8d34ef7ed3ff1c841dc0bc4786193ac861fdc2fc667a75c79ac68011a019daf78d5451955a569e22bda7597f17e1fead
6
+ metadata.gz: 0a76b74faaa7a98c1d09d29c8d229577441835d2f805d40639f2412c13d3e2be0276079c85f2a15fdd4a764a1f181147b7ab7ca63160736d3448f1e5eb718559
7
+ data.tar.gz: 5a157f28cdf83f7741e95d5eb4197835220145efc85622825add85b2db6b2f538ef1d6aa16021dd34a7f39667c497abd987112bd351c3d9ffcca5003b8ae238a
data/.rubocop.yml CHANGED
@@ -6,6 +6,7 @@ AllCops:
6
6
  - ebooks_cleaner.gemspec
7
7
  - lib/**/*.rb
8
8
  - test/**/*.rb
9
+
9
10
  # Avoid long parameter lists
10
11
  ParameterLists:
11
12
  Max: 5
@@ -27,12 +28,6 @@ CollectionMethods:
27
28
  find: 'detect'
28
29
  find_all: 'select'
29
30
 
30
- # Do not force public/protected/private keyword to be indented at the same
31
- # level as the def keyword. My personal preference is to outdent these keywords
32
- # because I think when scanning code it makes it easier to identify the
33
- # sections of code and visually separate them. When the keyword is at the same
34
- # level I think it sort of blends in with the def keywords and makes it harder
35
- # to scan the code and see where the sections are.
36
31
  AccessModifierIndentation:
37
32
  Enabled: false
38
33
 
@@ -60,10 +55,6 @@ DotPosition:
60
55
  Encoding:
61
56
  Enabled: false
62
57
 
63
- # Enforce outdenting of access modifiers (i.e. public, private, protected)
64
- AccessModifierIndentation:
65
- EnforcedStyle: outdent
66
-
67
58
  EmptyLinesAroundAccessModifier:
68
59
  Enabled: true
69
60
 
@@ -25,18 +25,18 @@ Gem::Specification.new do |spec|
25
25
  spec.add_runtime_dependency 'pdf-reader', '~> 1.3.3'
26
26
  spec.add_runtime_dependency 'mobi', '~> 1.0.0'
27
27
  spec.add_runtime_dependency 'epubinfo', '~> 0.4.3'
28
- spec.add_runtime_dependency 'filename_cleaner', '~> 0.3'
29
- spec.add_runtime_dependency 'agile_utils', '~> 0.1.5'
30
- spec.add_runtime_dependency 'code_lister', '~> 0.1.7'
31
- spec.add_development_dependency 'awesome_print', '~> 1.2'
32
- spec.add_development_dependency 'bundler', '~> 1.5'
33
- spec.add_development_dependency 'gem-ctags', '~> 1.0'
28
+ spec.add_runtime_dependency 'filename_cleaner', '~> 0.4.0'
29
+ spec.add_runtime_dependency 'agile_utils', '~> 0.2.0'
30
+ spec.add_runtime_dependency 'code_lister', '~> 0.2.0'
31
+ spec.add_development_dependency 'awesome_print', '~> 1.2.0'
32
+ spec.add_development_dependency 'bundler', '~> 1.6.2'
33
+ spec.add_development_dependency 'gem-ctags', '~> 1.0.6'
34
34
  spec.add_development_dependency 'guard', '~> 2.6.1'
35
- spec.add_development_dependency 'guard-minitest', '~> 2.2'
36
- spec.add_development_dependency 'minitest', '~> 5.3'
35
+ spec.add_development_dependency 'guard-minitest', '~> 2.3.1'
36
+ spec.add_development_dependency 'minitest', '~> 5.4.0'
37
37
  spec.add_development_dependency 'minitest-spec-context', '~> 0.0.3'
38
38
  spec.add_development_dependency 'pry', '~> 0.9.12'
39
- spec.add_development_dependency 'rake', '~> 10.1'
40
- spec.add_development_dependency 'rubocop', '~> 0.23'
41
- spec.add_development_dependency 'yard', '~> 0.8'
39
+ spec.add_development_dependency 'rake', '~> 10.3.2'
40
+ spec.add_development_dependency 'rubocop', '~> 0.24.1'
41
+ spec.add_development_dependency 'yard', '~> 0.8.7'
42
42
  end
@@ -3,6 +3,8 @@ require "agile_utils"
3
3
  require_relative "ebooks_renamer"
4
4
  module EbooksRenamer
5
5
  class CLI < Thor
6
+ using AgileUtils::HashExt
7
+
6
8
  desc "rename", "Rename ebooks based on given criteria"
7
9
  method_option *AgileUtils::Options::BASE_DIR
8
10
  method_option *AgileUtils::Options::RECURSIVE
@@ -8,9 +8,12 @@ require "code_lister"
8
8
  require_relative "pdf_parser"
9
9
  require_relative "epub_parser"
10
10
  require_relative "mobi_parser"
11
+
11
12
  module EbooksRenamer
12
13
  CustomError = Class.new(StandardError)
13
14
  class << self
15
+ using AgileUtils::BlankExt
16
+
14
17
  def rename(options = {})
15
18
  files = CodeLister.files(options)
16
19
  files.each_with_index do |file, index|
@@ -38,7 +41,7 @@ module EbooksRenamer
38
41
  end
39
42
  end
40
43
 
41
- private
44
+ private
42
45
 
43
46
  def formatted_name(file, sep_string)
44
47
  meta = parse(file)
@@ -1,6 +1,7 @@
1
1
  module EbooksRenamer
2
2
  class EpubParser
3
3
  class << self
4
+ using AgileUtils::BlankExt
4
5
  def parse(filename)
5
6
  info = EPUBInfo.get(filename)
6
7
  if info.present?
@@ -1,6 +1,8 @@
1
1
  module EbooksRenamer
2
2
  class PdfParser
3
3
  class << self
4
+ using AgileUtils::BlankExt
5
+
4
6
  def parse(filename)
5
7
  File.open(filename, "rb") do |io|
6
8
  reader = PDF::Reader.new(io)
@@ -1,3 +1,3 @@
1
1
  module EbooksRenamer
2
- VERSION = "0.1.5"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebooks_renamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burin Choomnuan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-23 00:00:00.000000000 Z
11
+ date: 2014-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -72,84 +72,84 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.3'
75
+ version: 0.4.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.3'
82
+ version: 0.4.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: agile_utils
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.1.5
89
+ version: 0.2.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.1.5
96
+ version: 0.2.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: code_lister
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.1.7
103
+ version: 0.2.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.1.7
110
+ version: 0.2.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: awesome_print
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.2'
117
+ version: 1.2.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.2'
124
+ version: 1.2.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: bundler
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '1.5'
131
+ version: 1.6.2
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '1.5'
138
+ version: 1.6.2
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: gem-ctags
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '1.0'
145
+ version: 1.0.6
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '1.0'
152
+ version: 1.0.6
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: guard
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -170,28 +170,28 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '2.2'
173
+ version: 2.3.1
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '2.2'
180
+ version: 2.3.1
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: minitest
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: '5.3'
187
+ version: 5.4.0
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: '5.3'
194
+ version: 5.4.0
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: minitest-spec-context
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -226,42 +226,42 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '10.1'
229
+ version: 10.3.2
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '10.1'
236
+ version: 10.3.2
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: rubocop
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: '0.23'
243
+ version: 0.24.1
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - "~>"
249
249
  - !ruby/object:Gem::Version
250
- version: '0.23'
250
+ version: 0.24.1
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: yard
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
255
  - - "~>"
256
256
  - !ruby/object:Gem::Version
257
- version: '0.8'
257
+ version: 0.8.7
258
258
  type: :development
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
262
  - - "~>"
263
263
  - !ruby/object:Gem::Version
264
- version: '0.8'
264
+ version: 0.8.7
265
265
  description: Bulk rename multiple ebook files (pdf, epub, mobi) using embedded metadata
266
266
  if available (pure ruby implementation)
267
267
  email: