ebook_renamer 0.1.1 → 0.1.2

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: 9e27d4db397905bbe0cf08d76ed4b6d01b4b2a29
4
- data.tar.gz: 53bc900783b7757cfdbdd8d6ed632facdd8a9f52
3
+ metadata.gz: e424aaf924da59dd5d6b1d753190e5ca6620c843
4
+ data.tar.gz: 493c6f7a8516d592b5eff936949d8275d0483e52
5
5
  SHA512:
6
- metadata.gz: c04360a30e7491e5704d51ed7140146f805a11062f8deab049988ef7a0ef1e8fe7e7d30258abe683b9ce0d81d5d0eeef0dcafde5fb5673a2aa62e16e7d722462
7
- data.tar.gz: 22ce0baff5a0bdc51ff3e422ef8f9c2e8aa45d8c20d45a7a142483f20519d04a148b7acd92c5e49b0603d2262c8510346f2cbfb7bacdf1c633e30470d90107f4
6
+ metadata.gz: 598d4d1a58f1b5ba9e4e9d7bf7bd6d9d13a08fe715ec1a9eddfe5949b60423dc022ad81a6550300ea2456f2db80eef5edf92ec9e0d64dd1d35864a7addd88462
7
+ data.tar.gz: 6adfee3ab04652a9f403424c7030fc63ff89f023325484816a610cd51e02677a088901949ad198b59d32a11fb6cb00aef1854e20c3a9d842b623753933d26d1e
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.1.1
data/Gemfile CHANGED
@@ -2,5 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in ebook_renamer.gemspec
4
4
  gemspec
5
-
6
- gem 'code_lister', '~> 0.0.6'
data/Guardfile CHANGED
@@ -1,7 +1,6 @@
1
1
  # A sample Guardfile
2
2
  # More info at https://github.com/guard/guard#readme
3
3
  guard 'minitest' do
4
-
5
4
  # with Minitest::Unit
6
5
  watch(%r|^test/(.*)\/?test_(.*)\.rb|)
7
6
  watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
@@ -11,5 +10,4 @@ guard 'minitest' do
11
10
  # watch(%r|^spec/(.*)_spec\.rb|)
12
11
  # watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
13
12
  # watch(%r|^spec/spec_helper\.rb|) { "spec" }
14
-
15
13
  end
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Burin Choomnuan
1
+ Copyright (c) 2014 Burin Choomnuan
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -154,31 +154,28 @@ Rename multiple ebook files (pdf,epub,mobi)
154
154
 
155
155
  ### Changelog
156
156
 
157
- #### 0.1.1
157
+ #### 0.1.2
158
+ - Make use of [agile_utils] gem
159
+ - Add TODOs.md
158
160
 
159
- - Make use of the 'code_lister' for better options [see: `ebook_renamer` for detail]
160
- - The --exts must be specified explicitly as `code_lister` is not set any extension by default.
161
+ #### 0.1.1
162
+ - Make use of the [code_lister][] gem
161
163
 
162
164
  #### 0.1.0
163
-
164
165
  - Add link to the version badge to link to latest gem.
165
166
  - Implicitly set the default value for extension to `pdf,epub,mobi` if
166
167
  not explicitly set by the user at the command line.
167
168
 
168
169
  #### 0.0.9
169
-
170
170
  - Make sure the gemspec include the proper dependencies.
171
171
 
172
172
  #### 0.0.8
173
-
174
173
  - Use Thor instead of OptionParser for parsing of options
175
174
 
176
175
  #### 0.0.2 - 0.0.7
177
-
178
176
  - Improvement of code and fix a few bugs a long the way
179
177
 
180
178
  #### 0.0.1
181
-
182
179
  - Initial release
183
180
 
184
181
  ### Contributing
@@ -189,3 +186,6 @@ Rename multiple ebook files (pdf,epub,mobi)
189
186
  4. Make sure that you add the tests and ensure that all tests are passed
190
187
  5. Push to the branch (`git push origin my-new-feature`)
191
188
  6. Create new Pull Request
189
+
190
+ [agile_utils]: https://rubygems.org/gems/agile_utils
191
+ [code_lister]: https://rubygems.org/gems/code_lister
@@ -0,0 +1,3 @@
1
+ ### TODO List
2
+ - Fix the issue with the '--sep-string' not working properly.
3
+ - Add more tests
@@ -4,30 +4,28 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'ebook_renamer/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "ebook_renamer"
7
+ spec.name = 'ebook_renamer'
8
8
  spec.version = EbookRenamer::VERSION
9
- spec.authors = ["Burin Choomnuan"]
10
- spec.email = ["agilecreativity@gmail.com"]
11
- spec.description = %q{Bulk rename of ebook files (pdf, epub, mobi) based on embedded meta-data}
12
- spec.summary = %q{Rename multiple ebook files (pdf, epub, mobi) based on existing meta-data in the file}
13
- spec.homepage = "https://github.com/agilecreativity/ebook_renamer"
14
- spec.license = "MIT"
9
+ spec.authors = ['Burin Choomnuan']
10
+ spec.email = ['agilecreativity@gmail.com']
11
+ spec.description = %q{Bulk rename of ebook files (pdf, epub, mobi) based on embedded metadata}
12
+ spec.summary = %q{Rename multiple ebook files (pdf, epub, mobi) based on existing metadata if available}
13
+ spec.homepage = 'https://github.com/agilecreativity/ebook_renamer'
14
+ spec.license = 'MIT'
15
15
  spec.files = `git ls-files`.split($/)
16
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
- spec.require_paths = ["lib"]
19
-
20
- spec.add_runtime_dependency "thor", "~> 0.18"
21
- spec.add_runtime_dependency "code_lister", "~> 0.0.6"
22
-
23
- spec.add_development_dependency "bundler", "~> 1.3"
24
- spec.add_development_dependency "rake"
25
- spec.add_development_dependency "awesome_print", "~> 1.2"
26
- spec.add_development_dependency "minitest-spec-context", "~> 0.0.3"
27
- spec.add_development_dependency "guard-minitest", "~> 2.2"
28
- spec.add_development_dependency "minitest", "~> 4.2"
29
- spec.add_development_dependency "guard", "~> 2.6"
30
- spec.add_development_dependency "pry", "~> 0.9"
31
- spec.add_development_dependency "gem-ctags", "~> 1.0"
32
- spec.add_development_dependency "yard", "~> 0.8"
18
+ spec.require_paths = ['lib']
19
+ spec.add_runtime_dependency 'thor', '~> 0.18'
20
+ spec.add_runtime_dependency 'code_lister', '~> 0.0.7'
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'awesome_print', '~> 1.2'
24
+ spec.add_development_dependency 'minitest-spec-context', '~> 0.0.3'
25
+ spec.add_development_dependency 'guard-minitest', '~> 2.2'
26
+ spec.add_development_dependency 'minitest', '~> 4.2'
27
+ spec.add_development_dependency 'guard', '~> 2.6'
28
+ spec.add_development_dependency 'pry', '~> 0.9'
29
+ spec.add_development_dependency 'gem-ctags', '~> 1.0'
30
+ spec.add_development_dependency 'yard', '~> 0.8'
33
31
  end
@@ -1,5 +1,6 @@
1
1
  require 'thor'
2
2
  require 'code_lister'
3
+ require 'agile_utils'
3
4
  require_relative 'ebook_renamer/core_ext/hash'
4
5
  require_relative 'ebook_renamer/version'
5
6
  require_relative 'ebook_renamer/logger'
@@ -2,10 +2,17 @@ require 'code_lister'
2
2
  require_relative '../ebook_renamer'
3
3
 
4
4
  module EbookRenamer
5
- class CLI < CodeLister::BaseCLI
5
+ class CLI < Thor
6
6
  desc 'rename', 'Rename multiple ebook files (pdf,epub,mobi)'
7
7
 
8
- shared_options
8
+ method_option *AgileUtils::Options::BASE_DIR
9
+ method_option *AgileUtils::Options::EXTS
10
+ method_option *AgileUtils::Options::NON_EXTS
11
+ method_option *AgileUtils::Options::INC_WORDS
12
+ method_option *AgileUtils::Options::EXC_WORDS
13
+ method_option *AgileUtils::Options::IGNORE_CASE
14
+ method_option *AgileUtils::Options::RECURSIVE
15
+ method_option *AgileUtils::Options::VERSION
9
16
 
10
17
  method_option :sep_string,
11
18
  aliases: "-s",
@@ -63,7 +63,7 @@ module EbookRenamer
63
63
  filename.gsub!(/[^0-9A-Za-z\-_ ]/, dot)
64
64
 
65
65
  # replace multiple occurrences of a given char with a dot
66
- ['-','_',' '].each do |c|
66
+ ['-', '_', ' '].each do |c|
67
67
  filename.gsub!(/#{Regexp.quote(c)}+/, dot)
68
68
  end
69
69
 
@@ -112,8 +112,10 @@ module EbookRenamer
112
112
 
113
113
  # The keys that we get from the 'mdls' or 'exiftool'
114
114
  args = {
115
- keys: ['title',
116
- 'author(s)'],
115
+ keys: [
116
+ 'title',
117
+ 'author(s)'
118
+ ],
117
119
  sep_char: ' '
118
120
  }.merge(fields)
119
121
 
@@ -133,7 +135,7 @@ module EbookRenamer
133
135
  return result.join(sep_char)
134
136
  end
135
137
  # Note: if no title we choose to return empty value for result
136
- return ""
138
+ ""
137
139
  end
138
140
 
139
141
  # Ensure that the values in hash are sanitized
@@ -1,3 +1,3 @@
1
1
  module EbookRenamer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,184 +1,184 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebook_renamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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-04-15 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.18'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.18'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: code_lister
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.6
33
+ version: 0.0.7
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.6
40
+ version: 0.0.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: awesome_print
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.2'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.2'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: minitest-spec-context
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.0.3
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.0.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: guard-minitest
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '2.2'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '2.2'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: minitest
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '4.2'
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
124
  version: '4.2'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: guard
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: '2.6'
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
138
  version: '2.6'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: pry
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ~>
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0.9'
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
152
  version: '0.9'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: gem-ctags
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ~>
157
+ - - "~>"
158
158
  - !ruby/object:Gem::Version
159
159
  version: '1.0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ~>
164
+ - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '1.0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: yard
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ~>
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0.8'
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
180
  version: '0.8'
181
- description: Bulk rename of ebook files (pdf, epub, mobi) based on embedded meta-data
181
+ description: Bulk rename of ebook files (pdf, epub, mobi) based on embedded metadata
182
182
  email:
183
183
  - agilecreativity@gmail.com
184
184
  executables:
@@ -186,15 +186,16 @@ executables:
186
186
  extensions: []
187
187
  extra_rdoc_files: []
188
188
  files:
189
- - .gitignore
190
- - .ruby-version
191
- - .travis.yml
192
- - .yardopts
189
+ - ".gitignore"
190
+ - ".ruby-version"
191
+ - ".travis.yml"
192
+ - ".yardopts"
193
193
  - Gemfile
194
194
  - Guardfile
195
195
  - LICENSE
196
196
  - README.md
197
197
  - Rakefile
198
+ - TODOs.md
198
199
  - bin/ebook_renamer
199
200
  - ebook_renamer.gemspec
200
201
  - lib/ebook_renamer.rb
@@ -219,21 +220,21 @@ require_paths:
219
220
  - lib
220
221
  required_ruby_version: !ruby/object:Gem::Requirement
221
222
  requirements:
222
- - - '>='
223
+ - - ">="
223
224
  - !ruby/object:Gem::Version
224
225
  version: '0'
225
226
  required_rubygems_version: !ruby/object:Gem::Requirement
226
227
  requirements:
227
- - - '>='
228
+ - - ">="
228
229
  - !ruby/object:Gem::Version
229
230
  version: '0'
230
231
  requirements: []
231
232
  rubyforge_project:
232
- rubygems_version: 2.0.14
233
+ rubygems_version: 2.2.2
233
234
  signing_key:
234
235
  specification_version: 4
235
- summary: Rename multiple ebook files (pdf, epub, mobi) based on existing meta-data
236
- in the file
236
+ summary: Rename multiple ebook files (pdf, epub, mobi) based on existing metadata
237
+ if available
237
238
  test_files:
238
239
  - test/fixtures/ebooks/demo1.pdf
239
240
  - test/fixtures/ebooks/demo2.epub