Skip to content

Commit

Permalink
Ensure compatibility with ruby --enable-frozen-string-literal
Browse files Browse the repository at this point in the history
Ref: https://bugs.ruby-lang.org/issues/20205

`json-schema` is used by the `rbs` gem, which is tested as part
of the `ruby-core` CI, and it's failing with frozen string literals
are enabled by default.
  • Loading branch information
byroot committed Mar 15, 2024
1 parent 2cc181b commit d1d1e48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- ruby: "3.1"
coverage: "yes"
- ruby: "3.2"
- ruby: "3.3"
- ruby: "3.3"
rubyopt: "--enable-frozen-string-literal"
env:
COVERAGE: ${{ matrix.coverage }}
steps:
Expand All @@ -37,7 +40,7 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake ${{ matrix.rake_task }}
run: bundle exec rake ${{ matrix.rake_task }} RUBYOPT="${{ matrix.rubyopt }}"
- name: Build gem
run: gem build *.gemspec
tests:
Expand Down
2 changes: 1 addition & 1 deletion lib/json-schema/util/uuid.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def mask19 v, str
# nstr[7] |= 0b01010000
nstr[8] &= 0b00111111
nstr[8] |= 0b10000000
str = ''
str = +''
nstr.each { |s| str << s.chr }
str
end
Expand Down

0 comments on commit d1d1e48

Please sign in to comment.