second_level_cache 1.6.2 → 2.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +31 -26
- data/Gemfile +1 -1
- data/README.md +5 -28
- data/lib/second_level_cache/active_record/fetch_by_uniq_key.rb +2 -2
- data/lib/second_level_cache/active_record/finder_methods.rb +8 -40
- data/lib/second_level_cache/active_record/preloader.rb +46 -0
- data/lib/second_level_cache/active_record.rb +3 -1
- data/lib/second_level_cache/record_marshal.rb +4 -0
- data/lib/second_level_cache/version.rb +1 -1
- data/lib/second_level_cache.rb +1 -0
- data/second_level_cache.gemspec +6 -6
- data/test/active_record/preloader_test.rb +28 -0
- data/test/active_record/test_helper.rb +14 -1
- data/test/require_test.rb +1 -0
- data/test/test_helper.rb +3 -0
- metadata +55 -38
- data/init.rb +0 -2
data/CHANGELOG.md
CHANGED
@@ -1,50 +1,55 @@
|
|
1
|
-
1.2
|
1
|
+
1.6.2
|
2
2
|
-----
|
3
|
-
* [
|
3
|
+
* [can disable/enable fetch_by_uinq_key method]
|
4
|
+
* [Fix Bug: serialized attribute columns marshal issue #11]
|
4
5
|
|
5
|
-
1.
|
6
|
+
1.6.1
|
6
7
|
-----
|
7
|
-
* [
|
8
|
+
* [Fix bug: undefined method `select_all_column?' for []:ActiveRecord::Relation] by sishen
|
8
9
|
|
9
|
-
1.
|
10
|
+
1.6.0
|
10
11
|
-----
|
11
|
-
* [
|
12
|
+
* [write through cache]
|
13
|
+
* [disable SecondLevelCache for spicial model]
|
14
|
+
* [only cache `SELECT *` query]
|
12
15
|
|
13
|
-
1.
|
16
|
+
1.5.1
|
14
17
|
-----
|
15
|
-
* [
|
18
|
+
* [use new marshal machanism to avoid clear assocation cache manually]
|
16
19
|
|
17
|
-
1.
|
20
|
+
1.5.0
|
18
21
|
-----
|
19
|
-
* [
|
22
|
+
* [add cache version to quick clear cache for special model]
|
23
|
+
|
24
|
+
1.4.1
|
25
|
+
-----
|
26
|
+
* [fix errors when belongs_to association return nil]
|
20
27
|
|
21
28
|
1.4.0
|
22
29
|
-----
|
23
30
|
* [cache has one assciation]
|
24
31
|
|
25
|
-
1.
|
32
|
+
1.3.2
|
26
33
|
-----
|
27
|
-
* [fix
|
34
|
+
* [fix has one assciation issue]
|
28
35
|
|
29
|
-
1.
|
36
|
+
1.3.1
|
30
37
|
-----
|
31
|
-
* [
|
38
|
+
* [clean cache after update_column/increment!/decrement!]
|
32
39
|
|
33
|
-
1.
|
40
|
+
1.3.0
|
34
41
|
-----
|
35
|
-
* [
|
42
|
+
* [clean cache after touch]
|
36
43
|
|
37
|
-
1.
|
44
|
+
1.2.1
|
38
45
|
-----
|
39
|
-
* [
|
40
|
-
* [disable SecondLevelCache for spicial model]
|
41
|
-
* [only cache `SELECT *` query]
|
46
|
+
* [fix polymorphic association bug]
|
42
47
|
|
43
|
-
1.
|
48
|
+
1.2.0
|
44
49
|
-----
|
45
|
-
* [
|
50
|
+
* [clear cache after update_counters](https://github.com/csdn-dev/second_level_cache/commit/240dde81199124092e0e8ad0500c167ac146e301)
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
46
55
|
|
47
|
-
1.6.2
|
48
|
-
-----
|
49
|
-
* [can disable/enable fetch_by_uinq_key method]
|
50
|
-
* [Fix Bug: serialized attribute columns marshal issue #11]
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# SecondLevelCache
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/second_level_cache.png)](http://badge.fury.io/rb/second_level_cache)
|
4
|
-
[![Dependency Status](https://gemnasium.com/
|
5
|
-
[![Build Status](https://travis-ci.org/
|
6
|
-
[![Code Climate](https://codeclimate.com/github/
|
4
|
+
[![Dependency Status](https://gemnasium.com/hooopo/second_level_cache.png)](https://gemnasium.com/hooopo/second_level_cache)
|
5
|
+
[![Build Status](https://travis-ci.org/hooopo/second_level_cache.png?branch=master)](https://travis-ci.org/hooopo/second_level_cache)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/hooopo/second_level_cache.png)](https://codeclimate.com/github/hooopo/second_level_cache)
|
7
7
|
|
8
|
-
SecondLevelCache is a write-through and read-through caching library inspired by Cache Money and cache_fu, support
|
8
|
+
SecondLevelCache is a write-through and read-through caching library inspired by Cache Money and cache_fu, support ActiveRecord 4.
|
9
9
|
|
10
10
|
Read-Through: Queries by ID, like `current_user.articles.find(params[:id])`, will first look in cache store and then look in the database for the results of that query. If there is a cache miss, it will populate the cache.
|
11
11
|
|
@@ -17,7 +17,7 @@ Write-Through: As objects are created, updated, and deleted, all of the caches a
|
|
17
17
|
In your gem file:
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
gem "second_level_cache", "~>
|
20
|
+
gem "second_level_cache", "~> 2.0.0"
|
21
21
|
```
|
22
22
|
|
23
23
|
## Usage
|
@@ -34,9 +34,6 @@ Then it will fetch cached object in this situations:
|
|
34
34
|
|
35
35
|
```ruby
|
36
36
|
User.find(1)
|
37
|
-
User.find_by_id(1)
|
38
|
-
User.find_by_id!(1)
|
39
|
-
User.find_by_id_and_name(1, "Hooopo")
|
40
37
|
User.where(:status => 1).find_by_id(1)
|
41
38
|
user.articles.find_by_id(1)
|
42
39
|
user.articles.find(1)
|
@@ -143,23 +140,3 @@ user = User.fetch_by_uniq_key!("hooopo", :nick_name) # this will raise `ActiveRe
|
|
143
140
|
## License
|
144
141
|
|
145
142
|
MIT License
|
146
|
-
|
147
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
148
|
-
a copy of this software and associated documentation files (the
|
149
|
-
"Software"), to deal in the Software without restriction, including
|
150
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
151
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
152
|
-
permit persons to whom the Software is furnished to do so, subject to
|
153
|
-
the following conditions:
|
154
|
-
|
155
|
-
The above copyright notice and this permission notice shall be
|
156
|
-
included in all copies or substantial portions of the Software.
|
157
|
-
|
158
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
159
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
160
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
161
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
162
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
163
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
164
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
165
|
-
|
@@ -4,8 +4,8 @@ module SecondLevelCache
|
|
4
4
|
module FetchByUniqKey
|
5
5
|
def fetch_by_uniq_key(value, uniq_key_name)
|
6
6
|
return self.where(uniq_key_name => value).first unless self.second_level_cache_enabled?
|
7
|
-
if
|
8
|
-
self.find_by_id(
|
7
|
+
if _id = SecondLevelCache.cache_store.read(cache_uniq_key(value, uniq_key_name))
|
8
|
+
self.find_by_id(_id)
|
9
9
|
else
|
10
10
|
record = self.where(uniq_key_name => value).first
|
11
11
|
record.tap{|record| SecondLevelCache.cache_store.write(cache_uniq_key(value, uniq_key_name), record.id)} if record
|
@@ -9,11 +9,11 @@ module SecondLevelCache
|
|
9
9
|
included do
|
10
10
|
class_eval do
|
11
11
|
alias_method_chain :find_one, :second_level_cache
|
12
|
-
alias_method_chain :find_by_attributes, :second_level_cache
|
13
12
|
end
|
14
13
|
end
|
15
14
|
|
16
|
-
# TODO
|
15
|
+
# TODO find_some
|
16
|
+
# https://github.com/rails/rails/blob/master/activerecord/lib/active_record/relation/finder_methods.rb#L289-L309
|
17
17
|
#
|
18
18
|
# Cacheable:
|
19
19
|
#
|
@@ -28,56 +28,28 @@ module SecondLevelCache
|
|
28
28
|
def find_one_with_second_level_cache(id)
|
29
29
|
return find_one_without_second_level_cache(id) unless second_level_cache_enabled?
|
30
30
|
return find_one_without_second_level_cache(id) unless select_all_column?
|
31
|
-
|
31
|
+
|
32
32
|
id = id.id if ActiveRecord::Base === id
|
33
|
-
if ::ActiveRecord::IdentityMap.enabled? && cachable? && record = from_identity_map(id)
|
34
|
-
return record
|
35
|
-
end
|
36
33
|
|
37
34
|
if cachable?
|
38
|
-
|
35
|
+
if record = @klass.read_second_level_cache(id)
|
36
|
+
return record
|
37
|
+
end
|
39
38
|
end
|
40
|
-
|
39
|
+
|
41
40
|
if cachable_without_conditions?
|
42
41
|
if record = @klass.read_second_level_cache(id)
|
43
42
|
return record if where_match_with_cache?(where_values, record)
|
44
43
|
end
|
45
44
|
end
|
46
|
-
|
45
|
+
|
47
46
|
record = find_one_without_second_level_cache(id)
|
48
47
|
record.write_second_level_cache
|
49
48
|
record
|
50
49
|
end
|
51
50
|
|
52
|
-
# TODO cache find_or_create_by_id
|
53
|
-
def find_by_attributes_with_second_level_cache(match, attributes, *args)
|
54
|
-
return find_by_attributes_without_second_level_cache(match, attributes, *args) unless second_level_cache_enabled?
|
55
|
-
return find_by_attributes_without_second_level_cache(match, attributes, *args) unless select_all_column?
|
56
|
-
|
57
|
-
conditions = Hash[attributes.map {|a| [a, args[attributes.index(a)]]}]
|
58
|
-
|
59
|
-
if conditions.has_key?("id")
|
60
|
-
result = wrap_bang(match.bang?) do
|
61
|
-
if conditions.size == 1
|
62
|
-
find_one_with_second_level_cache(conditions["id"])
|
63
|
-
else
|
64
|
-
where(conditions.except("id")).find_one_with_second_level_cache(conditions["id"])
|
65
|
-
end
|
66
|
-
end
|
67
|
-
yield(result) if block_given? #edge rails do this bug rails3.1.0 not
|
68
|
-
|
69
|
-
return result
|
70
|
-
end
|
71
|
-
|
72
|
-
find_by_attributes_without_second_level_cache(match, attributes, *args)
|
73
|
-
end
|
74
|
-
|
75
51
|
private
|
76
52
|
|
77
|
-
def wrap_bang(bang)
|
78
|
-
bang ? yield : (yield rescue nil)
|
79
|
-
end
|
80
|
-
|
81
53
|
def cachable?
|
82
54
|
where_values.blank? &&
|
83
55
|
limit_one? && order_values.blank? &&
|
@@ -106,10 +78,6 @@ module SecondLevelCache
|
|
106
78
|
def select_all_column?
|
107
79
|
select_values.blank?
|
108
80
|
end
|
109
|
-
|
110
|
-
def from_identity_map(id)
|
111
|
-
::ActiveRecord::IdentityMap.get(@klass, id)
|
112
|
-
end
|
113
81
|
end
|
114
82
|
end
|
115
83
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
module SecondLevelCache
|
3
|
+
module ActiveRecord
|
4
|
+
module Associations
|
5
|
+
class Preloader
|
6
|
+
module Association
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
included do
|
10
|
+
class_eval do
|
11
|
+
alias_method_chain :records_for, :second_level_cache
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def records_for_with_second_level_cache(ids)
|
16
|
+
return records_for_without_second_level_cache(ids) unless klass.second_level_cache_enabled?
|
17
|
+
|
18
|
+
map_cache_keys = ids.map{|id| klass.second_level_cache_key(id)}
|
19
|
+
records_from_cache = ::SecondLevelCache.cache_store.read_multi(*map_cache_keys)
|
20
|
+
|
21
|
+
# NOTICE
|
22
|
+
# Rails.cache.read_multi return hash that has keys only hitted.
|
23
|
+
# eg. Rails.cache.read_multi(1,2,3) => {2 => hit_value, 3 => hit_value}
|
24
|
+
hitted_ids = records_from_cache.map{|key, _| key.split("/")[2]}
|
25
|
+
missed_ids = ids - hitted_ids
|
26
|
+
|
27
|
+
::SecondLevelCache::Config.logger.info "missed ids -> #{missed_ids.inspect} | hitted ids -> #{hitted_ids.inspect}"
|
28
|
+
|
29
|
+
if missed_ids.empty?
|
30
|
+
RecordMarshal.load_multi(records_from_cache.values)
|
31
|
+
else
|
32
|
+
records_from_db = records_for_without_second_level_cache(missed_ids)
|
33
|
+
records_from_db.map{|record| write_cache(record); record} + RecordMarshal.load_multi(records_from_cache.values)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def write_cache(record)
|
40
|
+
record.write_second_level_cache
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -5,11 +5,13 @@ require 'second_level_cache/active_record/finder_methods'
|
|
5
5
|
require 'second_level_cache/active_record/persistence'
|
6
6
|
require 'second_level_cache/active_record/belongs_to_association'
|
7
7
|
require 'second_level_cache/active_record/has_one_association'
|
8
|
+
require 'second_level_cache/active_record/preloader'
|
8
9
|
|
9
10
|
ActiveRecord::Base.send(:include, SecondLevelCache::Mixin)
|
10
11
|
ActiveRecord::Base.send(:include, SecondLevelCache::ActiveRecord::Base)
|
11
12
|
ActiveRecord::Base.send(:extend, SecondLevelCache::ActiveRecord::FetchByUniqKey)
|
12
|
-
|
13
|
+
|
13
14
|
ActiveRecord::Base.send(:include, SecondLevelCache::ActiveRecord::Persistence)
|
14
15
|
ActiveRecord::Associations::BelongsToAssociation.send(:include, SecondLevelCache::ActiveRecord::Associations::BelongsToAssociation)
|
15
16
|
ActiveRecord::Associations::HasOneAssociation.send(:include, SecondLevelCache::ActiveRecord::Associations::HasOneAssociation)
|
17
|
+
ActiveRecord::Associations::Preloader::Association.send(:include, SecondLevelCache::ActiveRecord::Associations::Preloader::Association)
|
data/lib/second_level_cache.rb
CHANGED
@@ -23,6 +23,7 @@ module SecondLevelCache
|
|
23
23
|
@second_level_cache_options = options
|
24
24
|
@second_level_cache_options[:expires_in] ||= 1.week
|
25
25
|
@second_level_cache_options[:version] ||= 0
|
26
|
+
relation.class.send :include, SecondLevelCache::ActiveRecord::FinderMethods
|
26
27
|
end
|
27
28
|
|
28
29
|
def second_level_cache_enabled?
|
data/second_level_cache.gemspec
CHANGED
@@ -4,9 +4,9 @@ lib = File.expand_path('../lib', __FILE__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
|
-
gem.authors = ["
|
8
|
-
gem.email = ["
|
9
|
-
gem.description = %q{Write Through and Read Through caching library inspired by CacheMoney and cache_fu, support
|
7
|
+
gem.authors = ["Hooopo"]
|
8
|
+
gem.email = ["hoooopo@gmail.com"]
|
9
|
+
gem.description = %q{Write Through and Read Through caching library inspired by CacheMoney and cache_fu, support ActiveRecord 4.}
|
10
10
|
gem.summary = <<-SUMMARY
|
11
11
|
SecondLevelCache is a write-through and read-through caching library inspired by Cache Money and cache_fu, support only Rails3 and ActiveRecord.
|
12
12
|
|
@@ -21,7 +21,6 @@ Gem::Specification.new do |gem|
|
|
21
21
|
"README.md",
|
22
22
|
"Rakefile",
|
23
23
|
"Gemfile",
|
24
|
-
"init.rb",
|
25
24
|
"CHANGELOG.md",
|
26
25
|
"second_level_cache.gemspec"
|
27
26
|
]
|
@@ -31,9 +30,10 @@ Gem::Specification.new do |gem|
|
|
31
30
|
gem.require_paths = ["lib"]
|
32
31
|
gem.version = SecondLevelCache::VERSION
|
33
32
|
|
34
|
-
gem.add_runtime_dependency "activesupport", ["~>
|
33
|
+
gem.add_runtime_dependency "activesupport", ["~> 4.0.0.beta1"]
|
35
34
|
|
36
|
-
gem.add_development_dependency "activerecord", ["~>
|
35
|
+
gem.add_development_dependency "activerecord", ["~> 4.0.0.beta1"]
|
37
36
|
gem.add_development_dependency "sqlite3"
|
38
37
|
gem.add_development_dependency "rake"
|
38
|
+
gem.add_development_dependency "database_cleaner", "~> 1.0.0.RC1"
|
39
39
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require 'active_record/test_helper'
|
3
|
+
|
4
|
+
class ActiveRecord::PreloaderTest < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
DatabaseCleaner[:active_record].start
|
7
|
+
@topic1 = Topic.create :title => "title1", :body => "body1"
|
8
|
+
@topic2 = Topic.create :title => "title2", :body => "body2"
|
9
|
+
@topic3 = Topic.create :title => "title3", :body => "body3"
|
10
|
+
@post1 = @topic1.posts.create :body => "post1"
|
11
|
+
@post2 = @topic2.posts.create :body => "post2"
|
12
|
+
@post3 = @topic3.posts.create :body => "post3"
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_preload_work_properly
|
16
|
+
results = Post.includes(:topic).order("id ASC").to_a
|
17
|
+
assert_equal results.size, 3
|
18
|
+
assert_equal results.first.topic, @topic1
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_when_read_multi_missed_from_cache_AR_will_fetch_missed_records_from_db
|
22
|
+
@topic1.expire_second_level_cache
|
23
|
+
results = Post.includes(:topic).order("id ASC").to_a
|
24
|
+
assert_equal results.size, 3
|
25
|
+
assert_equal results.first.topic, @topic1
|
26
|
+
assert_match /IN\s+\(#{@topic1.id}\)/m, $sql_logger
|
27
|
+
end
|
28
|
+
end
|
@@ -24,7 +24,20 @@ class Test::Unit::TestCase
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def teardown
|
27
|
-
|
27
|
+
$sql_logger = nil
|
28
|
+
DatabaseCleaner[:active_record].clean
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
module ActiveRecord
|
33
|
+
module Querying
|
34
|
+
def find_by_sql_with_test(sql, binds = [])
|
35
|
+
$sql_logger ||= ""
|
36
|
+
$sql_logger << sql.to_sql
|
37
|
+
$sql_logger << "\n"
|
38
|
+
find_by_sql_without_test(sql, binds)
|
39
|
+
end
|
40
|
+
alias_method_chain :find_by_sql, :test
|
28
41
|
end
|
29
42
|
end
|
30
43
|
|
data/test/require_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -3,6 +3,9 @@ require 'rubygems'
|
|
3
3
|
require 'bundler/setup'
|
4
4
|
require 'second_level_cache'
|
5
5
|
require 'test/unit'
|
6
|
+
require 'database_cleaner'
|
7
|
+
|
8
|
+
DatabaseCleaner[:active_record].strategy = :transaction
|
6
9
|
|
7
10
|
SecondLevelCache.configure do |config|
|
8
11
|
config.cache_store = ActiveSupport::Cache::MemoryStore.new
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: second_level_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0.beta
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
|
-
-
|
8
|
+
- Hooopo
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 4.0.0.beta1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 4.0.0.beta1
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: activerecord
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 4.0.0.beta1
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 4.0.0.beta1
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: sqlite3
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,46 +75,63 @@ dependencies:
|
|
75
75
|
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: database_cleaner
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.0.0.RC1
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.0.0.RC1
|
78
94
|
description: Write Through and Read Through caching library inspired by CacheMoney
|
79
|
-
and cache_fu, support
|
95
|
+
and cache_fu, support ActiveRecord 4.
|
80
96
|
email:
|
81
|
-
-
|
97
|
+
- hoooopo@gmail.com
|
82
98
|
executables: []
|
83
99
|
extensions: []
|
84
100
|
extra_rdoc_files: []
|
85
101
|
files:
|
86
|
-
- lib/second_level_cache.rb
|
87
|
-
- lib/second_level_cache/config.rb
|
88
|
-
- lib/second_level_cache/active_record.rb
|
89
|
-
- lib/second_level_cache/active_record/fetch_by_uniq_key.rb
|
90
|
-
- lib/second_level_cache/active_record/persistence.rb
|
91
102
|
- lib/second_level_cache/active_record/base.rb
|
92
|
-
- lib/second_level_cache/active_record/finder_methods.rb
|
93
103
|
- lib/second_level_cache/active_record/belongs_to_association.rb
|
104
|
+
- lib/second_level_cache/active_record/fetch_by_uniq_key.rb
|
105
|
+
- lib/second_level_cache/active_record/finder_methods.rb
|
94
106
|
- lib/second_level_cache/active_record/has_one_association.rb
|
107
|
+
- lib/second_level_cache/active_record/persistence.rb
|
108
|
+
- lib/second_level_cache/active_record/preloader.rb
|
109
|
+
- lib/second_level_cache/active_record.rb
|
110
|
+
- lib/second_level_cache/arel/wheres.rb
|
111
|
+
- lib/second_level_cache/config.rb
|
95
112
|
- lib/second_level_cache/record_marshal.rb
|
96
113
|
- lib/second_level_cache/version.rb
|
97
|
-
- lib/second_level_cache
|
114
|
+
- lib/second_level_cache.rb
|
98
115
|
- README.md
|
99
116
|
- Rakefile
|
100
117
|
- Gemfile
|
101
|
-
- init.rb
|
102
118
|
- CHANGELOG.md
|
103
119
|
- second_level_cache.gemspec
|
104
|
-
- test/require_test.rb
|
105
|
-
- test/active_record/finder_methods_test.rb
|
106
|
-
- test/active_record/belongs_to_association_test.rb
|
107
120
|
- test/active_record/base_test.rb
|
108
|
-
- test/active_record/
|
109
|
-
- test/active_record/
|
110
|
-
- test/active_record/
|
121
|
+
- test/active_record/belongs_to_association_test.rb
|
122
|
+
- test/active_record/finder_methods_test.rb
|
123
|
+
- test/active_record/model/book.rb
|
111
124
|
- test/active_record/model/image.rb
|
112
125
|
- test/active_record/model/post.rb
|
113
|
-
- test/active_record/model/book.rb
|
114
|
-
- test/active_record/model/user.rb
|
115
126
|
- test/active_record/model/topic.rb
|
127
|
+
- test/active_record/model/user.rb
|
128
|
+
- test/active_record/persistence_test.rb
|
129
|
+
- test/active_record/polymorphic_association_test.rb
|
130
|
+
- test/active_record/preloader_test.rb
|
116
131
|
- test/active_record/second_level_cache_test.rb
|
132
|
+
- test/active_record/test_helper.rb
|
117
133
|
- test/record_marshal_test.rb
|
134
|
+
- test/require_test.rb
|
118
135
|
- test/test_helper.rb
|
119
136
|
homepage: https://github.com/csdn-dev/second_level_cache
|
120
137
|
licenses: []
|
@@ -131,12 +148,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
131
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
149
|
none: false
|
133
150
|
requirements:
|
134
|
-
- - ! '
|
151
|
+
- - ! '>'
|
135
152
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
153
|
+
version: 1.3.1
|
137
154
|
requirements: []
|
138
155
|
rubyforge_project:
|
139
|
-
rubygems_version: 1.8.
|
156
|
+
rubygems_version: 1.8.25
|
140
157
|
signing_key:
|
141
158
|
specification_version: 3
|
142
159
|
summary: ! 'SecondLevelCache is a write-through and read-through caching library inspired
|
@@ -146,19 +163,19 @@ summary: ! 'SecondLevelCache is a write-through and read-through caching library
|
|
146
163
|
is a cache miss, it will populate the cache. Write-Through: As objects are created,
|
147
164
|
updated, and deleted, all of the caches are automatically kept up-to-date and coherent.'
|
148
165
|
test_files:
|
149
|
-
- test/require_test.rb
|
150
|
-
- test/active_record/finder_methods_test.rb
|
151
|
-
- test/active_record/belongs_to_association_test.rb
|
152
166
|
- test/active_record/base_test.rb
|
153
|
-
- test/active_record/
|
154
|
-
- test/active_record/
|
155
|
-
- test/active_record/
|
167
|
+
- test/active_record/belongs_to_association_test.rb
|
168
|
+
- test/active_record/finder_methods_test.rb
|
169
|
+
- test/active_record/model/book.rb
|
156
170
|
- test/active_record/model/image.rb
|
157
171
|
- test/active_record/model/post.rb
|
158
|
-
- test/active_record/model/book.rb
|
159
|
-
- test/active_record/model/user.rb
|
160
172
|
- test/active_record/model/topic.rb
|
173
|
+
- test/active_record/model/user.rb
|
174
|
+
- test/active_record/persistence_test.rb
|
175
|
+
- test/active_record/polymorphic_association_test.rb
|
176
|
+
- test/active_record/preloader_test.rb
|
161
177
|
- test/active_record/second_level_cache_test.rb
|
178
|
+
- test/active_record/test_helper.rb
|
162
179
|
- test/record_marshal_test.rb
|
180
|
+
- test/require_test.rb
|
163
181
|
- test/test_helper.rb
|
164
|
-
has_rdoc:
|
data/init.rb
DELETED