Skip to content

Commit

Permalink
Add full Ruby 3.4 compatibility
Browse files Browse the repository at this point in the history
Caller location with `label` is being decorated with
`Shakapacker::Helper#` in Ruby 3.4

This commit changes `label` to `base_label`

Close shakacode#535
  • Loading branch information
tagliala committed Dec 27, 2024
1 parent 17a976f commit b99a6fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
gemfile:
- gemfiles/Gemfile-rails.6.0.x
- gemfiles/Gemfile-rails.6.1.x
Expand Down Expand Up @@ -48,6 +48,12 @@ jobs:
gemfile: gemfiles/Gemfile-rails.6.0.x
- ruby: '3.3'
gemfile: gemfiles/Gemfile-rails.6.1.x
- ruby: '3.4'
gemfile: gemfiles/Gemfile-rails.6.0.x
- ruby: '3.4'
gemfile: gemfiles/Gemfile-rails.6.1.x
- ruby: '3.4'
gemfile: gemfiles/Gemfile-rails.7.0.x

env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: rm -f Gemfile.lock
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
ruby-version: '3.4'
bundler-cache: true

- name: Ruby rubocop
Expand All @@ -35,7 +35,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
gemfile:
- gemfiles/Gemfile-rails.6.0.x
- gemfiles/Gemfile-rails.6.1.x
Expand Down Expand Up @@ -65,6 +65,12 @@ jobs:
gemfile: gemfiles/Gemfile-rails.6.0.x
- ruby: '3.3'
gemfile: gemfiles/Gemfile-rails.6.1.x
- ruby: '3.4'
gemfile: gemfiles/Gemfile-rails.6.0.x
- ruby: '3.4'
gemfile: gemfiles/Gemfile-rails.6.1.x
- ruby: '3.4'
gemfile: gemfiles/Gemfile-rails.7.0.x

env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
Expand Down
2 changes: 1 addition & 1 deletion lib/shakapacker/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def prepend_javascript_pack_tag(*names, defer: true)

def update_javascript_pack_tag_queue(defer:)
if @javascript_pack_tag_loaded
raise "You can only call #{caller_locations(1..1).first.label} before javascript_pack_tag helper. " \
raise "You can only call #{caller_locations(1..1).first.base_label} before javascript_pack_tag helper. " \
"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"
end

Expand Down

0 comments on commit b99a6fa

Please sign in to comment.