diff --git a/lib/copy_tuner_client/cache.rb b/lib/copy_tuner_client/cache.rb index 07b3b3d..88552cb 100644 --- a/lib/copy_tuner_client/cache.rb +++ b/lib/copy_tuner_client/cache.rb @@ -18,6 +18,8 @@ def initialize(client, options) @mutex = Mutex.new @exclude_key_regexp = options[:exclude_key_regexp] @upload_disabled = options[:upload_disabled] + @ignored_keys = options.fetch(:ignored_keys, []) + @ignored_key_handler = options.fetch(:ignored_key_handler, -> (e) { raise e }) @locales = Array(options[:locales]).map(&:to_s) # mutable states @blurbs = {} @@ -44,6 +46,11 @@ def []=(key, value) return if @locales.present? && !@locales.member?(key.split('.').first) return if @upload_disabled + key_without_locale = key.split('.')[1..].join('.') + if @ignored_keys.include?(key_without_locale) + @ignored_key_handler.call(IgnoredKey.new("Ignored key: #{key_without_locale}")) + end + lock do return if @blank_keys.member?(key) || @blurbs.key?(key) diff --git a/lib/copy_tuner_client/version.rb b/lib/copy_tuner_client/version.rb index c8d9400..addee7a 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.17.1'.freeze + VERSION = '0.18.0'.freeze # API version being used to communicate with the server API_VERSION = '2.0'.freeze