folders_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/CHANGELOG.md +4 -0
- data/README.md +3 -3
- data/bin/folders_renamer +5 -1
- data/lib/folders_renamer/cli.rb +3 -3
- data/lib/folders_renamer/folders_renamer.rb +3 -1
- data/lib/folders_renamer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99b81986892d3e6af4ec75d5ecf21625e964a617
|
4
|
+
data.tar.gz: 705f0a3cb1e042730ce3799572ed9e7d473090fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baa398bcf5a3dab03e12cd7174bbfe2250e69ed87710402d6835843aa8c876cd218a146aff1e87e22ded668e3c595c9c9f90ad09ddbb0ba885aa3d90bf210853
|
7
|
+
data.tar.gz: 000af1d9a38387448826d82513825d6258883e0de5d0ad51f2d9d6e3f91a1f6d212c57fec35ce2af09f9c24a1a6f5cacdccc2c184caa720b0539dea135316245
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -51,10 +51,10 @@ using command like:
|
|
51
51
|
cd ~/path/to/some_folder/
|
52
52
|
|
53
53
|
# Perform the dry-run to see what will be changed (no changes)
|
54
|
-
folders_renamer
|
54
|
+
folders_renamer --sep-string _
|
55
55
|
|
56
56
|
# Commit your changes
|
57
|
-
folders_renamer
|
57
|
+
folders_renamer --sep-string _ --commit
|
58
58
|
```
|
59
59
|
|
60
60
|
### Installation
|
@@ -69,7 +69,7 @@ Type the `folders_rename` without any options to get the help which should be so
|
|
69
69
|
|
70
70
|
```
|
71
71
|
Usage:
|
72
|
-
folders_renamer
|
72
|
+
folders_renamer -b, --base-dir=BASE_DIR -s, --sep-string=SEP_STRING
|
73
73
|
|
74
74
|
Options:
|
75
75
|
-b, --base-dir=BASE_DIR # Starting directory
|
data/bin/folders_renamer
CHANGED
data/lib/folders_renamer/cli.rb
CHANGED
@@ -14,8 +14,8 @@ module FoldersRenamer
|
|
14
14
|
required: true
|
15
15
|
method_option :commit,
|
16
16
|
type: :boolean,
|
17
|
-
aliases:
|
18
|
-
desc:
|
17
|
+
aliases: "-c",
|
18
|
+
desc: "Commit your changes",
|
19
19
|
default: false
|
20
20
|
method_option "version",
|
21
21
|
aliases: "-v",
|
@@ -34,7 +34,7 @@ module FoldersRenamer
|
|
34
34
|
def usage
|
35
35
|
puts <<-EOS
|
36
36
|
Usage:
|
37
|
-
folders_renamer
|
37
|
+
folders_renamer -b, --base-dir=BASE_DIR -s, --sep-string=SEP_STRING
|
38
38
|
|
39
39
|
Options:
|
40
40
|
-b, --base-dir=BASE_DIR # Starting directory
|
@@ -16,10 +16,12 @@ module FoldersRenamer
|
|
16
16
|
find_depth_first(Pathname(base_dir)) do |path|
|
17
17
|
if path.directory?
|
18
18
|
new_path = path.dirname + Pathname(FilenameCleaner.sanitize(path.basename.to_s, sep_string))
|
19
|
-
|
19
|
+
if new_path != path && !File.exist?(new_path)
|
20
20
|
puts "FYI: rename from: #{path}"
|
21
21
|
puts "FYI: rename to : #{new_path}"
|
22
22
|
path.rename(new_path) if commit
|
23
|
+
else
|
24
|
+
puts "FYI: skip folder: #{path}"
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: folders_renamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
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-05-
|
11
|
+
date: 2014-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|