diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fb9734..758de92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 8.0.0 (29-Nov-2024) + +* **Breaking change**: rename the `timeouts` config option to `additional_client_opts`. It has the same usage but now enables you to set both client timeouts and override the API host to send requests to. + +```ruby +additional_client_opts: { + open_timeout: 100, + timeout: 500, + api_host: 'http://example.com/api' +} +``` + ## 7.1.0 (12-Nov-2024) * Test with Rails 8 diff --git a/README.md b/README.md index 6c961d7..30c2518 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ exporter.export! ### Example: Multiple translation paths -Creating custom import/export script can come in really handy if you have a non-standard setup, for instance, your translation files are stored in multiple directories (not only in the default `./config/locales`. To overcome this problem, create a custom Rake task and provide as many importers/exporters as needed: +Creating custom import/export script can come in really handy if you have a non-standard setup, for instance, your translation files are stored in multiple directories (not only in the default `./config/locales`). To overcome this problem, create a custom Rake task and provide as many importers/exporters as needed: ```ruby require 'rake' @@ -146,7 +146,7 @@ LokaliseRails::GlobalConfig.config do |c| c.branch = 'develop' # Provide request timeouts for the Lokalise API client: - c.timeouts = {open_timeout: 5, timeout: 5} + c.additional_client_opts = {open_timeout: 5, timeout: 5} # Provide maximum number of retries for file exporting: c.max_retries_export = 5 diff --git a/lib/generators/templates/lokalise_rails_config.rb b/lib/generators/templates/lokalise_rails_config.rb index b371bbf..1d7672a 100644 --- a/lib/generators/templates/lokalise_rails_config.rb +++ b/lib/generators/templates/lokalise_rails_config.rb @@ -13,7 +13,7 @@ # c.branch = '' # Provide request timeouts for the Lokalise API client: - # c.timeouts = {open_timeout: nil, timeout: nil} + # c.additional_client_opts = {open_timeout: nil, timeout: nil} # Provide maximum number of retries for file exporting: # c.max_retries_export = 5 diff --git a/lib/lokalise_rails/version.rb b/lib/lokalise_rails/version.rb index 9c0e6d9..aac805b 100644 --- a/lib/lokalise_rails/version.rb +++ b/lib/lokalise_rails/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module LokaliseRails - VERSION = '7.1.0' + VERSION = '8.0.0' end diff --git a/lokalise_rails.gemspec b/lokalise_rails.gemspec index c261675..cd08b44 100644 --- a/lokalise_rails.gemspec +++ b/lokalise_rails.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| spec.extra_rdoc_files = ['README.md'] spec.require_paths = ['lib'] - spec.add_dependency 'lokalise_manager', '~> 5.0' + spec.add_dependency 'lokalise_manager', '~> 6.0' spec.add_dependency 'zeitwerk', '~> 2.4' spec.metadata = { diff --git a/spec/lib/lokalise_rails/global_config_spec.rb b/spec/lib/lokalise_rails/global_config_spec.rb index 14b1810..adab4c8 100644 --- a/spec/lib/lokalise_rails/global_config_spec.rb +++ b/spec/lib/lokalise_rails/global_config_spec.rb @@ -81,12 +81,12 @@ end it 'is possible to set timeouts' do - allow(fake_class).to receive(:timeouts=).with(duck_type(:each)) - fake_class.timeouts = { + allow(fake_class).to receive(:additional_client_opts=).with(duck_type(:each)) + fake_class.additional_client_opts = { open_timeout: 100, timeout: 500 } - expect(fake_class).to have_received(:timeouts=) + expect(fake_class).to have_received(:additional_client_opts=) end it 'is possible to set import_safe_mode' do