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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rnr +1 -0
  3. data/lib/rename_radically.rb +17 -9
  4. metadata +5 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bc8dcc770e6a9e58d84bd85f9601ec33a4179e551f7ab30361abd6cc7b9e4b8
4
- data.tar.gz: 72b9daf2e94ad2a889a2c25bc2304867b5a9e9308ed44714275d9c22d4fb26de
3
+ metadata.gz: cb87602737bac17c55ed93e8813552009be9b663c79295079cfa42f41ce0e5e5
4
+ data.tar.gz: d73aea91fcf0f934ed4b6f60917a8227e8d56f90b513c58637c7f184e995fef9
5
5
  SHA512:
6
- metadata.gz: d53ee4b6baa9edc014069cad31cec4e6da06944df8e5d08523ba862ebfa3f92ab0eed25d67903c7abe38e31c1f85161035feb0ae329353153e6a6cea88566faf
7
- data.tar.gz: c7f272a9665672d7f2dfa682ee5d5d3c6b16508cba3f2a9bdd01da66f4c7b3b652b4b96418e39be7f815fbf8c1c2bbbc76d8962262ad3823edbe770b834165bf
6
+ metadata.gz: b918b1db281a60d6c99b6a8937e3ee4bfc9446fdd6bbdb2bb04e62ebf71eb35038fc73a2a8b726ed70bcc394107a497f7d71ad98dd6687081c7a4d7c8f8081ee
7
+ data.tar.gz: 8b13b23053fc3f55a548651e1316c4054280009c62bb973a8427349dc087247b7312f26c84d5f93845e4024da7b10f6f10148b473544e08336a24088e0945e13
data/bin/rnr CHANGED
@@ -82,6 +82,7 @@ unless config.exist? then
82
82
 
83
83
  # Characters before which must not be added a space in wide mode:
84
84
  :ex_before:
85
+ - ":"
85
86
  - "."
86
87
  - ","
87
88
  - "?"
@@ -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
- rename files: file.children,
114
- modality: modality,
115
- check_files: false,
116
- r_pattern: r_pattern,
117
- r_sub: r_sub \
118
- if file.directory?
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.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: 2022-05-06 00:00:00.000000000 Z
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: '0'
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: 3.3.7
43
- signing_key:
40
+ rubygems_version: 4.0.20
44
41
  specification_version: 4
45
42
  summary: ReNameRadically
46
43
  test_files: []