lookup_by 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -2
- data/lib/lookup_by/cache.rb +10 -1
- data/lib/lookup_by/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9069b037b67c4736e52daba941f7e8400e3d9fd
|
4
|
+
data.tar.gz: 9873f3240c8330dd94839498167fa803895fbbd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efadbc68cbbc32082253e4a7dd84ab65e916df444e19af1e6b47717a3bb78e25721add3776659a61f4abe0b87e7009da05cb1c40b1081234f112b3fb4079affa
|
7
|
+
data.tar.gz: 0a0bb1622e3af6281e3049b7e4e4e8d5fa41665acc8c78fa9bab6e02bad9a9d7442c7eab0f5feddad404ee03d89c9d8c690d5d86e9acb242053084cba64c2ae8
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.1.
|
1
|
+
ruby-2.1.2
|
data/.travis.yml
CHANGED
data/lib/lookup_by/cache.rb
CHANGED
@@ -33,7 +33,7 @@ module LookupBy
|
|
33
33
|
|
34
34
|
@type = :lru
|
35
35
|
@limit = options[:cache]
|
36
|
-
@cache =
|
36
|
+
@cache = concurrent? ? Caching::SafeLRU.new(@limit) : Caching::LRU.new(@limit)
|
37
37
|
@read = true
|
38
38
|
@write ||= false
|
39
39
|
@testing = true if Rails.env.test? && @write
|
@@ -131,6 +131,15 @@ module LookupBy
|
|
131
131
|
|
132
132
|
private
|
133
133
|
|
134
|
+
def concurrent?
|
135
|
+
case Rails::VERSION::MAJOR
|
136
|
+
when 4 then Rails.configuration.cache_classes && Rails.configuration.eager_load
|
137
|
+
when 3 then Rails.configuration.allow_concurrency
|
138
|
+
else
|
139
|
+
true
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
134
143
|
def primary_key?(value)
|
135
144
|
case @primary_key_type
|
136
145
|
when :integer
|
data/lib/lookup_by/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lookup_by
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Peterson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|