rename_radically 0.3.3 → 0.3.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/bin/rnr +1 -0
- data/lib/rename_radically.rb +17 -9
- metadata +5 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb87602737bac17c55ed93e8813552009be9b663c79295079cfa42f41ce0e5e5
|
|
4
|
+
data.tar.gz: d73aea91fcf0f934ed4b6f60917a8227e8d56f90b513c58637c7f184e995fef9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b918b1db281a60d6c99b6a8937e3ee4bfc9446fdd6bbdb2bb04e62ebf71eb35038fc73a2a8b726ed70bcc394107a497f7d71ad98dd6687081c7a4d7c8f8081ee
|
|
7
|
+
data.tar.gz: 8b13b23053fc3f55a548651e1316c4054280009c62bb973a8427349dc087247b7312f26c84d5f93845e4024da7b10f6f10148b473544e08336a24088e0945e13
|
data/bin/rnr
CHANGED
data/lib/rename_radically.rb
CHANGED
|
@@ -11,7 +11,7 @@ compact:: renames a file to a CamelCase format, removing spaces and using
|
|
|
11
11
|
to lower case.
|
|
12
12
|
widen:: renames a file adding spaces to separate words in CamelCase format,
|
|
13
13
|
and, depending on the case, before or after punctation.
|
|
14
|
-
regex:: replaces all occurrences of the given regex with the given
|
|
14
|
+
regex:: replaces all occurrences of the given regex with the given
|
|
15
15
|
substitute string.
|
|
16
16
|
renaming script:: creates a bash script to rename files, for whenever the
|
|
17
17
|
other modalities cannot yield the desired result.
|
|
@@ -53,7 +53,7 @@ class ReNameRadically
|
|
|
53
53
|
as_spaces: %w[ _ ],
|
|
54
54
|
delimiters: %w[ - + ( ) [ ] { } ' & . ! ? ],
|
|
55
55
|
ex_after: %w[ ' ( - < \[ { . ],
|
|
56
|
-
ex_before: %w[ . , ? ! ' ) \] } > - _ ],
|
|
56
|
+
ex_before: %w[ : . , ? ! ' ) \] } > - _ ],
|
|
57
57
|
script: 'REN.sh'
|
|
58
58
|
)
|
|
59
59
|
@dry_run = dry_run
|
|
@@ -62,7 +62,7 @@ class ReNameRadically
|
|
|
62
62
|
@ex_after = ex_after
|
|
63
63
|
@ex_before = ex_before
|
|
64
64
|
@script = script
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
# Ensure any invalid values are not used:
|
|
67
67
|
@as_spaces = Array.new unless @as_spaces.is_a? Array
|
|
68
68
|
@delimiters = Array.new unless @delimiters.is_a? Array
|
|
@@ -110,12 +110,13 @@ class ReNameRadically
|
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
# If we just renamed a folder, rename everything within it as well:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
if file.directory? then
|
|
114
|
+
rename files: file.children,
|
|
115
|
+
modality: modality,
|
|
116
|
+
check_files: false,
|
|
117
|
+
r_pattern: r_pattern,
|
|
118
|
+
r_sub: r_sub
|
|
119
|
+
end
|
|
119
120
|
end
|
|
120
121
|
|
|
121
122
|
# Return what files gave an error:
|
|
@@ -305,6 +306,13 @@ class ReNameRadically
|
|
|
305
306
|
name += c
|
|
306
307
|
end
|
|
307
308
|
|
|
309
|
+
# Lazy way out #1: ensure 'S will turn into 's:
|
|
310
|
+
name.gsub!( /'S\b/, "'s" )
|
|
311
|
+
|
|
312
|
+
# Lazy way out #2: a counter at the file name start followed by - should
|
|
313
|
+
# always be widened:
|
|
314
|
+
name.sub!( /^((?:S\d+E)?\d+)-/, '\1 - ' )
|
|
315
|
+
|
|
308
316
|
# Return the composed name:
|
|
309
317
|
return name
|
|
310
318
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rename_radically
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maurizio Oliveri
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2026-12-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: A simple (and probably dirty) files mass-renamer.
|
|
14
13
|
email:
|
|
@@ -22,9 +21,8 @@ files:
|
|
|
22
21
|
- lib/rename_radically.rb
|
|
23
22
|
homepage: https://github.com/Soulsuke/ReNameR
|
|
24
23
|
licenses:
|
|
25
|
-
- GPL-3.0
|
|
24
|
+
- GPL-3.0-or-later
|
|
26
25
|
metadata: {}
|
|
27
|
-
post_install_message:
|
|
28
26
|
rdoc_options: []
|
|
29
27
|
require_paths:
|
|
30
28
|
- lib
|
|
@@ -32,15 +30,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
32
30
|
requirements:
|
|
33
31
|
- - ">="
|
|
34
32
|
- !ruby/object:Gem::Version
|
|
35
|
-
version:
|
|
33
|
+
version: 3.1.2
|
|
36
34
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
35
|
requirements:
|
|
38
36
|
- - ">="
|
|
39
37
|
- !ruby/object:Gem::Version
|
|
40
38
|
version: '0'
|
|
41
39
|
requirements: []
|
|
42
|
-
rubygems_version:
|
|
43
|
-
signing_key:
|
|
40
|
+
rubygems_version: 4.0.20
|
|
44
41
|
specification_version: 4
|
|
45
42
|
summary: ReNameRadically
|
|
46
43
|
test_files: []
|