ebook_renamer 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/bin/ebook_renamer +2 -3
- data/lib/ebook_renamer/helpers.rb +2 -5
- data/lib/ebook_renamer/options.rb +3 -3
- data/lib/ebook_renamer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e38919b59f66fe6c673a53a921f80509d59023c
|
4
|
+
data.tar.gz: 9ca3cf98544542377e960004af4d047f5ad6d770
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dafbc00bea1fda11422bd5c8e8b1f19d37a40d8ecb0879f4ba9c00b9b6075524cf33d548f64f64c5d2336db38e769b32271a474f12b3cc3498961f65ae02c4c4
|
7
|
+
data.tar.gz: 5ea3fa07501906e6453340d5e27f1e9f3d8bec9b3717caa63cfff98e63721cbebf08bbb523fa0b44183f34a18601bb6a61c8d35a875e51f06edadf1da9a6fc10
|
data/README.md
CHANGED
@@ -81,14 +81,14 @@ ebook_renamer --recusive --commit
|
|
81
81
|
--commit
|
82
82
|
|
83
83
|
6) $ebook_renamer --base-dir ~/Dropbox/ebooks
|
84
|
-
--meta-binary
|
84
|
+
--meta-binary ebook-meta
|
85
85
|
--recursive
|
86
86
|
--commit
|
87
87
|
|
88
88
|
Options:
|
89
89
|
|
90
90
|
-b, --base-dir directory Starting directory [default - current directory]
|
91
|
-
-m, --meta-binary path
|
91
|
+
-m, --meta-binary path The ebook-meta executable [default - 'ebook-meta']
|
92
92
|
-r, --recursive Process the files recursively [default - false]
|
93
93
|
-c, --commit Perform the actual rename [default - false]
|
94
94
|
-v, --version Display version number
|
@@ -97,6 +97,11 @@ ebook_renamer --recusive --commit
|
|
97
97
|
|
98
98
|
### Changelog
|
99
99
|
|
100
|
+
#### 0.0.4
|
101
|
+
|
102
|
+
- fix the stupid bug with the `which` method which raise invalid error
|
103
|
+
- update README.md to reflect the change
|
104
|
+
|
100
105
|
#### 0.0.3
|
101
106
|
|
102
107
|
- make it possible to change the path to the binary
|
data/bin/ebook_renamer
CHANGED
@@ -15,11 +15,10 @@ begin
|
|
15
15
|
options = parse_options()
|
16
16
|
EbookRenamer.logger.info "Your options: #{options}"
|
17
17
|
meta_binary = options.delete(:meta_binary)
|
18
|
-
|
18
|
+
|
19
19
|
# Note: if we need to adjust the path to the executable
|
20
20
|
EbookRenamer.configure do |config|
|
21
|
-
|
22
|
-
config.meta_binary = meta_binary unless meta_binary.nil?
|
21
|
+
config.meta_binary = meta_binary if meta_binary
|
23
22
|
end
|
24
23
|
|
25
24
|
cli = EbookRenamer::CLI.new(EbookRenamer.configuration)
|
@@ -15,12 +15,9 @@ module EbookRenamer
|
|
15
15
|
# @param [String] binary the executable for use to extract the metadata
|
16
16
|
# @return [String] result of the output from running the command
|
17
17
|
def meta(filename, binary = 'ebook-meta')
|
18
|
-
|
19
|
-
|
20
|
-
raise EbookMetaNotInstall, "Need to install ebook-meta to use this gem" if binary_path.nil?
|
21
|
-
|
18
|
+
raise EbookMetaNotInstall, "Need to install ebook-meta to use this gem" if which(binary).nil?
|
22
19
|
command = [
|
23
|
-
|
20
|
+
binary,
|
24
21
|
Shellwords.escape(filename)
|
25
22
|
]
|
26
23
|
|
@@ -27,7 +27,7 @@ module EbookRenamer::Options
|
|
27
27
|
| --commit
|
28
28
|
|
|
29
29
|
| 6) $ebook_renamer --base-dir ~/Dropbox/ebooks
|
30
|
-
| --meta-binary
|
30
|
+
| --meta-binary ebook-meta
|
31
31
|
| --recursive
|
32
32
|
| --commit
|
33
33
|
|
|
@@ -40,8 +40,8 @@ module EbookRenamer::Options
|
|
40
40
|
options[:base_dir] = base_dir
|
41
41
|
end
|
42
42
|
|
43
|
-
options[:meta_binary] ||= '
|
44
|
-
opts.on('-m', '--meta-binary path', "
|
43
|
+
options[:meta_binary] ||= 'ebook-meta'
|
44
|
+
opts.on('-m', '--meta-binary path', "The ebook-meta executable [default - 'ebook-meta']") do |binary|
|
45
45
|
options[:meta_binary] = binary
|
46
46
|
end
|
47
47
|
|