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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21fe146438b4dbb0ad23847f2124d567d10fcca1
4
- data.tar.gz: a89bf580f80cbd067eb650655a75354d8be98a60
3
+ metadata.gz: c8023c3193436aa238e7a4767ec89ba04ca62bc9
4
+ data.tar.gz: e8e0ffbdba67983f7e88827f4f02485031ecae32
5
5
  SHA512:
6
- metadata.gz: 98e1c3e802c68ce8884ecca42589fd977478469fd9de171a8683beb05aecc0ad999f01c2dc6472c1a5df7a8364ba020d3f330ac5caef0387cfb24770db006ff5
7
- data.tar.gz: 2c50e1534fb80443ce4334ceba3fb0757bc801e850a270a2effa81e42908c04084ab8f0147e21cf6d2ee13c126cc158a1527615e097d06caf1fd05f024ba3a63
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
- new_name = formatted_name(file, options[:sep_string])
20
- if file != new_name
21
- puts "#{index + 1} of #{files.length}: Old name: '#{file}'"
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(file, new_name) if options[:commit]
24
+ FileUtils.mv(old_name, new_name) if options[:commit]
24
25
  else
25
- puts "#{index + 1} of #{files.length}: Result : '#{file}' is identical so no action taken."
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}'"
@@ -1,3 +1,3 @@
1
1
  module EbooksRenamer
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebooks_renamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burin Choomnuan