diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 52f3fbb..551fe40 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -22,13 +22,17 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.0", 3.1, 3.2] - gemfile: ["6.1", "7.0", "main"] + ruby: ["3.0", 3.1, 3.2, 3,3] + gemfile: ["6.1", "7.0", "7.1", "main"] exclude: + - ruby: "3.0" + gemfile: "main" - ruby: "3.1" gemfile: "6.1" - ruby: "3.2" gemfile: "6.1" + - ruby: "3.3" + gemfile: "6.1" steps: - name: Install packages run: | diff --git a/.vscode/settings.json b/.vscode/settings.json index 2e70ced..bce6ffe 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "editor.codeActionsOnSave": { - "source.fixAll.eslint": true, + "source.fixAll.eslint": "explicit" }, "typescript.tsdk": "node_modules/typescript/lib", "typescript.preferences.importModuleSpecifier": "non-relative", diff --git a/gemfiles/7.1.gemfile b/gemfiles/7.1.gemfile new file mode 100644 index 0000000..f57276e --- /dev/null +++ b/gemfiles/7.1.gemfile @@ -0,0 +1,5 @@ +source "http://rubygems.org" + +gem "rails", "~> 7.1" + +gemspec :path => "../" diff --git a/lib/copy_tuner_client/configuration.rb b/lib/copy_tuner_client/configuration.rb index d5a13be..f8430a3 100644 --- a/lib/copy_tuner_client/configuration.rb +++ b/lib/copy_tuner_client/configuration.rb @@ -157,13 +157,20 @@ def initialize self.upload_disabled_environments = %w[production staging] self.s3_host = 'copy-tuner-data-prod.s3.amazonaws.com' self.disable_copyray_comment_injection = false - self.html_escape = false + # TODO: 0.18.0以降のバージョンで初期値をtrueにしたい + self.html_escape = nil self.ignored_keys = [] self.ignored_key_handler = -> (e) { raise e } @applied = false end + def html_escape + raise 'CopyTunerClient.configuration.html_escape is required' if @html_escape.nil? + + @html_escape + end + # Allows config options to be read like a hash # # @param [Symbol] option Key for a given attribute diff --git a/lib/copy_tuner_client/version.rb b/lib/copy_tuner_client/version.rb index c9aed9a..2872753 100644 --- a/lib/copy_tuner_client/version.rb +++ b/lib/copy_tuner_client/version.rb @@ -1,6 +1,6 @@ module CopyTunerClient # Client version - VERSION = '0.16.3'.freeze + VERSION = '0.17.0'.freeze # API version being used to communicate with the server API_VERSION = '2.0'.freeze diff --git a/spec/copy_tuner_client/i18n_backend_spec.rb b/spec/copy_tuner_client/i18n_backend_spec.rb index aaa2e1c..06c86ff 100644 --- a/spec/copy_tuner_client/i18n_backend_spec.rb +++ b/spec/copy_tuner_client/i18n_backend_spec.rb @@ -111,10 +111,10 @@ def build_backend expect(cache['en.test.key']).to eq 'default %{interpolate}' end - it "marks strings as html safe" do + it "dose not mark strings as html safe" do cache['en.test.key'] = FakeHtmlSafeString.new("Hello") backend = build_backend - expect(backend.translate('en', 'test.key')).to be_html_safe + expect(backend.translate('en', 'test.key')).to_not be_html_safe end it "looks up an array of defaults" do diff --git a/spec/support/client_spec_helpers.rb b/spec/support/client_spec_helpers.rb index db6f63e..7794faa 100644 --- a/spec/support/client_spec_helpers.rb +++ b/spec/support/client_spec_helpers.rb @@ -4,6 +4,7 @@ def reset_config CopyTunerClient.configure(false) do |config| config.api_key = 'abc123' config.s3_host = 'copy-tuner.com' + config.html_escape = true end end end