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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7084212f990738a1e6338e73961ef7f34e3c9670
4
- data.tar.gz: 2fa840e2f6e16219f66457381d92b1cc2c918a69
3
+ metadata.gz: a9069b037b67c4736e52daba941f7e8400e3d9fd
4
+ data.tar.gz: 9873f3240c8330dd94839498167fa803895fbbd0
5
5
  SHA512:
6
- metadata.gz: 352deedc590d022c51433522225cf9237207019890fff5994be08e2492e3b4f8dedb867b9adf131716f993c5cd5b4c2bad895b3be0a91caf2f049979322c48f2
7
- data.tar.gz: 4fab5916ae92cbfc4e9d89d8fc2b75742687e25e2a92eeed6d4275cccbd320ebc96da5406cf6ce25df2785334034ea55496cf2157bf8cccd61c9e193da4d05be
6
+ metadata.gz: efadbc68cbbc32082253e4a7dd84ab65e916df444e19af1e6b47717a3bb78e25721add3776659a61f4abe0b87e7009da05cb1c40b1081234f112b3fb4079affa
7
+ data.tar.gz: 0a0bb1622e3af6281e3049b7e4e4e8d5fa41665acc8c78fa9bab6e02bad9a9d7442c7eab0f5feddad404ee03d89c9d8c690d5d86e9acb242053084cba64c2ae8
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.1.1
1
+ ruby-2.1.2
data/.travis.yml CHANGED
@@ -2,8 +2,8 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
- - 2.1.1
6
- - rbx-2.2.6
5
+ - 2.1.2
6
+ - rbx-2.2.10
7
7
  services:
8
8
  - postgresql
9
9
  before_script:
@@ -33,7 +33,7 @@ module LookupBy
33
33
 
34
34
  @type = :lru
35
35
  @limit = options[:cache]
36
- @cache = Rails.configuration.allow_concurrency ? Caching::SafeLRU.new(@limit) : Caching::LRU.new(@limit)
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
@@ -1,3 +1,3 @@
1
1
  module LookupBy
2
- VERSION = "0.8.0"
2
+ VERSION = "0.9.0"
3
3
  end
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.8.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-07-09 00:00:00.000000000 Z
11
+ date: 2014-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails