renamr 1.0.10 → 1.0.13
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/.github/dependabot.yml +13 -0
- data/.github/workflows/rubocop.yml +34 -0
- data/.github/workflows/test.yml +20 -0
- data/.gitignore +7 -0
- data/.travis.yml +14 -0
- data/Gemfile +11 -11
- data/LICENSE +3 -10
- data/LICENSES/0BSD.txt +5 -0
- data/README.adoc +94 -0
- data/REUSE.toml +11 -0
- data/Rakefile +2 -1
- data/bin/renamr +3 -3
- data/lib/renamr/action.rb +2 -1
- data/lib/renamr/ascii_validator.rb +2 -1
- data/lib/renamr/auto_localization.rb +3 -1
- data/lib/renamr/char.rb +2 -1
- data/lib/renamr/configurator.rb +24 -4
- data/lib/renamr/date.rb +2 -1
- data/lib/renamr/downcase.rb +2 -1
- data/lib/renamr/factory.rb +3 -2
- data/lib/renamr/manual_localization.rb +2 -1
- data/lib/renamr/omit.rb +3 -1
- data/lib/renamr/point.rb +4 -2
- data/lib/renamr/prepend.rb +8 -5
- data/lib/renamr/prepend_date.rb +3 -1
- data/lib/renamr/remove.rb +5 -3
- data/lib/renamr/renamer.rb +3 -2
- data/lib/renamr/reporter.rb +5 -2
- data/lib/renamr/rutoen.rb +2 -1
- data/lib/renamr/substitute.rb +3 -1
- data/lib/renamr/trim.rb +2 -1
- data/lib/renamr/truncate.rb +3 -1
- data/lib/renamr/utils.rb +5 -7
- data/lib/renamr/version.rb +4 -3
- data/lib/renamr.rb +2 -1
- data/renamr.gemspec +11 -15
- data/test/test_char.rb +19 -0
- data/test/test_date.rb +32 -0
- data/test/test_trim.rb +22 -0
- metadata +21 -130
- data/README.md +0 -66
- data/appveyor.yml +0 -26
- data/renamr-1.0.6.gem +0 -0
- data/renamr-1.0.7.gem +0 -0
- data/renamr-1.0.8.gem +0 -0
- data/renamr-1.0.9.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f657e80309f9cc61d62888976e8b02c2fa3b6990b93419d212f4d9e5c037f4e9
|
4
|
+
data.tar.gz: 2818d9489523bc8319a60cf5d7a564161a09e37361843c1ad026afa672ce6b6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29f4e5281074587a662ed8ab26a0755c655522b77984b7b58ee57d363709f9755fb7f00baa78ecbad9f387dabee7078e3585e27482e38eab5ae0055051f1151e
|
7
|
+
data.tar.gz: f75da05cc1aac4028b2895f8cb6e75539d199b3b7e22509a0228324df0efb631585fba7a9780f3f507dcc2c509aa20b0cd3f4aee990989f0532f3ef761f9f014
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# SPDX-FileCopyrightText: 2023-2025 David Rabkin
|
2
|
+
# SPDX-License-Identifier: 0BSD
|
3
|
+
---
|
4
|
+
version: 2
|
5
|
+
updates:
|
6
|
+
- package-ecosystem: github-actions
|
7
|
+
directory: /
|
8
|
+
schedule:
|
9
|
+
interval: daily
|
10
|
+
- package-ecosystem: bundler
|
11
|
+
directory: /
|
12
|
+
schedule:
|
13
|
+
interval: daily
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# SPDX-FileCopyrightText: 2023-2025 David Rabkin
|
2
|
+
# SPDX-License-Identifier: 0BSD
|
3
|
+
---
|
4
|
+
name: rubocop
|
5
|
+
'on':
|
6
|
+
pull_request:
|
7
|
+
branches: [master]
|
8
|
+
jobs:
|
9
|
+
rubocop:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
strategy:
|
12
|
+
fail-fast: false
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v4
|
15
|
+
- uses: ruby/setup-ruby@472790540115ce5bd69d399a020189a8c87d641f
|
16
|
+
with:
|
17
|
+
ruby-version: 3.0
|
18
|
+
- name: Install Code Scanning integration
|
19
|
+
run: bundle add code-scanning-rubocop --version 0.6.1 --skip-install
|
20
|
+
- name: Install dependencies
|
21
|
+
run: bundle install
|
22
|
+
- name: Rubocop run
|
23
|
+
run: |
|
24
|
+
bash -c "
|
25
|
+
bundle exec rubocop \
|
26
|
+
--require code_scanning \
|
27
|
+
--format CodeScanning::SarifFormatter \
|
28
|
+
-o rubocop.sarif
|
29
|
+
[[ $? -ne 2 ]]
|
30
|
+
"
|
31
|
+
- name: Upload Sarif output
|
32
|
+
uses: github/codeql-action/upload-sarif@v3
|
33
|
+
with:
|
34
|
+
sarif_file: rubocop.sarif
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# SPDX-FileCopyrightText: 2023-2025 David Rabkin
|
2
|
+
# SPDX-License-Identifier: 0BSD
|
3
|
+
---
|
4
|
+
name: test
|
5
|
+
'on': push
|
6
|
+
jobs:
|
7
|
+
lint:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v4
|
11
|
+
- uses: docker://github/super-linter:v2.1.1
|
12
|
+
env:
|
13
|
+
VALIDATE_ALL_CODEBASE: true
|
14
|
+
VALIDATE_ANSIBLE: false
|
15
|
+
- uses: fsfe/reuse-action@v5
|
16
|
+
- uses: crate-ci/typos@master
|
17
|
+
- uses: ibiqlik/action-yamllint@v3
|
18
|
+
with:
|
19
|
+
file_or_dir: .github/*.yml .github/workflows/*.yml
|
20
|
+
strict: true
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2020-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
source 'https://rubygems.org'
|
7
|
-
|
8
|
-
|
9
|
-
gem '
|
10
|
-
gem '
|
11
|
-
gem '
|
12
|
-
gem '
|
13
|
-
gem '
|
14
|
-
gem '
|
15
|
-
gem '
|
16
|
-
gem 'terminal-table', '1.8.0'
|
8
|
+
gem 'date'
|
9
|
+
gem 'ellipsized'
|
10
|
+
gem 'fileutils'
|
11
|
+
gem 'i18n'
|
12
|
+
gem 'minitest'
|
13
|
+
gem 'pidfile'
|
14
|
+
gem 'rake'
|
15
|
+
gem 'rubocop'
|
16
|
+
gem 'terminal-table'
|
data/LICENSE
CHANGED
@@ -1,12 +1,5 @@
|
|
1
|
-
Copyright 2020
|
1
|
+
Copyright 2020-2025 David Rabkin
|
2
2
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
4
|
-
purpose with or without fee is hereby granted.
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
5
4
|
|
6
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
7
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
8
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
9
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
10
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
11
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
12
|
-
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
5
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
data/LICENSES/0BSD.txt
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
Copyright 2020-2025 David Rabkin
|
2
|
+
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
4
|
+
|
5
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
data/README.adoc
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
// Settings:
|
2
|
+
:toc: macro
|
3
|
+
:!toc-title:
|
4
|
+
// URLs:
|
5
|
+
:img-gem: https://badge.fury.io/rb/renamr.svg
|
6
|
+
:img-hoc: https://hitsofcode.com/github/rdavid/renamr?branch=master&label=hits%20of%20code
|
7
|
+
:img-license: https://img.shields.io/github/license/rdavid/renamr?color=blue&labelColor=gray&logo=freebsd&logoColor=lightgray&style=flat
|
8
|
+
:img-maintainability: https://api.codeclimate.com/v1/badges/406f1433b0b9e0509a6e/maintainability
|
9
|
+
:img-rubocop: https://github.com/rdavid/renamr/actions/workflows/rubocop.yml/badge.svg
|
10
|
+
:img-style: https://img.shields.io/badge/code_style-rubocop-brightgreen.svg
|
11
|
+
:img-test: https://github.com/rdavid/renamr/actions/workflows/test.yml/badge.svg
|
12
|
+
:url-cv: http://cv.rabkin.co.il
|
13
|
+
:url-gem: https://badge.fury.io/rb/renamr
|
14
|
+
:url-hoc: https://hitsofcode.com/view/github/rdavid/renamr?branch=master
|
15
|
+
:url-license: https://github.com/rdavid/renamr/blob/master/LICENSES/0BSD.txt
|
16
|
+
:url-maintainability: https://codeclimate.com/github/rdavid/renamr/maintainability
|
17
|
+
:url-reuse: https://github.com/fsfe/reuse-action
|
18
|
+
:url-rubocop: https://github.com/rdavid/renamr/actions/workflows/rubocop.yml
|
19
|
+
:url-ruby: https://www.ruby-lang.org/en/documentation/installation
|
20
|
+
:url-style: https://github.com/rubocop/rubocop
|
21
|
+
:url-test: https://github.com/rdavid/renamr/actions/workflows/test.yml
|
22
|
+
:url-vale: https://vale.sh
|
23
|
+
:url-yamllint: https://github.com/adrienverge/yamllint
|
24
|
+
|
25
|
+
= Renamr
|
26
|
+
|
27
|
+
image:{img-rubocop}[rubocop,link={url-rubocop}]
|
28
|
+
image:{img-gem}[gem version,link={url-gem}]
|
29
|
+
// image:{img-maintainability}[maintainability,link={url-maintainability}]
|
30
|
+
image:{img-style}[code style,link={url-style}]
|
31
|
+
image:{img-test}[test,link={url-test}]
|
32
|
+
image:{img-hoc}[hits of code,link={url-hoc}]
|
33
|
+
image:{img-license}[license,link={url-license}]
|
34
|
+
|
35
|
+
toc::[]
|
36
|
+
|
37
|
+
== About
|
38
|
+
|
39
|
+
`renamr` organizes file and directory names.
|
40
|
+
|
41
|
+
== Installation
|
42
|
+
The tool is designed to operate on macOS, GNU/Linux, Windows, and Unix-like
|
43
|
+
operating systems.
|
44
|
+
It is packaged as a Gem and requires Ruby version 3.0 or later.
|
45
|
+
If you do not have the appropriate version on your platform, refer to
|
46
|
+
{url-ruby}[Installing Ruby].
|
47
|
+
|
48
|
+
Utilize this command for installing the package:
|
49
|
+
|
50
|
+
[,sh]
|
51
|
+
----
|
52
|
+
gem install renamr
|
53
|
+
----
|
54
|
+
|
55
|
+
== Updating
|
56
|
+
|
57
|
+
Utilize this command for updating the package:
|
58
|
+
|
59
|
+
[,sh]
|
60
|
+
----
|
61
|
+
gem update renamr
|
62
|
+
----
|
63
|
+
|
64
|
+
== Usage
|
65
|
+
|
66
|
+
[,sh]
|
67
|
+
----
|
68
|
+
renamr [options]
|
69
|
+
-a, --act Real renaming.
|
70
|
+
-r, --rec Passes recursively.
|
71
|
+
-l, --lim Limits name length.
|
72
|
+
-m, --mod Prepends modification time.
|
73
|
+
-d, --dir dir Directory to rename.
|
74
|
+
-s, --src src A string to substitute.
|
75
|
+
-t, --dst dst A string to replace to.
|
76
|
+
-w, --wid wid Width of the table.
|
77
|
+
-p, --pre str,beg A string to prepend to started from beg.
|
78
|
+
-c, --cut pos,len Removes len symbols from pos.
|
79
|
+
-v, --version Shows version.
|
80
|
+
----
|
81
|
+
|
82
|
+
== Example
|
83
|
+
|
84
|
+
[,sh]
|
85
|
+
----
|
86
|
+
renamr -d <source>
|
87
|
+
----
|
88
|
+
|
89
|
+
It renames all files in `source` by default pattern: 26 English letters, 10 numbers, minus for spaces and other symbols.
|
90
|
+
|
91
|
+
== License
|
92
|
+
|
93
|
+
`renamr` is copyright {url-cv}[David Rabkin] and available under a
|
94
|
+
{url-license}[Zero-Clause BSD license].
|
data/REUSE.toml
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 David Rabkin
|
2
|
+
# SPDX-License-Identifier: 0BSD
|
3
|
+
version = 1
|
4
|
+
[[annotations]]
|
5
|
+
path = [
|
6
|
+
".gitignore",
|
7
|
+
"README.adoc",
|
8
|
+
]
|
9
|
+
precedence = "override"
|
10
|
+
SPDX-FileCopyrightText = "2025 David Rabkin"
|
11
|
+
SPDX-License-Identifier = "0BSD"
|
data/Rakefile
CHANGED
data/bin/renamr
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
5
|
-
#
|
5
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
6
|
+
# SPDX-License-Identifier: 0BSD
|
7
|
+
#
|
6
8
|
# This script renames files in given directory by specific rules.
|
7
9
|
|
8
|
-
require 'pidfile'
|
9
10
|
require_relative '../lib/renamr'
|
10
11
|
|
11
|
-
PidFile.new
|
12
12
|
Renamr::Renamer.new.do
|
data/lib/renamr/action.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require 'i18n'
|
7
8
|
require_relative 'action'
|
@@ -10,6 +11,7 @@ module Renamr
|
|
10
11
|
# Automatic localization.
|
11
12
|
class AutoLocalizationAction < Action
|
12
13
|
def initialize
|
14
|
+
super
|
13
15
|
I18n.config.available_locales = :en
|
14
16
|
end
|
15
17
|
|
data/lib/renamr/char.rb
CHANGED
data/lib/renamr/configurator.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require 'optparse'
|
7
8
|
|
@@ -16,21 +17,36 @@ module Renamr
|
|
16
17
|
['-d', '--dir dir', 'Directory to rename.', :dir],
|
17
18
|
['-s', '--src src', 'A string to substitute.', :src],
|
18
19
|
['-t', '--dst dst', 'A string to replace to.', :dst],
|
19
|
-
['-p', '--pre pre', 'A string to prepend to.', :pre],
|
20
20
|
['-w', '--wid wid', 'Width of the table.', :wid]
|
21
21
|
].freeze
|
22
22
|
|
23
|
-
def
|
23
|
+
def add_cut(opt)
|
24
24
|
opt.on('-c', '--cut pos,len', Array, 'Removes symbols from pos.') do |l|
|
25
25
|
@options[:pos] = l[0]
|
26
26
|
@options[:len] = l[1]
|
27
27
|
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def add_prepend(opt)
|
31
|
+
opt.on('-p', '--prepend str,beg', Array, 'Prepend a string.') do |l|
|
32
|
+
@options[:pre] = l[0]
|
33
|
+
@options[:beg] = l[1].nil? ? 0 : l[1].to_i
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def add_version(opt)
|
28
38
|
opt.on('-v', '--version', 'Show version.') do
|
29
39
|
puts "#{File.basename($PROGRAM_NAME)} #{VERSION} #{DATE}"
|
30
40
|
exit
|
31
41
|
end
|
32
42
|
end
|
33
43
|
|
44
|
+
def add(opt)
|
45
|
+
add_cut(opt)
|
46
|
+
add_prepend(opt)
|
47
|
+
add_version(opt)
|
48
|
+
end
|
49
|
+
|
34
50
|
def initialize
|
35
51
|
@options = {}
|
36
52
|
OptionParser.new do |o|
|
@@ -49,7 +65,7 @@ module Renamr
|
|
49
65
|
|
50
66
|
@options[:dir] = File.expand_path(dir)
|
51
67
|
end
|
52
|
-
raise "Width of the table should
|
68
|
+
raise "Width of the table should exceeds 14 symbols: #{wid}." if wid < 15
|
53
69
|
end
|
54
70
|
|
55
71
|
def act?
|
@@ -84,6 +100,10 @@ module Renamr
|
|
84
100
|
@options[:pre]
|
85
101
|
end
|
86
102
|
|
103
|
+
def beg
|
104
|
+
@options[:beg]
|
105
|
+
end
|
106
|
+
|
87
107
|
def pos
|
88
108
|
@options[:pos]
|
89
109
|
end
|
data/lib/renamr/date.rb
CHANGED
data/lib/renamr/downcase.rb
CHANGED
data/lib/renamr/factory.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require_relative 'ascii_validator'
|
7
8
|
require_relative 'auto_localization'
|
@@ -45,7 +46,7 @@ module Renamr
|
|
45
46
|
RuToEnAction.new,
|
46
47
|
AutoLocalizationAction.new,
|
47
48
|
@cfg.mod? ? PrependDateAction.new(dir) : nil,
|
48
|
-
@cfg.pre.nil? ? nil : PrependAction.new(@cfg.pre),
|
49
|
+
@cfg.pre.nil? ? nil : PrependAction.new(@cfg.beg, @cfg.pre),
|
49
50
|
ASCIIValidatorAction.new,
|
50
51
|
TrimAction.new,
|
51
52
|
TruncateAction.new(LIMIT),
|
data/lib/renamr/omit.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require_relative 'action'
|
7
8
|
|
@@ -9,6 +10,7 @@ module Renamr
|
|
9
10
|
# Omits file names shorter than limit.
|
10
11
|
class OmitAction < Action
|
11
12
|
def initialize(lim)
|
13
|
+
super
|
12
14
|
raise 'lim cannot be nil.' if lim.nil?
|
13
15
|
|
14
16
|
@lim = lim
|
data/lib/renamr/point.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require_relative 'action'
|
7
8
|
|
8
9
|
module Renamr
|
9
|
-
# All points besides
|
10
|
+
# All points besides extension are replaced by minus.
|
10
11
|
class PointAction < Action
|
11
12
|
def initialize(dir)
|
13
|
+
super()
|
12
14
|
raise 'dir cannot be nil.' if dir.nil?
|
13
15
|
|
14
16
|
@dir = dir
|
data/lib/renamr/prepend.rb
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require_relative 'action'
|
7
8
|
|
8
9
|
module Renamr
|
9
10
|
# Prepends user patter.
|
10
11
|
class PrependAction < Action
|
11
|
-
def initialize(
|
12
|
-
raise '
|
12
|
+
def initialize(beg, pre) # rubocop:disable Lint/MissingSuper
|
13
|
+
raise 'beg cannot be nil.' if beg.nil?
|
14
|
+
raise 'ins cannot be nil.' if pre.nil?
|
13
15
|
|
14
|
-
@
|
16
|
+
@beg = beg
|
17
|
+
@pre = pre
|
15
18
|
end
|
16
19
|
|
17
20
|
def do(src)
|
18
|
-
src.
|
21
|
+
src.insert(@beg, @pre)
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|
data/lib/renamr/prepend_date.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require_relative 'action'
|
7
8
|
|
@@ -9,6 +10,7 @@ module Renamr
|
|
9
10
|
# Prepends file modification datestamp.
|
10
11
|
class PrependDateAction < Action
|
11
12
|
def initialize(dir)
|
13
|
+
super
|
12
14
|
@dir = dir
|
13
15
|
end
|
14
16
|
|
data/lib/renamr/remove.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require_relative 'action'
|
7
8
|
|
@@ -9,6 +10,7 @@ module Renamr
|
|
9
10
|
# Removes symbols between left and right positions.
|
10
11
|
class RemoveAction < Action
|
11
12
|
def initialize(pos, len)
|
13
|
+
super
|
12
14
|
raise 'len cannot bi nil.' if len.nil?
|
13
15
|
raise 'pos cannot be nil.' if pos.nil?
|
14
16
|
raise 'pos has to be positive.' unless pos.to_i.positive?
|
@@ -18,9 +20,9 @@ module Renamr
|
|
18
20
|
end
|
19
21
|
|
20
22
|
def do(src)
|
21
|
-
return src[@len
|
23
|
+
return src[@len..] if @pos == 1
|
22
24
|
|
23
|
-
src[0..@pos - 1] + src[@pos + @len
|
25
|
+
src[0..@pos - 1] + src[@pos + @len..]
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
data/lib/renamr/renamer.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require 'fileutils'
|
7
8
|
require_relative 'configurator'
|
@@ -37,7 +38,7 @@ module Renamr
|
|
37
38
|
|
38
39
|
def unique(dat, nme)
|
39
40
|
dst = []
|
40
|
-
dat.each { |_, d| dst << File.basename(d) }
|
41
|
+
dat.each { |_, d| dst << File.basename(d) } # rubocop:disable Style/HashEachMethods
|
41
42
|
return nme unless dst.include?(nme)
|
42
43
|
|
43
44
|
ext = File.extname(nme)
|
data/lib/renamr/reporter.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require 'terminal-table'
|
7
8
|
require_relative 'action'
|
@@ -9,6 +10,7 @@ require_relative 'utils'
|
|
9
10
|
|
10
11
|
module Renamr
|
11
12
|
# Formats and prints output data.
|
13
|
+
# rubocop:disable Style/ClassVars
|
12
14
|
class Reporter
|
13
15
|
@@tim = Timer.new
|
14
16
|
@@sta = { moved: 0, unaltered: 0, failed: 0 }
|
@@ -53,7 +55,7 @@ module Renamr
|
|
53
55
|
def self.stat_out
|
54
56
|
out = ''
|
55
57
|
@@sta.each do |k, v|
|
56
|
-
out +=
|
58
|
+
out += " #{v} #{k}," if v.positive?
|
57
59
|
end
|
58
60
|
out.chop
|
59
61
|
end
|
@@ -64,4 +66,5 @@ module Renamr
|
|
64
66
|
puts "| #{msg}#{' ' * (@@ttl - msg.length)} |\n+-#{'-' * @@ttl}-+"
|
65
67
|
end
|
66
68
|
end
|
69
|
+
# rubocop:enable Style/ClassVars
|
67
70
|
end
|
data/lib/renamr/rutoen.rb
CHANGED
data/lib/renamr/substitute.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require_relative 'action'
|
7
8
|
|
@@ -9,6 +10,7 @@ module Renamr
|
|
9
10
|
# Substitutes a string with a string.
|
10
11
|
class SubstituteAction < Action
|
11
12
|
def initialize(src, dst)
|
13
|
+
super
|
12
14
|
raise 'src cannot be nil.' if src.nil?
|
13
15
|
|
14
16
|
# The action works after PointAction. All points are replaces with minus.
|
data/lib/renamr/trim.rb
CHANGED
data/lib/renamr/truncate.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
require_relative 'action'
|
7
8
|
|
@@ -9,6 +10,7 @@ module Renamr
|
|
9
10
|
# Limits file length.
|
10
11
|
class TruncateAction < Action
|
11
12
|
def initialize(lim)
|
13
|
+
super()
|
12
14
|
raise 'lim cannot be nil.' if lim.nil?
|
13
15
|
|
14
16
|
@lim = lim
|
data/lib/renamr/utils.rb
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2018-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
6
|
+
|
7
|
+
require 'ellipsized'
|
5
8
|
|
6
9
|
# All methods are static.
|
7
10
|
class Utils
|
8
11
|
class << self
|
9
|
-
SEP = '~'
|
10
12
|
def trim(src, lim)
|
11
|
-
|
12
|
-
|
13
|
-
beg = fin = (lim - SEP.length) / 2
|
14
|
-
beg -= 1 if lim.odd?
|
15
|
-
src[0..beg] + SEP + src[-fin..-1]
|
13
|
+
src.ellipsized(lim, '~', :center)
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
data/lib/renamr/version.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
-
#
|
4
|
+
# SPDX-FileCopyrightText: 2020-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
5
6
|
|
6
7
|
module Renamr
|
7
|
-
VERSION = '1.0.
|
8
|
-
DATE = '
|
8
|
+
VERSION = '1.0.13'
|
9
|
+
DATE = '2025-07-21'
|
9
10
|
end
|
data/lib/renamr.rb
CHANGED
data/renamr.gemspec
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
# SPDX-FileCopyrightText: 2023-2025 David Rabkin
|
4
|
+
# SPDX-License-Identifier: 0BSD
|
5
|
+
|
6
|
+
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
|
4
7
|
|
5
8
|
require 'renamr'
|
6
9
|
|
7
10
|
Gem::Specification.new do |s|
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
12
|
+
s.required_ruby_version = '>=3.0'
|
8
13
|
s.name = 'renamr'
|
9
14
|
s.version = Renamr::VERSION
|
10
15
|
s.date = Renamr::DATE
|
11
|
-
s.
|
12
|
-
s.summary = 'File and directory names organiser.'
|
16
|
+
s.summary = 'File and directory names organiser'
|
13
17
|
s.description = <<-HERE
|
14
18
|
Renamr organises multiple files and directories.
|
15
19
|
HERE
|
@@ -17,16 +21,8 @@ Gem::Specification.new do |s|
|
|
17
21
|
s.author = 'David Rabkin'
|
18
22
|
s.email = 'david@rabkin.co.il'
|
19
23
|
s.homepage = 'https://github.com/rdavid/renamr'
|
20
|
-
s.files =
|
21
|
-
s.executables =
|
22
|
-
s.extra_rdoc_files = ['LICENSE', 'README.
|
23
|
-
s.
|
24
|
-
s.add_runtime_dependency 'date', '2.0.0'
|
25
|
-
s.add_runtime_dependency 'fileutils', '1.4.1'
|
26
|
-
s.add_runtime_dependency 'i18n', '1.8.3'
|
27
|
-
s.add_runtime_dependency 'pidfile', '0.3.0'
|
28
|
-
s.add_runtime_dependency 'terminal-table', '1.8.0'
|
29
|
-
s.add_development_dependency 'minitest', '6.11.3'
|
30
|
-
s.add_development_dependency 'rake', '13.0.1'
|
31
|
-
s.add_development_dependency 'rubocop', '0.85.1'
|
24
|
+
s.files = `git ls-files`.split($RS)
|
25
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
26
|
+
s.extra_rdoc_files = ['LICENSE', 'README.adoc']
|
27
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
32
28
|
end
|
data/test/test_char.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
+
# SPDX-FileCopyrightText: 2020-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
6
|
+
|
7
|
+
require 'minitest/autorun'
|
8
|
+
require_relative '../lib/renamr/char'
|
9
|
+
|
10
|
+
class TestChar < Minitest::Test
|
11
|
+
def setup
|
12
|
+
@act = Renamr::CharAction.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_act
|
16
|
+
assert_equal('-' * 32,
|
17
|
+
@act.do(' (){},~–\'![]_#@=„“”"`—+‘’;·‡«»%…'.dup))
|
18
|
+
end
|
19
|
+
end
|
data/test/test_date.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
+
# SPDX-FileCopyrightText: 2020-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
6
|
+
|
7
|
+
require 'minitest/autorun'
|
8
|
+
require_relative '../lib/renamr/date'
|
9
|
+
|
10
|
+
# Test DateAction class.
|
11
|
+
class TestChar < Minitest::Test
|
12
|
+
def setup
|
13
|
+
@act = Renamr::DateAction.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def good
|
17
|
+
assert_equal('1 20201031 bar', @act.do('1 31-10-2020 bar'.dup))
|
18
|
+
assert_equal('2 20201031 bar', @act.do('2 10-31-2020 bar'.dup))
|
19
|
+
assert_equal('3 20201031 bar', @act.do('3 2020-10-31 bar'.dup))
|
20
|
+
assert_equal('4 20201031 bar', @act.do('4 2020-31-10 bar'.dup))
|
21
|
+
end
|
22
|
+
|
23
|
+
def bad
|
24
|
+
assert_equal('5 2nd Nov 2020 bar', @act.do('5 2nd Nov 2020 bar'.dup))
|
25
|
+
assert_equal('6 1-1-1-1 bar', @act.do('6 1-1-1-1 bar'.dup))
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_act
|
29
|
+
good
|
30
|
+
bad
|
31
|
+
end
|
32
|
+
end
|
data/test/test_trim.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
4
|
+
# SPDX-FileCopyrightText: 2020-2025 David Rabkin
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
6
|
+
|
7
|
+
require 'minitest/autorun'
|
8
|
+
require_relative '../lib/renamr/trim'
|
9
|
+
|
10
|
+
class TestTrim < Minitest::Test
|
11
|
+
def setup
|
12
|
+
@act = Renamr::TrimAction.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_act
|
16
|
+
assert_equal('-', @act.do('-'.dup))
|
17
|
+
assert_equal('-', @act.do('--'.dup))
|
18
|
+
assert_equal('1', @act.do('1-'.dup))
|
19
|
+
assert_equal('1', @act.do('-1'.dup))
|
20
|
+
assert_equal('1-1', @act.do('-1--1-'.dup))
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,127 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: renamr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rabkin
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: date
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.0
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: fileutils
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.4.1
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.4.1
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: i18n
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.8.3
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 1.8.3
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: pidfile
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - '='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.3.0
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - '='
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.3.0
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: terminal-table
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - '='
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 1.8.0
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - '='
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 1.8.0
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: minitest
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 6.11.3
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 6.11.3
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rake
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - '='
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 13.0.1
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - '='
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 13.0.1
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - '='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 0.85.1
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - '='
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 0.85.1
|
10
|
+
date: 2025-07-21 00:00:00.000000000 Z
|
11
|
+
dependencies: []
|
125
12
|
description: " Renamr organises multiple files and directories.\n"
|
126
13
|
email: david@rabkin.co.il
|
127
14
|
executables:
|
@@ -129,13 +16,19 @@ executables:
|
|
129
16
|
extensions: []
|
130
17
|
extra_rdoc_files:
|
131
18
|
- LICENSE
|
132
|
-
- README.
|
19
|
+
- README.adoc
|
133
20
|
files:
|
21
|
+
- ".github/dependabot.yml"
|
22
|
+
- ".github/workflows/rubocop.yml"
|
23
|
+
- ".github/workflows/test.yml"
|
24
|
+
- ".gitignore"
|
25
|
+
- ".travis.yml"
|
134
26
|
- Gemfile
|
135
27
|
- LICENSE
|
136
|
-
-
|
28
|
+
- LICENSES/0BSD.txt
|
29
|
+
- README.adoc
|
30
|
+
- REUSE.toml
|
137
31
|
- Rakefile
|
138
|
-
- appveyor.yml
|
139
32
|
- bin/renamr
|
140
33
|
- lib/renamr.rb
|
141
34
|
- lib/renamr/action.rb
|
@@ -160,32 +53,30 @@ files:
|
|
160
53
|
- lib/renamr/truncate.rb
|
161
54
|
- lib/renamr/utils.rb
|
162
55
|
- lib/renamr/version.rb
|
163
|
-
- renamr-1.0.6.gem
|
164
|
-
- renamr-1.0.7.gem
|
165
|
-
- renamr-1.0.8.gem
|
166
|
-
- renamr-1.0.9.gem
|
167
56
|
- renamr.gemspec
|
57
|
+
- test/test_char.rb
|
58
|
+
- test/test_date.rb
|
59
|
+
- test/test_trim.rb
|
168
60
|
homepage: https://github.com/rdavid/renamr
|
169
61
|
licenses:
|
170
62
|
- 0BSD
|
171
|
-
metadata:
|
172
|
-
|
63
|
+
metadata:
|
64
|
+
rubygems_mfa_required: 'true'
|
173
65
|
rdoc_options: []
|
174
66
|
require_paths:
|
175
67
|
- lib
|
176
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
177
69
|
requirements:
|
178
|
-
- - "
|
70
|
+
- - ">="
|
179
71
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
72
|
+
version: '3.0'
|
181
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
74
|
requirements:
|
183
75
|
- - ">="
|
184
76
|
- !ruby/object:Gem::Version
|
185
77
|
version: '0'
|
186
78
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
188
|
-
signing_key:
|
79
|
+
rubygems_version: 3.6.9
|
189
80
|
specification_version: 4
|
190
|
-
summary: File and directory names organiser
|
81
|
+
summary: File and directory names organiser
|
191
82
|
test_files: []
|
data/README.md
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
# Renamr
|
2
|
-
File and directory names organizer.
|
3
|
-
|
4
|
-
[](https://travis-ci.org/rdavid/renamr)
|
6
|
-
[](https://ci.appveyor.com/project/rdavid/renamr)
|
8
|
-
[](https://badge.fury.io/rb/renamr)
|
10
|
-
[](https://codeclimate.com/github/rdavid/renamr/maintainability)
|
11
|
-
|
12
|
-
[](https://hitsofcode.com/view/github/rdavid/renamr)
|
13
|
-
[](https://github.com/rdavid/renamr/blob/master/LICENSE)
|
14
|
-
|
15
|
-
|
16
|
-
* [About](#about)
|
17
|
-
* [Installation](#installation)
|
18
|
-
* [Usage](#usage)
|
19
|
-
* [License](#license)
|
20
|
-
|
21
|
-
## About
|
22
|
-
Hi, I'm [David Rabkin](http://davi.drabk.in). I created this tool to
|
23
|
-
orginize multiple files.
|
24
|
-
|
25
|
-
## Installation
|
26
|
-
The tool is designed to work on macOS, GNU/Linux, Windows, Unix-like OS. It is
|
27
|
-
packaged as a Gem and require Ruby version 2.6 or later. See “[Installing
|
28
|
-
Ruby](https://www.ruby-lang.org/en/documentation/installation/)” if you don't
|
29
|
-
have the proper version on your platform.
|
30
|
-
|
31
|
-
Use this command to install:
|
32
|
-
|
33
|
-
gem install renamr
|
34
|
-
|
35
|
-
### Updating
|
36
|
-
Use this command to update the package:
|
37
|
-
|
38
|
-
gem update renamr
|
39
|
-
|
40
|
-
### Requirements
|
41
|
-
There are no requirements.
|
42
|
-
|
43
|
-
## Usage
|
44
|
-
renamr [options]
|
45
|
-
-a, --act Real renaming.
|
46
|
-
-r, --rec Passes recursively.
|
47
|
-
-l, --lim Limits name length.
|
48
|
-
-m, --mod Prepends modification time.
|
49
|
-
-d, --dir dir Directory to rename.
|
50
|
-
-s, --src src A string to substitute.
|
51
|
-
-t, --dst dst A string to replace to.
|
52
|
-
-p, --pre pre A string to prepend to.
|
53
|
-
-w, --wid wid Width of the table.
|
54
|
-
-c, --cut pos,len Removes symbols from pos.
|
55
|
-
-v, --version Shows version.
|
56
|
-
|
57
|
-
### Example
|
58
|
-
|
59
|
-
renamr -d <source>
|
60
|
-
|
61
|
-
It renames all files in `source` by default pattern: 26 English letters,
|
62
|
-
10 numbers, minus for spaces and other symbols.
|
63
|
-
|
64
|
-
## License
|
65
|
-
Renamr is copyright [David Rabkin](http://davi.drabk.in) and
|
66
|
-
available under a [Zero-Clause BSD license](https://github.com/rdavid/renamr/blob/master/LICENSE).
|
data/appveyor.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
---
|
2
|
-
version: '{build}'
|
3
|
-
skip_tags: true
|
4
|
-
clone_depth: 10
|
5
|
-
branches:
|
6
|
-
only:
|
7
|
-
- master
|
8
|
-
except:
|
9
|
-
- gh-pages
|
10
|
-
os: Windows Server 2012
|
11
|
-
environment:
|
12
|
-
matrix:
|
13
|
-
- ruby_version: "26-x64"
|
14
|
-
install:
|
15
|
-
- ps: |
|
16
|
-
$Env:PATH = "C:\Ruby${Env:ruby_version}\bin;${Env:PATH}"
|
17
|
-
- bundle config --local path vendor/bundle
|
18
|
-
- ruby -v
|
19
|
-
- bundle -v
|
20
|
-
build_script:
|
21
|
-
- bundle update
|
22
|
-
- bundle install
|
23
|
-
test_script:
|
24
|
-
- bundle exec rake --quiet
|
25
|
-
cache:
|
26
|
-
- vendor/bundle
|
data/renamr-1.0.6.gem
DELETED
Binary file
|
data/renamr-1.0.7.gem
DELETED
Binary file
|
data/renamr-1.0.8.gem
DELETED
Binary file
|
data/renamr-1.0.9.gem
DELETED
Binary file
|