Skip to content

Commit b17c6ee

Browse files
committed
Fix compatibility with --frozen-string-literal
1 parent c5987d5 commit b17c6ee

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.github/workflows/ci.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@ jobs:
88
matrix:
99
ruby: [ '3.1', '3.2', '3.3', 'head' ]
1010
rails: [ '7.1', 'edge' ]
11+
rubyopt: [""]
1112
include:
12-
- ruby: '2.7'
13-
rails: '6.1'
1413
- ruby: '3.0'
1514
rails: '6.1'
1615
- ruby: '3.1'
1716
rails: '7.0'
17+
- ruby: '3.3'
18+
rails: 'edge'
19+
rubyopt: "--enable-frozen-string-literal"
1820

1921
env:
2022
RAILS_VERSION: ${{ matrix.rails }}
2123

2224
steps:
23-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2426

2527
- name: Set up Ruby
2628
uses: ruby/setup-ruby@v1
@@ -29,10 +31,10 @@ jobs:
2931
bundler-cache: true
3032

3133
- name: Run unit tests
32-
run: bundle exec rake test:unit
34+
run: bundle exec rake test:unit RUBYOPT="${{ matrix.rubyopt }}"
3335
timeout-minutes: 3
3436

3537
- name: Run acceptance tests
36-
run: bundle exec rake test:acceptance
38+
run: bundle exec rake test:acceptance RUBYOPT="${{ matrix.rubyopt }}"
3739
timeout-minutes: 10
3840
if: ${{ matrix.rails != 'edge' && matrix.ruby != 'head' }} # Acceptance tests use `gem install rails && rails new`

lib/spring/json.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
module Spring
1414
module JSON
1515
def self.load(string)
16-
string.force_encoding("utf-8")
1716
OkJson.decode(string)
1817
end
1918

@@ -364,7 +363,7 @@ def unquote(q)
364363
end
365364
end
366365
if rubydoesenc?
367-
a[w] = '' << uchar
366+
a[w] = +'' << uchar
368367
w += 1
369368
else
370369
w += ucharenc(a, w, uchar)

test/support/application.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def read_streams
168168
end
169169

170170
def read_stream(stream)
171-
output = ""
171+
output = +""
172172
while IO.select([stream], [], [], 0.5) && !stream.eof?
173173
output << stream.readpartial(10240)
174174
end

0 commit comments

Comments
 (0)