ebook_renamer 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/Rakefile +1 -1
- data/ebook_renamer.gemspec +3 -3
- data/lib/ebook_renamer/utils.rb +1 -20
- data/lib/ebook_renamer/version.rb +1 -1
- data/test/lib/ebook_renamer/test_utils.rb +0 -13
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8a64ca3175a4c4bed67276095ece3989599899b
|
4
|
+
data.tar.gz: 87b77360c94a40e519044592bd43f3c9983b904a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ed719c07b3eeabac5ed9ff4e80d850448fd3f80c87bfd7b1e34f2bdea8267b250ee438c42e347c2f4afff18b764402803c6df24c52ba181cbaf64264457875f
|
7
|
+
data.tar.gz: d885702e217df52ebe83ee2e9a14993ebf84a5163966715ac2619750012ac231956776b0336dd5dbc73fd23fa030359b5a1c79cf6b9c2578e7389e1f8243e9af
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
## ebook_renamer
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/ebook_renamer.svg)](http://badge.fury.io/rb/ebook_renamer)
|
4
|
+
[![Dependency Status](https://gemnasium.com/agilecreativity/ebook_renamer.png)](https://gemnasium.com/agilecreativity/ebook_renamer)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/agilecreativity/ebook_renamer.png)](https://codeclimate.com/github/agilecreativity/ebook_renamer)
|
4
6
|
|
5
7
|
Perform bulk rename of ebook files (epub,mobi,pdf, and any other extensions supported by Calibre)
|
6
8
|
based on the embedded meta-data (title, author(s)).
|
@@ -154,6 +156,12 @@ Rename multiple ebook files (pdf,epub,mobi)
|
|
154
156
|
|
155
157
|
### Changelog
|
156
158
|
|
159
|
+
#### 0.1.4
|
160
|
+
|
161
|
+
- Make use of functions from 'agile_utils' to promote code re-use
|
162
|
+
- Make Rakefile pickup the right code for testing
|
163
|
+
- Update README.md to include code_climate and gemnasium
|
164
|
+
|
157
165
|
#### 0.1.3
|
158
166
|
|
159
167
|
- Make sanitize_filename work properly with `--sep-string` option
|
data/Rakefile
CHANGED
data/ebook_renamer.gemspec
CHANGED
@@ -17,14 +17,14 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
spec.add_runtime_dependency 'thor', '~> 0.18'
|
20
|
-
spec.add_runtime_dependency 'agile_utils', '~> 0.0.
|
21
|
-
spec.add_runtime_dependency 'code_lister', '~> 0.0.
|
20
|
+
spec.add_runtime_dependency 'agile_utils', '~> 0.0.9'
|
21
|
+
spec.add_runtime_dependency 'code_lister', '~> 0.0.8'
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
23
23
|
spec.add_development_dependency 'rake'
|
24
24
|
spec.add_development_dependency 'awesome_print', '~> 1.2'
|
25
25
|
spec.add_development_dependency 'minitest-spec-context', '~> 0.0.3'
|
26
26
|
spec.add_development_dependency 'guard-minitest', '~> 2.2'
|
27
|
-
spec.add_development_dependency 'minitest', '~>
|
27
|
+
spec.add_development_dependency 'minitest', '~> 5.3'
|
28
28
|
spec.add_development_dependency 'guard', '~> 2.6'
|
29
29
|
spec.add_development_dependency 'pry', '~> 0.9'
|
30
30
|
spec.add_development_dependency 'gem-ctags', '~> 1.0'
|
data/lib/ebook_renamer/utils.rb
CHANGED
@@ -13,7 +13,7 @@ module EbookRenamer
|
|
13
13
|
# @param [String] binary the executable for use to extract the metadata
|
14
14
|
# @return [String] result of the output from running the command
|
15
15
|
def meta(filename, binary = 'ebook-meta')
|
16
|
-
raise EbookMetaNotInstall, "Need to install ebook-meta to use this gem" if which(binary).nil?
|
16
|
+
raise EbookMetaNotInstall, "Need to install ebook-meta to use this gem" if AgileUtils::Helper.which(binary).nil?
|
17
17
|
command = [
|
18
18
|
binary,
|
19
19
|
Shellwords.escape(filename)
|
@@ -71,25 +71,6 @@ module EbookRenamer
|
|
71
71
|
filename.strip
|
72
72
|
end
|
73
73
|
|
74
|
-
# Cross-platform way of finding an executable in the $PATH.
|
75
|
-
#
|
76
|
-
# @param command [String] the command to look up
|
77
|
-
# @return [String, NilClass] full path to the executable file or nil if the
|
78
|
-
# executable is not valid or available.
|
79
|
-
# Example:
|
80
|
-
# which('ruby') #=> /usr/bin/ruby
|
81
|
-
# which('bad-executable') #=> nil
|
82
|
-
def which(command)
|
83
|
-
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
84
|
-
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
85
|
-
exts.each { |ext|
|
86
|
-
exe = File.join(path, "#{command}#{ext}")
|
87
|
-
return exe if File.executable? exe
|
88
|
-
}
|
89
|
-
end
|
90
|
-
return nil
|
91
|
-
end
|
92
|
-
|
93
74
|
# Return formatted file name using the metadata values
|
94
75
|
#
|
95
76
|
# @param [Hash<Symbol,String>] meta_hash output from the program 'ebook-meta' or 'exiftoo'
|
@@ -85,19 +85,6 @@ describe EbookRenamer do
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
-
context '#which' do
|
89
|
-
describe 'valid executable' do
|
90
|
-
it 'works with valid executable' do
|
91
|
-
which('ruby').wont_be_nil
|
92
|
-
end
|
93
|
-
end
|
94
|
-
describe 'invalid executable' do
|
95
|
-
it 'works with invalid executable' do
|
96
|
-
which('@not-a-valid-executable!').must_be_nil
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
88
|
context '#formatted_name' do
|
102
89
|
describe 'invalid parameters' do
|
103
90
|
it 'raises exception on nil arguments' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ebook_renamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
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-
|
11
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.9
|
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.
|
40
|
+
version: 0.0.9
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: code_lister
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.0.
|
47
|
+
version: 0.0.8
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.0.
|
54
|
+
version: 0.0.8
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '5.3'
|
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: '
|
138
|
+
version: '5.3'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: guard
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|