ebook_renamer 0.0.3 → 0.0.4

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: 0c2b2bf7c2b9d1e2920c4634db1c348ec8db3fda
4
- data.tar.gz: df92456b316428948cd8d27eb9a9765da785243a
3
+ metadata.gz: 9e38919b59f66fe6c673a53a921f80509d59023c
4
+ data.tar.gz: 9ca3cf98544542377e960004af4d047f5ad6d770
5
5
  SHA512:
6
- metadata.gz: 39c8b4cbf1b95036c45c693a3bf37fb371ad3222dc40a715ba81e84e8cdec072e2ad7b7f39910309b1bb21df2b0c9a91a5567dc38875bf5a50619fc5ec4f12b1
7
- data.tar.gz: b67d518a78608658c0f6defe6fe2eb58351746da8927f4efb873d2e230d936493d48803f2273d3b968c4d08dfdba0e54347c9402099025dbeccd3eee7576017a
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 /usr/bin/ebook-meta
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 Path to the ebook-meta executable [default - '/usr/bin/ebook-meta']
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
@@ -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
- #config.meta_binary = '/usr/bin/ebook-meta'
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
- binary_path = which(binary)
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
- binary_path,
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 /usr/bin/ebook-meta
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] ||= '/usr/bin/ebook-meta'
44
- opts.on('-m', '--meta-binary path', "Path to the ebook-meta executable [default - '/usr/bin/ebook-meta']") do |binary|
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
 
@@ -1,3 +1,3 @@
1
1
  module EbookRenamer
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebook_renamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burin Choomnuan