ebooks_renamer 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ebooks_renamer/ebooks_renamer.rb +6 -5
- data/lib/ebooks_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: c8023c3193436aa238e7a4767ec89ba04ca62bc9
|
4
|
+
data.tar.gz: e8e0ffbdba67983f7e88827f4f02485031ecae32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff7cb3e93207aaaedd3925dc95da8985d7acad85129f4ab03424ed2b2560becec4f03dbebf4269478d732bc62b86ebd8ef6539658207e085255b21a91d2a4476
|
7
|
+
data.tar.gz: efd7361232b1b888766efdd515968a123f31eccfe9005b49139650cbb1f3ed053c44aca7c7f0aef151183e01bb6a66584112b20e035e2a2244f32d28140d57cf
|
@@ -16,13 +16,14 @@ module EbooksRenamer
|
|
16
16
|
files.each_with_index do |file, index|
|
17
17
|
# process as many files as possible
|
18
18
|
begin
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
old_name = File.expand_path(file)
|
20
|
+
new_name = formatted_name(old_name, options[:sep_string])
|
21
|
+
if old_name != new_name
|
22
|
+
puts "#{index + 1} of #{files.length}: Old name: '#{old_name}'"
|
22
23
|
puts "#{index + 1} of #{files.length}: New name: '#{new_name}'"
|
23
|
-
FileUtils.mv(
|
24
|
+
FileUtils.mv(old_name, new_name) if options[:commit]
|
24
25
|
else
|
25
|
-
puts "#{index + 1} of #{files.length}: Result : '#{
|
26
|
+
puts "#{index + 1} of #{files.length}: Result : '#{old_name}' is identical so no action taken."
|
26
27
|
end
|
27
28
|
rescue Exception => e
|
28
29
|
puts "Skip file '#{file}'"
|