aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:38:33 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 19:38:33 +0200
commit5c315a8fa6296904f5e0ba8da919fc395548cf98 (patch)
treec20da9c73b5db9caa8c2aa711955ed17f01d396d /activesupport/lib/active_support/cache
parentd22e522179c1c90e658c3ed0e9b972ec62306209 (diff)
downloadrails-5c315a8fa6296904f5e0ba8da919fc395548cf98.tar.gz
rails-5c315a8fa6296904f5e0ba8da919fc395548cf98.tar.bz2
rails-5c315a8fa6296904f5e0ba8da919fc395548cf98.zip
modernizes hash syntax in activesupport
Diffstat (limited to 'activesupport/lib/active_support/cache')
-rw-r--r--activesupport/lib/active_support/cache/mem_cache_store.rb6
-rw-r--r--activesupport/lib/active_support/cache/memory_store.rb4
2 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb
index 5db40b37b0..e8b56676cb 100644
--- a/activesupport/lib/active_support/cache/mem_cache_store.rb
+++ b/activesupport/lib/active_support/cache/mem_cache_store.rb
@@ -97,7 +97,7 @@ module ActiveSupport
options = merged_options(options)
keys_to_names = Hash[names.map{|name| [normalize_key(name, options), name]}]
- raw_values = @data.get_multi(keys_to_names.keys, :raw => true)
+ raw_values = @data.get_multi(keys_to_names.keys, raw: true)
values = {}
raw_values.each do |key, value|
entry = deserialize_entry(value)
@@ -112,7 +112,7 @@ module ActiveSupport
# to zero.
def increment(name, amount = 1, options = nil) # :nodoc:
options = merged_options(options)
- instrument(:increment, name, :amount => amount) do
+ instrument(:increment, name, amount: amount) do
rescue_error_with nil do
@data.incr(normalize_key(name, options), amount)
end
@@ -125,7 +125,7 @@ module ActiveSupport
# to zero.
def decrement(name, amount = 1, options = nil) # :nodoc:
options = merged_options(options)
- instrument(:decrement, name, :amount => amount) do
+ instrument(:decrement, name, amount: amount) do
rescue_error_with nil do
@data.decr(normalize_key(name, options), amount)
end
diff --git a/activesupport/lib/active_support/cache/memory_store.rb b/activesupport/lib/active_support/cache/memory_store.rb
index e61d9f3053..d7dc574f5b 100644
--- a/activesupport/lib/active_support/cache/memory_store.rb
+++ b/activesupport/lib/active_support/cache/memory_store.rb
@@ -39,7 +39,7 @@ module ActiveSupport
# Preemptively iterates through all stored keys and removes the ones which have expired.
def cleanup(options = nil)
options = merged_options(options)
- instrument(:cleanup, :size => @data.size) do
+ instrument(:cleanup, size: @data.size) do
keys = synchronize{ @data.keys }
keys.each do |key|
entry = @data[key]
@@ -56,7 +56,7 @@ module ActiveSupport
begin
start_time = Time.now
cleanup
- instrument(:prune, target_size, :from => @cache_size) do
+ instrument(:prune, target_size, from: @cache_size) do
keys = synchronize{ @key_access.keys.sort{|a,b| @key_access[a].to_f <=> @key_access[b].to_f} }
keys.each do |key|
delete_entry(key, options)