diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82531c7b1..f16166a97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,11 +14,16 @@ jobs: - '3.0' - '3.1' - '3.2' + - '3.3' + rubyopt: [""] + include: + - ruby-version: '3.3' + rubyopt: "--enable-frozen-string-literal --debug-frozen-string-literal" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: "${{ matrix.ruby-version }}" bundler-cache: true - - run: bundle exec rake + - run: bundle exec rake RUBYOPT="${{ matrix.rubyopt }}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 74338b56e..b3aef1953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## unreleased - Update following locales: - Portuguese (pt): Fixed `number.currency.format.format` and `helpers.submit.update` #1122 +- Fix compatibility with frozen string literals. #1120 ## 7.0.9 (2024-03-13) diff --git a/Gemfile.lock b/Gemfile.lock index aff4d8385..81a52d98b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rails-i18n (7.0.8) + rails-i18n (7.0.9) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) diff --git a/rails/transliteration/ru.rb b/rails/transliteration/ru.rb index 1b9bcfeed..0f358b245 100644 --- a/rails/transliteration/ru.rb +++ b/rails/transliteration/ru.rb @@ -13,7 +13,7 @@ def rule chars = string.scan(%r{#{multi_keys.join '|'}|\w|.}) - result = "" + result = +"" chars.each_with_index do |char, index| if upper.has_key?(char) && lower.has_key?(chars[index+1]) diff --git a/spec/support/ruby_content.rb b/spec/support/ruby_content.rb index 80579ede8..99516fd2e 100644 --- a/spec/support/ruby_content.rb +++ b/spec/support/ruby_content.rb @@ -4,7 +4,7 @@ module RailsI18n module Spec module RubyContent def content - @content ||= eval(IO.read(@filepath), TOPLEVEL_BINDING) + @content ||= eval(File.read(@filepath), TOPLEVEL_BINDING, @filepath) end end end