Skip to content

Commit 12ba7c3

Browse files
committed
Add full Ruby 3.4 compatibility
Caller location with `label` is being decorated with `Shakapacker::Helper#` in Ruby 3.4 This commit changes `label` to `base_label` Close #535 Ref: - https://ruby-doc.org/core-2.7.0/Thread/Backtrace/Location.html#method-i-base_label
1 parent af76122 commit 12ba7c3

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.github/workflows/generator.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
os: [ubuntu-latest]
21-
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
21+
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
2222
gemfile:
2323
- gemfiles/Gemfile-rails.6.0.x
2424
- gemfiles/Gemfile-rails.6.1.x
@@ -41,6 +41,12 @@ jobs:
4141
gemfile: gemfiles/Gemfile-rails.6.0.x
4242
- ruby: '3.3'
4343
gemfile: gemfiles/Gemfile-rails.6.1.x
44+
- ruby: '3.4'
45+
gemfile: gemfiles/Gemfile-rails.6.0.x
46+
- ruby: '3.4'
47+
gemfile: gemfiles/Gemfile-rails.6.1.x
48+
- ruby: '3.4'
49+
gemfile: gemfiles/Gemfile-rails.7.0.x
4450

4551
env:
4652
BUNDLE_GEMFILE: ${{ matrix.gemfile }}

.github/workflows/ruby.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: rm -f Gemfile.lock
2424
- uses: ruby/setup-ruby@v1
2525
with:
26-
ruby-version: '3.3'
26+
ruby-version: '3.4'
2727
rubygems: latest
2828
bundler-cache: true
2929

@@ -36,7 +36,7 @@ jobs:
3636
strategy:
3737
matrix:
3838
os: [ubuntu-latest]
39-
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
39+
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
4040
gemfile:
4141
- gemfiles/Gemfile-rails.6.0.x
4242
- gemfiles/Gemfile-rails.6.1.x
@@ -59,6 +59,12 @@ jobs:
5959
gemfile: gemfiles/Gemfile-rails.6.0.x
6060
- ruby: '3.3'
6161
gemfile: gemfiles/Gemfile-rails.6.1.x
62+
- ruby: '3.4'
63+
gemfile: gemfiles/Gemfile-rails.6.0.x
64+
- ruby: '3.4'
65+
gemfile: gemfiles/Gemfile-rails.6.1.x
66+
- ruby: '3.4'
67+
gemfile: gemfiles/Gemfile-rails.7.0.x
6268

6369
env:
6470
BUNDLE_GEMFILE: ${{ matrix.gemfile }}

lib/shakapacker/helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def prepend_javascript_pack_tag(*names, defer: true)
195195

196196
def update_javascript_pack_tag_queue(defer:)
197197
if @javascript_pack_tag_loaded
198-
raise "You can only call #{caller_locations(1..1).first.label} before javascript_pack_tag helper. " \
198+
raise "You can only call #{caller_locations(1..1).first.base_label} before javascript_pack_tag helper. " \
199199
"Please refer to https://github.com/shakacode/shakapacker/blob/main/README.md#view-helper-append_javascript_pack_tag-prepend_javascript_pack_tag-and-append_stylesheet_pack_tag for the usage guide"
200200
end
201201

0 commit comments

Comments
 (0)