Skip to content

Commit 02ae558

Browse files
committed
Bunch of updates
1 parent d34e78f commit 02ae558

File tree

16 files changed

+502
-496
lines changed

16 files changed

+502
-496
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
paths-ignore:
6-
- 'README.md'
6+
- "README.md"
77

88
jobs:
99
lint:
@@ -17,12 +17,12 @@ jobs:
1717
test:
1818
strategy:
1919
matrix:
20-
ruby: ["3.0", 3.1, 3.2, 3.3]
20+
ruby: [3.2, 3.3, 3.4]
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v4
2424
- uses: ruby/setup-ruby@v1
2525
with:
2626
bundler-cache: true
2727
ruby-version: ${{ matrix.ruby }}
28-
- run: bundle exec rake test
28+
- run: bundle exec rspec

.rspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--require spec_helper
2+
--format=progress

.rubocop.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
require:
2-
- rubocop-minitest
1+
plugins:
2+
- rubocop-performance
33
- rubocop-rake
4+
- rubocop-rspec
45

56
AllCops:
67
NewCops: enable
7-
TargetRubyVersion: 3.0
8+
TargetRubyVersion: 3.2
89
Layout/LineLength:
910
Max: 120
1011
Metrics/BlockLength:
1112
Exclude:
12-
- "test/**/*"
13+
- "spec/**/*"
1314
Metrics/ClassLength:
1415
Exclude:
15-
- "test/**/*"
16+
- "spec/**/*"
1617
Metrics/MethodLength:
1718
Exclude:
18-
- "test/**/*"
19+
- "spec/**/*"
20+
RSpec/MultipleExpectations:
21+
Max: 2
1922
Style/Documentation:
2023
Enabled: false
2124
Style/StringLiterals:

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.1
1+
3.4.5

Gemfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ gemspec
66

77
group :development do
88
gem "byebug", "~> 11.1"
9-
gem "minitest", "~> 5.25"
10-
gem "minitest-fail-fast", "~> 0.1"
11-
gem "minitest-macos-notification", "~> 2.0"
12-
gem "minitest-reporters", "~> 1.7"
139
gem "rake", "~> 13.2"
14-
gem "rubocop", "~> 1.73"
15-
gem "rubocop-minitest", "~> 0.37"
10+
gem "rspec", "~> 3.13"
11+
gem "rubocop", "~> 1.74"
12+
gem "rubocop-performance", "~> 1.25"
1613
gem "rubocop-rake", "~> 0.7"
14+
gem "rubocop-rspec", "~> 3.6"
15+
gem "simplecov", "~> 0.22", require: false
1716
end

Gemfile.lock

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,67 @@ PATH
66
GEM
77
remote: https://rubygems.org/
88
specs:
9-
ansi (1.5.0)
10-
ast (2.4.2)
11-
builder (3.3.0)
9+
ast (2.4.3)
1210
byebug (11.1.3)
13-
json (2.10.2)
14-
language_server-protocol (3.17.0.4)
11+
diff-lcs (1.6.2)
12+
docile (1.4.1)
13+
json (2.13.2)
14+
language_server-protocol (3.17.0.5)
1515
lint_roller (1.1.0)
16-
minitest (5.25.5)
17-
minitest-fail-fast (0.1.0)
18-
minitest (~> 5)
19-
minitest-macos-notification (2.0.0)
20-
minitest (~> 5.14)
21-
minitest-reporters (~> 1.4)
22-
os (~> 1.0)
23-
terminal-notifier (~> 2.0)
24-
minitest-reporters (1.7.1)
25-
ansi
26-
builder
27-
minitest (>= 5.0)
28-
ruby-progressbar
29-
os (1.1.4)
30-
parallel (1.26.3)
31-
parser (3.3.7.1)
16+
parallel (1.27.0)
17+
parser (3.3.9.0)
3218
ast (~> 2.4.1)
3319
racc
20+
prism (1.4.0)
3421
racc (1.8.1)
3522
rainbow (3.1.1)
36-
rake (13.2.1)
37-
regexp_parser (2.10.0)
38-
rubocop (1.73.2)
23+
rake (13.3.0)
24+
regexp_parser (2.11.2)
25+
rspec (3.13.1)
26+
rspec-core (~> 3.13.0)
27+
rspec-expectations (~> 3.13.0)
28+
rspec-mocks (~> 3.13.0)
29+
rspec-core (3.13.5)
30+
rspec-support (~> 3.13.0)
31+
rspec-expectations (3.13.5)
32+
diff-lcs (>= 1.2.0, < 2.0)
33+
rspec-support (~> 3.13.0)
34+
rspec-mocks (3.13.5)
35+
diff-lcs (>= 1.2.0, < 2.0)
36+
rspec-support (~> 3.13.0)
37+
rspec-support (3.13.4)
38+
rubocop (1.79.2)
3939
json (~> 2.3)
4040
language_server-protocol (~> 3.17.0.2)
4141
lint_roller (~> 1.1.0)
4242
parallel (~> 1.10)
4343
parser (>= 3.3.0.2)
4444
rainbow (>= 2.2.2, < 4.0)
4545
regexp_parser (>= 2.9.3, < 3.0)
46-
rubocop-ast (>= 1.38.0, < 2.0)
46+
rubocop-ast (>= 1.46.0, < 2.0)
4747
ruby-progressbar (~> 1.7)
4848
unicode-display_width (>= 2.4.0, < 4.0)
49-
rubocop-ast (1.38.1)
50-
parser (>= 3.3.1.0)
51-
rubocop-minitest (0.37.1)
49+
rubocop-ast (1.46.0)
50+
parser (>= 3.3.7.2)
51+
prism (~> 1.4)
52+
rubocop-performance (1.25.0)
5253
lint_roller (~> 1.1)
53-
rubocop (>= 1.72.1, < 2.0)
54+
rubocop (>= 1.75.0, < 2.0)
5455
rubocop-ast (>= 1.38.0, < 2.0)
5556
rubocop-rake (0.7.1)
5657
lint_roller (~> 1.1)
5758
rubocop (>= 1.72.1)
59+
rubocop-rspec (3.6.0)
60+
lint_roller (~> 1.1)
61+
rubocop (~> 1.72, >= 1.72.1)
5862
ruby-progressbar (1.13.0)
59-
terminal-notifier (2.0.0)
60-
unicode-display_width (3.1.4)
63+
simplecov (0.22.0)
64+
docile (~> 1.1)
65+
simplecov-html (~> 0.11)
66+
simplecov_json_formatter (~> 0.1)
67+
simplecov-html (0.13.2)
68+
simplecov_json_formatter (0.1.4)
69+
unicode-display_width (3.1.5)
6170
unicode-emoji (~> 4.0, >= 4.0.4)
6271
unicode-emoji (4.0.4)
6372

@@ -66,15 +75,14 @@ PLATFORMS
6675

6776
DEPENDENCIES
6877
byebug (~> 11.1)
69-
minitest (~> 5.25)
70-
minitest-fail-fast (~> 0.1)
71-
minitest-macos-notification (~> 2.0)
72-
minitest-reporters (~> 1.7)
7378
plissken!
7479
rake (~> 13.2)
75-
rubocop (~> 1.73)
76-
rubocop-minitest (~> 0.37)
80+
rspec (~> 3.13)
81+
rubocop (~> 1.74)
82+
rubocop-performance (~> 1.25)
7783
rubocop-rake (~> 0.7)
84+
rubocop-rspec (~> 3.6)
85+
simplecov (~> 0.22)
7886

7987
BUNDLED WITH
8088
2.4.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Plissken works on either string keys or symbolized keys. It has no dependencies,
5757
# Going the other way
5858

5959
If you've already got `snake_case` and need to `CamelCase` it, you are encouraged to try
60-
the [Awrence](http://github.com/futurechimp/awrence) gem.
60+
the [Awrence](http://github.com/technicalpanda/awrence) gem.
6161

6262
## Contributing
6363

Rakefile

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
11
# frozen_string_literal: true
22

3-
begin
4-
require "bundler/setup"
5-
rescue LoadError
6-
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
7-
end
8-
9-
require "rdoc/task"
10-
11-
RDoc::Task.new(:rdoc) do |rdoc|
12-
rdoc.rdoc_dir = "rdoc"
13-
rdoc.title = "Plissken"
14-
rdoc.options << "--line-numbers"
15-
rdoc.rdoc_files.include("README.md")
16-
rdoc.rdoc_files.include("lib/**/*.rb")
17-
end
18-
193
require "bundler/gem_tasks"
4+
require "rspec/core/rake_task"
205

21-
require "rake/testtask"
22-
23-
Rake::TestTask.new(:test) do |t|
24-
t.libs << "lib"
25-
t.libs << "test"
26-
t.pattern = "test/**/*_test.rb"
27-
t.verbose = false
6+
RSpec::Core::RakeTask.new(:spec) do |t|
7+
t.pattern = Dir.glob("spec/**/*_spec.rb")
288
end
299

30-
task default: :test
10+
task default: :spec

lib/plissken/methods.rb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,11 @@ def underscore_key(key)
3535
end
3636

3737
def underscore(string)
38-
@__memoize_underscore ||= {}
39-
40-
return @__memoize_underscore[string] if @__memoize_underscore[string]
41-
42-
@__memoize_underscore[string] =
43-
string.tr("::", "/")
44-
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
45-
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
46-
.tr("-", "_")
47-
.downcase
48-
@__memoize_underscore[string]
38+
string.tr("::", "/")
39+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
40+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
41+
.tr("-", "_")
42+
.downcase
4943
end
5044
end
5145
end

plissken.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
1414
spec.homepage = "https://github.com/technicalpanda/plissken"
1515
spec.metadata["rubygems_mfa_required"] = "true"
1616
spec.name = "plissken"
17-
spec.required_ruby_version = ">= 3.0"
17+
spec.required_ruby_version = ">= 3.2"
1818
spec.summary = "Snakify your camel keys when working with JSON APIs"
1919
spec.version = Plissken::VERSION
2020
spec.license = "MIT"

0 commit comments

Comments
 (0)