Skip to content

Commit

Permalink
fix: ignored_keys設定されたキーがアップロードされる場合はエラーが発生するように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
aki77 committed Aug 23, 2024
1 parent 0ff3939 commit d3ef827
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/copy_tuner_client/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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[:ignored_keys]
@ignored_key_handler = options[:ignored_key_handler]
@locales = Array(options[:locales]).map(&:to_s)
# mutable states
@blurbs = {}
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion lib/copy_tuner_client/version.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit d3ef827

Please sign in to comment.