Skip to content

Commit

Permalink
Fix compatibility with --frozen-string-literal
Browse files Browse the repository at this point in the history
  • Loading branch information
chaadow committed Jun 10, 2024
1 parent c5987d5 commit 9d796d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ jobs:
matrix:
ruby: [ '3.1', '3.2', '3.3', 'head' ]
rails: [ '7.1', 'edge' ]
rubyopt: [""]
include:
- ruby: '2.7'
rails: '6.1'
- ruby: '3.0'
rails: '6.1'
- ruby: '3.1'
rails: '7.0'
- ruby-version: '3.3'
rubyopt: "--enable-frozen-string-literal"

env:
RAILS_VERSION: ${{ matrix.rails }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -29,10 +32,10 @@ jobs:
bundler-cache: true

- name: Run unit tests
run: bundle exec rake test:unit
run: bundle exec rake test:unit RUBYOPT="${{ matrix.rubyopt }}"
timeout-minutes: 3

- name: Run acceptance tests
run: bundle exec rake test:acceptance
run: bundle exec rake test:acceptance RUBYOPT="${{ matrix.rubyopt }}"
timeout-minutes: 10
if: ${{ matrix.rails != 'edge' && matrix.ruby != 'head' }} # Acceptance tests use `gem install rails && rails new`
2 changes: 1 addition & 1 deletion lib/spring/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def unquote(q)
end
end
if rubydoesenc?
a[w] = '' << uchar
a[w] = +'' << uchar
w += 1
else
w += ucharenc(a, w, uchar)
Expand Down

0 comments on commit 9d796d8

Please sign in to comment.