bulldoze_renamer 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +0 -1
- data/.github/workflows/ruby.yml +33 -0
- data/README.md +6 -0
- data/bulldoze_renamer.gemspec +1 -1
- data/lib/bulldoze_renamer/renaming_orchestrator.rb +6 -1
- data/lib/bulldoze_renamer/string_inflector.rb +8 -2
- data/lib/bulldoze_renamer/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd56e6546b5771be54c9a41463427b952fae24bc8c0f4d869f02e9e651eb93d4
|
4
|
+
data.tar.gz: 19b03a28a4f34422fcb60d52ec8dd800a202bf9e4c1c8f4d21586bee10f8e858
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74c048670ac8546fefade948fdbfe9bd633dc16ae6de8f9fc86b121a7b8cee553ea5482c37d2901afe554797dd3ee21530ad08cfaed4f69a4562f502d9525147
|
7
|
+
data.tar.gz: d94909dd3cd2c46f2c5b76c550e508c690a76b865c9b637dd8bfc00f0015475b6c6435928d5284e54dad072dd251100c4fad5e7d33ff7ca58391be17ac76dc58
|
data/.github/FUNDING.yml
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ main ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ main ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
25
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
26
|
+
# uses: ruby/setup-ruby@v1
|
27
|
+
uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
|
28
|
+
with:
|
29
|
+
ruby-version: 2.6
|
30
|
+
- name: Install dependencies
|
31
|
+
run: bundle install
|
32
|
+
- name: Run tests
|
33
|
+
run: bundle exec rake
|
data/README.md
CHANGED
@@ -12,6 +12,12 @@ and so that file should be renamed `lib/bears/pooh_bear -> lib/bears/honey_bear`
|
|
12
12
|
|
13
13
|
This tool aims to do all those replacements for you in the entire project in one go.
|
14
14
|
|
15
|
+
## Dependencies
|
16
|
+
|
17
|
+
libmagic is a dependency that should be available for your OS. E.g. using brew on OSX:
|
18
|
+
|
19
|
+
$ brew install libmagic
|
20
|
+
|
15
21
|
## Installation
|
16
22
|
|
17
23
|
Install by installing the gem:
|
data/bulldoze_renamer.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.authors = ["Tom ten Thij"]
|
7
7
|
spec.email = ["code@tomtenthij.nl"]
|
8
8
|
|
9
|
-
spec.summary = %q{A
|
9
|
+
spec.summary = %q{A command line tool to bulk rename classes and variables in ruby projects}
|
10
10
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
11
11
|
|
12
12
|
# Specify which files should be added to the gem when it is released.
|
@@ -171,7 +171,12 @@ module BulldozeRenamer
|
|
171
171
|
end
|
172
172
|
|
173
173
|
def self.rename_with_options(options, out:, err:)
|
174
|
-
orch = RenamingOrchestrator.new(
|
174
|
+
orch = RenamingOrchestrator.new(
|
175
|
+
current_name: options[:current_name],
|
176
|
+
target_name: options[:target_name],
|
177
|
+
path: options[:path],
|
178
|
+
perform: options[:perform]
|
179
|
+
)
|
175
180
|
out.puts orch.report_inflections_mapping
|
176
181
|
|
177
182
|
if orch.files_that_have_occurences.empty?
|
@@ -8,11 +8,11 @@ module BulldozeRenamer
|
|
8
8
|
extend Forwardable
|
9
9
|
|
10
10
|
def self.active_support_inflections
|
11
|
-
[:underscore
|
11
|
+
[:underscore]
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.inflections
|
15
|
-
active_support_inflections + [:dasherize, :upcase, :js_camelize]
|
15
|
+
active_support_inflections + [:camelize, :dasherize, :upcase, :js_camelize]
|
16
16
|
end
|
17
17
|
|
18
18
|
def_delegators ActiveSupport::Inflector, *StringInflector.active_support_inflections
|
@@ -26,7 +26,13 @@ module BulldozeRenamer
|
|
26
26
|
underscore(w).upcase
|
27
27
|
end
|
28
28
|
|
29
|
+
def camelize(w)
|
30
|
+
# Wrapping AR camelize because it would return 'dr-who' as 'Dr-who', we want 'DrWho'
|
31
|
+
ActiveSupport::Inflector.camelize(underscore(w))
|
32
|
+
end
|
33
|
+
|
29
34
|
def dasherize(w)
|
35
|
+
# Wrapping AR dasherize because it would return 'DrWho' as 'DrWho', we want 'dr-who'
|
30
36
|
ActiveSupport::Inflector.dasherize(underscore(w))
|
31
37
|
end
|
32
38
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bulldoze_renamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom ten Thij
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -47,6 +47,7 @@ extensions: []
|
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
49
|
- ".github/FUNDING.yml"
|
50
|
+
- ".github/workflows/ruby.yml"
|
50
51
|
- ".gitignore"
|
51
52
|
- ".rspec"
|
52
53
|
- ".travis.yml"
|
@@ -83,8 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
84
|
- !ruby/object:Gem::Version
|
84
85
|
version: '0'
|
85
86
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
87
|
+
rubygems_version: 3.5.6
|
87
88
|
signing_key:
|
88
89
|
specification_version: 4
|
89
|
-
summary: A
|
90
|
+
summary: A command line tool to bulk rename classes and variables in ruby projects
|
90
91
|
test_files: []
|