active_remote-cached 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_remote/cached.rb +21 -21
- data/lib/active_remote/cached/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81e9acd882928c8bbbef788810301b195c2400eb
|
4
|
+
data.tar.gz: ac45bdd85f22bfa2185451e4bf0bfb2c03410510
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e24999c6d62259b1f88f625cc8ae7bdb96d2ae0c5bd3d0beca2418729823d3d8b2fbdd4581b17a27ecf82ca7ed5831975b67167639b158d24986f36d1a2f3497
|
7
|
+
data.tar.gz: b699749dbd2d7d77cf9b4851d460c9d76b7bb2ac96374b9874001c950a7d45550ce4b3efd49a0e0e956592ef8780bcd507bf7e7e13cfebe5f8a7e3c59428476e
|
data/lib/active_remote/cached.rb
CHANGED
@@ -139,9 +139,9 @@ module ActiveRemote
|
|
139
139
|
# def self.cached_delete_by_user_guid(user_guid, options = {})
|
140
140
|
# ::ActiveRemote::Cached.cache.delete([name, user_guid])
|
141
141
|
# end
|
142
|
-
def self.#{method_name}(#{expanded_method_args},
|
143
|
-
|
144
|
-
namespace =
|
142
|
+
def self.#{method_name}(#{expanded_method_args}, __active_remote_cached_options = {})
|
143
|
+
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
144
|
+
namespace = __active_remote_cached_options.delete(:namespace)
|
145
145
|
find_cache_key = [namespace, name, "#find", #{sorted_method_args}].compact
|
146
146
|
search_cache_key = [namespace, name, "#search", #{sorted_method_args}].compact
|
147
147
|
|
@@ -160,9 +160,9 @@ module ActiveRemote
|
|
160
160
|
# def self.cached_exist_find_by_user_guid(user_guid, options = {})
|
161
161
|
# ::ActiveRemote::Cached.cache.exist?([name, user_guid])
|
162
162
|
# end
|
163
|
-
def self.#{method_name}(#{expanded_method_args},
|
164
|
-
|
165
|
-
namespace =
|
163
|
+
def self.#{method_name}(#{expanded_method_args}, __active_remote_cached_options = {})
|
164
|
+
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
165
|
+
namespace = __active_remote_cached_options.delete(:namespace)
|
166
166
|
cache_key = [namespace, name, "#find", #{sorted_method_args}].compact
|
167
167
|
|
168
168
|
::ActiveRemote::Cached.cache.exist?(cache_key)
|
@@ -181,9 +181,9 @@ module ActiveRemote
|
|
181
181
|
# def self.cached_exist_search_by_user_guid(user_guid, options = {})
|
182
182
|
# ::ActiveRemote::Cached.cache.exist?([namespace, name, "#search", user_guid])
|
183
183
|
# end
|
184
|
-
def self.#{method_name}(#{expanded_method_args},
|
185
|
-
|
186
|
-
namespace =
|
184
|
+
def self.#{method_name}(#{expanded_method_args}, __active_remote_cached_options = {})
|
185
|
+
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
186
|
+
namespace = __active_remote_cached_options.delete(:namespace)
|
187
187
|
cache_key = [namespace, name, "#search", #{sorted_method_args}].compact
|
188
188
|
|
189
189
|
::ActiveRemote::Cached.cache.exist?(cache_key)
|
@@ -215,12 +215,12 @@ module ActiveRemote
|
|
215
215
|
# If a block is given, it is incumbent on the caller to make sure the expectation
|
216
216
|
# of the result object is maintained for requests/responses
|
217
217
|
#
|
218
|
-
def self.#{method_name}(#{expanded_method_args},
|
219
|
-
|
220
|
-
namespace =
|
218
|
+
def self.#{method_name}(#{expanded_method_args}, __active_remote_cached_options = {})
|
219
|
+
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
220
|
+
namespace = __active_remote_cached_options.delete(:namespace)
|
221
221
|
cache_key = [namespace, name, "#find", #{sorted_method_args}].compact
|
222
222
|
|
223
|
-
::ActiveRemote::Cached.cache.fetch(cache_key,
|
223
|
+
::ActiveRemote::Cached.cache.fetch(cache_key, __active_remote_cached_options) do
|
224
224
|
if block_given?
|
225
225
|
yield
|
226
226
|
else
|
@@ -257,12 +257,12 @@ module ActiveRemote
|
|
257
257
|
# If a block is given, it is incumbent on the caller to make sure the expectation
|
258
258
|
# of the result object is maintained for requests/responses
|
259
259
|
#
|
260
|
-
def self.#{method_name}(#{expanded_method_args},
|
261
|
-
|
262
|
-
namespace =
|
260
|
+
def self.#{method_name}(#{expanded_method_args}, __active_remote_cached_options = {})
|
261
|
+
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
262
|
+
namespace = __active_remote_cached_options.delete(:namespace)
|
263
263
|
cache_key = [namespace, name, "#search", #{sorted_method_args}].compact
|
264
264
|
|
265
|
-
::ActiveRemote::Cached.cache.fetch(cache_key,
|
265
|
+
::ActiveRemote::Cached.cache.fetch(cache_key, __active_remote_cached_options) do
|
266
266
|
if block_given?
|
267
267
|
yield
|
268
268
|
else
|
@@ -304,12 +304,12 @@ module ActiveRemote
|
|
304
304
|
# If a block is given, it is incumbent on the caller to make sure the expectation
|
305
305
|
# of the result object is maintained for requests/responses
|
306
306
|
#
|
307
|
-
def self.#{method_name}(#{expanded_method_args},
|
308
|
-
|
309
|
-
namespace =
|
307
|
+
def self.#{method_name}(#{expanded_method_args}, __active_remote_cached_options = {})
|
308
|
+
__active_remote_cached_options = ::ActiveRemote::Cached.default_options.merge(#{cached_finder_options}).merge(__active_remote_cached_options)
|
309
|
+
namespace = __active_remote_cached_options.delete(:namespace)
|
310
310
|
cache_key = [namespace, name, "#search", #{sorted_method_args}].compact
|
311
311
|
|
312
|
-
::ActiveRemote::Cached.cache.fetch(cache_key,
|
312
|
+
::ActiveRemote::Cached.cache.fetch(cache_key, __active_remote_cached_options) do
|
313
313
|
results = []
|
314
314
|
|
315
315
|
if block_given?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_remote-cached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_remote
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.6.10
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Provides a configuration for caching mechanisms and finders on ActiveRemote
|