Skip to content

Commit

Permalink
Merge pull request #574 from kg8m/ruby3_4
Browse files Browse the repository at this point in the history
Support Ruby 3.4
  • Loading branch information
kg8m authored Dec 28, 2024
2 parents b090732 + 527e759 commit 0ebcf61
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 25 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
ruby-version:
- "3.2"
- "3.3"
- "3.4"
rails-version:
- "~> 7.0.0"
- "~> 7.1.0"
Expand Down Expand Up @@ -68,7 +69,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
ruby-version: "3.4"
bundler-cache: true

- name: RuboCop
Expand All @@ -86,7 +87,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
ruby-version: "3.4"
bundler-cache: true

- name: Prepare for typecheck
Expand All @@ -108,7 +109,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
ruby-version: "3.4"
bundler-cache: true

- name: Check YARD docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-autolabeling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
ruby-version: "3.4"
bundler-cache: true

- name: Generate token
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-rbs-collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
ruby-version: "3.4"
bundler-cache: true

- name: Generate token
Expand Down
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ else
gem "rails", ENV.fetch("RAILS_VERSION")
end

# For Ruby 3.4+
#
# warning: ... was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0.
#
# 'Kernel.require': cannot load such file -- ... (LoadError)
gem "base64"
gem "benchmark"
gem "bigdecimal"
gem "drb"
gem "mutex_m"

group :development, :test do
gem "sprockets-rails"

Expand Down
11 changes: 7 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ GEM
drb (2.2.1)
erubi (1.13.1)
ffi (1.17.0)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
fileutils (1.7.3)
globalid (1.2.1)
activesupport (>= 6.1)
Expand Down Expand Up @@ -126,6 +123,7 @@ GEM
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.25.4)
mutex_m (0.3.0)
net-imap (0.5.4)
date
net-protocol
Expand Down Expand Up @@ -315,7 +313,12 @@ PLATFORMS

DEPENDENCIES
addressable
base64
benchmark
bigdecimal
bump
drb
mutex_m
paint
puma
rails
Expand All @@ -337,4 +340,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.4.10
2.6.2
20 changes: 6 additions & 14 deletions rbs_collection.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ gems:
version: '0'
source:
type: stdlib
- name: dbm
version: '0'
source:
type: stdlib
- name: delegate
version: '0'
source:
Expand Down Expand Up @@ -210,9 +206,9 @@ gems:
source:
type: stdlib
- name: mutex_m
version: '0'
version: 0.3.0
source:
type: stdlib
type: rubygems
- name: net-protocol
version: '0'
source:
Expand All @@ -237,14 +233,6 @@ gems:
version: '0'
source:
type: stdlib
- name: pstore
version: '0'
source:
type: stdlib
- name: psych
version: '0'
source:
type: stdlib
- name: rack
version: '2.2'
source:
Expand Down Expand Up @@ -309,6 +297,10 @@ gems:
revision: ccbd2bbc6be5c195df1d90aa68d64916a9e7d0ab
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: stringio
version: '0'
source:
type: stdlib
- name: tempfile
version: '0'
source:
Expand Down
8 changes: 6 additions & 2 deletions spec/models/tanshuku/url_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1142,17 +1142,21 @@

context "and url_options isn’t given" do
it "raises NoMethodError due to `nil.merge`" do
expect { tanshuku_url.shortened_url }.to raise_error(NoMethodError, /\bundefined method `merge' for nil\b/)
# Error message with Ruby 3.3 or older: undefined method `merge' for nil
# Error message with Ruby 3.4 or newer: undefined method 'merge' for nil
expect { tanshuku_url.shortened_url }.to raise_error(NoMethodError, /\bundefined method [`']merge' for nil\b/)
end
end

context "and url_options is given" do
let(:url_options) { { host: "example.com", protocol: :https } }

it "raises NoMethodError due to `nil.merge`" do
# Error message with Ruby 3.3 or older: undefined method `merge' for nil
# Error message with Ruby 3.4 or newer: undefined method 'merge' for nil
expect { tanshuku_url.shortened_url(url_options) }.to raise_error(
NoMethodError,
/\bundefined method `merge' for nil\b/
/\bundefined method [`']merge' for nil\b/
)
end
end
Expand Down

0 comments on commit 0ebcf61

Please sign in to comment.