record-cache 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/lib/record_cache.rb +2 -1
- data/lib/record_cache/base.rb +63 -22
- data/lib/record_cache/datastore/active_record.rb +5 -3
- data/lib/record_cache/datastore/active_record_30.rb +95 -38
- data/lib/record_cache/datastore/active_record_31.rb +157 -54
- data/lib/record_cache/datastore/active_record_32.rb +444 -0
- data/lib/record_cache/dispatcher.rb +47 -47
- data/lib/record_cache/multi_read.rb +14 -1
- data/lib/record_cache/query.rb +36 -25
- data/lib/record_cache/statistics.rb +5 -5
- data/lib/record_cache/strategy/base.rb +49 -19
- data/lib/record_cache/strategy/full_table_cache.rb +81 -0
- data/lib/record_cache/strategy/index_cache.rb +38 -36
- data/lib/record_cache/strategy/unique_index_cache.rb +130 -0
- data/lib/record_cache/strategy/util.rb +12 -12
- data/lib/record_cache/test/resettable_version_store.rb +2 -9
- data/lib/record_cache/version.rb +1 -1
- data/lib/record_cache/version_store.rb +23 -16
- data/spec/db/schema.rb +12 -0
- data/spec/db/seeds.rb +10 -0
- data/spec/lib/active_record/visitor_spec.rb +22 -0
- data/spec/lib/base_spec.rb +21 -0
- data/spec/lib/dispatcher_spec.rb +24 -46
- data/spec/lib/multi_read_spec.rb +6 -6
- data/spec/lib/query_spec.rb +43 -43
- data/spec/lib/statistics_spec.rb +28 -28
- data/spec/lib/strategy/base_spec.rb +98 -87
- data/spec/lib/strategy/full_table_cache_spec.rb +68 -0
- data/spec/lib/strategy/index_cache_spec.rb +112 -69
- data/spec/lib/strategy/query_cache_spec.rb +83 -0
- data/spec/lib/strategy/unique_index_on_id_cache_spec.rb +317 -0
- data/spec/lib/strategy/unique_index_on_string_cache_spec.rb +168 -0
- data/spec/lib/strategy/util_spec.rb +67 -49
- data/spec/lib/version_store_spec.rb +22 -41
- data/spec/models/address.rb +9 -0
- data/spec/models/apple.rb +1 -1
- data/spec/models/banana.rb +21 -2
- data/spec/models/language.rb +5 -0
- data/spec/models/person.rb +1 -1
- data/spec/models/store.rb +2 -1
- data/spec/spec_helper.rb +7 -4
- data/spec/support/after_commit.rb +2 -0
- data/spec/support/matchers/hit_cache_matcher.rb +10 -6
- data/spec/support/matchers/log.rb +45 -0
- data/spec/support/matchers/miss_cache_matcher.rb +10 -6
- data/spec/support/matchers/use_cache_matcher.rb +10 -6
- metadata +156 -161
- data/lib/record_cache/strategy/id_cache.rb +0 -93
- data/lib/record_cache/strategy/request_cache.rb +0 -49
- data/spec/lib/strategy/id_cache_spec.rb +0 -168
- data/spec/lib/strategy/request_cache_spec.rb +0 -85
data/spec/models/person.rb
CHANGED
data/spec/models/store.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
class Store < ActiveRecord::Base
|
2
2
|
|
3
|
-
cache_records :store => :local, :key => "st"
|
3
|
+
cache_records :store => :local, :key => "st"
|
4
4
|
|
5
5
|
belongs_to :owner, :class_name => "Person"
|
6
6
|
|
7
7
|
has_many :apples, :autosave => true # cached with index on store
|
8
8
|
has_many :bananas # cached without index on store
|
9
9
|
has_many :pears # not cached
|
10
|
+
has_one :address, :autosave => true
|
10
11
|
|
11
12
|
has_and_belongs_to_many :customers, :class_name => "Person"
|
12
13
|
|
data/spec/spec_helper.rb
CHANGED
@@ -2,10 +2,13 @@ dir = File.dirname(__FILE__)
|
|
2
2
|
$LOAD_PATH.unshift dir + "/../lib"
|
3
3
|
$LOAD_PATH.unshift dir
|
4
4
|
|
5
|
+
require 'simplecov'
|
6
|
+
SimpleCov.start do
|
7
|
+
add_filter '/spec/'
|
8
|
+
end
|
9
|
+
|
5
10
|
require "rubygems"
|
6
|
-
require "test/unit"
|
7
11
|
require "rspec"
|
8
|
-
require 'rr'
|
9
12
|
require 'database_cleaner'
|
10
13
|
require "logger"
|
11
14
|
require "record_cache"
|
@@ -31,9 +34,9 @@ load(dir + "/db/seeds.rb")
|
|
31
34
|
|
32
35
|
# Clear cache after each test
|
33
36
|
RSpec.configure do |config|
|
34
|
-
|
35
|
-
|
37
|
+
|
36
38
|
config.before(:each) do
|
39
|
+
RecordCache::Base.enable
|
37
40
|
DatabaseCleaner.start
|
38
41
|
end
|
39
42
|
|
@@ -33,6 +33,7 @@ module ActiveRecord
|
|
33
33
|
if !rolled_back && open_transactions == 1
|
34
34
|
commit_transaction_records(false)
|
35
35
|
end
|
36
|
+
true
|
36
37
|
end
|
37
38
|
alias_method_chain :transaction, :transactional_fixtures
|
38
39
|
|
@@ -64,6 +65,7 @@ module ActiveRecord
|
|
64
65
|
@_current_transaction_records = real_current_transaction_records
|
65
66
|
end
|
66
67
|
end
|
68
|
+
true
|
67
69
|
end
|
68
70
|
alias_method_chain :commit_transaction_records, :transactional_fixtures
|
69
71
|
end
|
@@ -1,17 +1,21 @@
|
|
1
1
|
# Examples:
|
2
|
-
# 1)
|
2
|
+
# 1) expect{ Person.find(22) }.to hit_cache(Person)
|
3
3
|
# _should have at least one hit in any of the cache strategies for the Person model_
|
4
4
|
#
|
5
|
-
# 2)
|
5
|
+
# 2) expect{ Person.find(22) }.to hit_cache(Person).on(:id)
|
6
6
|
# _should have at least one hit in the ID cache strategy for the Person model_
|
7
7
|
#
|
8
|
-
# 3)
|
8
|
+
# 3) expect{ Person.find_by_ids(22, 23, 24) }.to hit_cache(Person).on(:id).times(2)
|
9
9
|
# _should have exactly two hits in the :id cache strategy for the Person model_
|
10
10
|
#
|
11
|
-
# 4)
|
11
|
+
# 4) expect{ Person.find_by_ids(22, 23, 24) }.to hit_cache(Person).times(3)
|
12
12
|
# _should have exactly three hits in any of the cache strategies for the Person model_
|
13
13
|
RSpec::Matchers.define :hit_cache do |model|
|
14
14
|
|
15
|
+
def supports_block_expectations?
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
15
19
|
chain :on do |strategy|
|
16
20
|
@strategy = strategy
|
17
21
|
end
|
@@ -34,12 +38,12 @@ RSpec::Matchers.define :hit_cache do |model|
|
|
34
38
|
@expected_nr_of_hits ? @nr_of_hits == @expected_nr_of_hits : @nr_of_hits > 0
|
35
39
|
end
|
36
40
|
|
37
|
-
|
41
|
+
failure_message do |proc|
|
38
42
|
prepare_message
|
39
43
|
"Expected #{@strategy_msg} for #{model.name} to be hit #{@times_msg}, but found #{@nr_of_hits}: #{@statistics_msg}"
|
40
44
|
end
|
41
45
|
|
42
|
-
|
46
|
+
failure_message_when_negated do |proc|
|
43
47
|
prepare_message
|
44
48
|
"Expected #{@strategy_msg} for #{model.name} not to be hit #{@times_msg}, but found #{@nr_of_hits}: #{@statistics_msg}"
|
45
49
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Examples:
|
2
|
+
# 1) expect{ Person.find(22) }.to log(:debug, %(UniqueIndexCache on 'id' hit for ids 1)
|
3
|
+
# _should have at least one debug log statement as given above_
|
4
|
+
#
|
5
|
+
# 2) expect{ Person.find(22) }.to log(:debug, /^UniqueIndexCache/)
|
6
|
+
# _should have at least one debug log statement starting with UniqueIndexCache_
|
7
|
+
RSpec::Matchers.define :log do |severity, expected|
|
8
|
+
|
9
|
+
def supports_block_expectations?
|
10
|
+
true
|
11
|
+
end
|
12
|
+
|
13
|
+
match do |proc|
|
14
|
+
logger = RecordCache::Base.logger
|
15
|
+
# override the debug/info/warn/error method
|
16
|
+
logger.instance_variable_set(:@found_messages, [])
|
17
|
+
logger.instance_variable_set(:@found, false)
|
18
|
+
logger.class.send(:alias_method, "orig_#{severity}", severity)
|
19
|
+
logger.class.send(:define_method, severity) do |progname = nil, &block|
|
20
|
+
unless @found
|
21
|
+
actual= progname.is_a?(String) ? progname : block ? block.call : nil
|
22
|
+
unless actual.blank?
|
23
|
+
@found = actual.is_a?(String) && expected.is_a?(Regexp) ? actual =~ expected : actual == expected
|
24
|
+
@found_messages << actual
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
# call the given proc
|
29
|
+
proc.call
|
30
|
+
# redefine
|
31
|
+
logger.class.send(:alias_method, severity, "orig_#{severity}")
|
32
|
+
# the result
|
33
|
+
@found_messages = logger.instance_variable_get(:@found_messages)
|
34
|
+
@found = logger.instance_variable_get(:@found)
|
35
|
+
end
|
36
|
+
|
37
|
+
failure_message do |proc|
|
38
|
+
"Expected #{@found_messages.inspect} to include #{expected.inspect}"
|
39
|
+
end
|
40
|
+
|
41
|
+
failure_message_when_negated do |proc|
|
42
|
+
"Expected #{@found_messages.inspect} not to include #{expected.inspect}"
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -1,17 +1,21 @@
|
|
1
1
|
# Examples:
|
2
|
-
# 1)
|
2
|
+
# 1) expect{ Person.find(22) }.to miss_cache(Person)
|
3
3
|
# _should have at least one miss in any of the cache strategies for the Person model_
|
4
4
|
#
|
5
|
-
# 2)
|
5
|
+
# 2) expect{ Person.find(22) }.to miss_cache(Person).on(:id)
|
6
6
|
# _should have at least one miss for the ID cache strategy for the Person model_
|
7
7
|
#
|
8
|
-
# 3)
|
8
|
+
# 3) expect{ Person.find_by_ids(22, 23, 24) }.to miss_cache(Person).on(:id).times(2)
|
9
9
|
# _should have exactly two misses in the :id cache strategy for the Person model_
|
10
10
|
#
|
11
|
-
# 4)
|
11
|
+
# 4) expect{ Person.find_by_ids(22, 23, 24) }.to miss_cache(Person).times(3)
|
12
12
|
# _should have exactly three misses in any of the cache strategies for the Person model_
|
13
13
|
RSpec::Matchers.define :miss_cache do |model|
|
14
14
|
|
15
|
+
def supports_block_expectations?
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
15
19
|
chain :on do |strategy|
|
16
20
|
@strategy = strategy
|
17
21
|
end
|
@@ -34,12 +38,12 @@ RSpec::Matchers.define :miss_cache do |model|
|
|
34
38
|
@expected_nr_of_misses ? @nr_of_misses == @expected_nr_of_misses : @nr_of_misses > 0
|
35
39
|
end
|
36
40
|
|
37
|
-
|
41
|
+
failure_message do |proc|
|
38
42
|
prepare_message
|
39
43
|
"Expected #{@strategy_msg} for #{model.name} to be missed #{@times_msg}, but found #{@nr_of_misses}: #{@statistics_msg}"
|
40
44
|
end
|
41
45
|
|
42
|
-
|
46
|
+
failure_message_when_negated do |proc|
|
43
47
|
prepare_message
|
44
48
|
"Expected #{@strategy_msg} for #{model.name} not to be missed #{@times_msg}, but found #{@nr_of_misses}: #{@statistics_msg}"
|
45
49
|
end
|
@@ -1,17 +1,21 @@
|
|
1
1
|
# Examples:
|
2
|
-
# 1)
|
2
|
+
# 1) expect{ Person.find(22) }.to use_cache(Person)
|
3
3
|
# _should perform at least one call (hit/miss) to any of the cache strategies for the Person model_
|
4
4
|
#
|
5
|
-
# 2)
|
5
|
+
# 2) expect{ Person.find(22) }.to use_cache(Person).on(:id)
|
6
6
|
# _should perform at least one call (hit/miss) to the ID cache strategy for the Person model_
|
7
7
|
#
|
8
|
-
# 3)
|
8
|
+
# 3) expect{ Person.find_by_ids(22, 23, 24) }.to use_cache(Person).on(:id).times(2)
|
9
9
|
# _should perform exactly two calls (hit/miss) to the :id cache strategy for the Person model_
|
10
10
|
#
|
11
|
-
# 4)
|
11
|
+
# 4) expect{ Person.find_by_ids(22, 23, 24) }.to use_cache(Person).times(3)
|
12
12
|
# _should perform exactly three calls (hit/miss) to any of the cache strategies for the Person model_
|
13
13
|
RSpec::Matchers.define :use_cache do |model|
|
14
14
|
|
15
|
+
def supports_block_expectations?
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
15
19
|
chain :on do |strategy|
|
16
20
|
@strategy = strategy
|
17
21
|
end
|
@@ -34,12 +38,12 @@ RSpec::Matchers.define :use_cache do |model|
|
|
34
38
|
@expected_nr_of_calls ? @nr_of_calls == @expected_nr_of_calls : @nr_of_calls > 0
|
35
39
|
end
|
36
40
|
|
37
|
-
|
41
|
+
failure_message do |proc|
|
38
42
|
prepare_message
|
39
43
|
"Expected #{@strategy_msg} for #{model.name} to be called #{@times_msg}, but found #{@nr_of_calls}: #{@statistics_msg}"
|
40
44
|
end
|
41
45
|
|
42
|
-
|
46
|
+
failure_message_when_negated do |proc|
|
43
47
|
prepare_message
|
44
48
|
"Expected #{@strategy_msg} for #{model.name} not to be called #{@times_msg}, but found #{@nr_of_calls}: #{@statistics_msg}"
|
45
49
|
end
|
metadata
CHANGED
@@ -1,173 +1,162 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: record-cache
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 2
|
10
|
-
version: 0.1.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Orslumen
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-09-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: rails
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 7
|
29
|
-
segments:
|
30
|
-
- 3
|
31
|
-
- 0
|
32
|
-
version: "3.0"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>'
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
33
20
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: activerecord
|
37
21
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>'
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
48
34
|
type: :development
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: sqlite3
|
52
35
|
prerelease: false
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activerecord
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>'
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
62
48
|
type: :development
|
63
|
-
version_requirements: *id003
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
|
-
name: rake
|
66
49
|
prerelease: false
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>'
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sqlite3
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
76
62
|
type: :development
|
77
|
-
version_requirements: *id004
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: rcov
|
80
63
|
prerelease: false
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
90
76
|
type: :development
|
91
|
-
version_requirements: *id005
|
92
|
-
- !ruby/object:Gem::Dependency
|
93
|
-
name: rspec
|
94
77
|
prerelease: false
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
104
90
|
type: :development
|
105
|
-
version_requirements: *id006
|
106
|
-
- !ruby/object:Gem::Dependency
|
107
|
-
name: rr
|
108
91
|
prerelease: false
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.0'
|
118
104
|
type: :development
|
119
|
-
version_requirements: *id007
|
120
|
-
- !ruby/object:Gem::Dependency
|
121
|
-
name: database_cleaner
|
122
105
|
prerelease: false
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: database_cleaner
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
132
118
|
type: :development
|
133
|
-
version_requirements: *id008
|
134
|
-
- !ruby/object:Gem::Dependency
|
135
|
-
name: rdoc
|
136
119
|
prerelease: false
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: appraisal
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
146
132
|
type: :development
|
147
|
-
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ! '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
148
139
|
description: Record Cache for Rails 3
|
149
140
|
email: orslumen@gmail.com
|
150
141
|
executables: []
|
151
|
-
|
152
142
|
extensions: []
|
153
|
-
|
154
143
|
extra_rdoc_files: []
|
155
|
-
|
156
|
-
files:
|
144
|
+
files:
|
157
145
|
- lib/record-cache.rb
|
158
146
|
- lib/record_cache.rb
|
159
147
|
- lib/record_cache/base.rb
|
160
148
|
- lib/record_cache/datastore/active_record.rb
|
161
149
|
- lib/record_cache/datastore/active_record_30.rb
|
162
150
|
- lib/record_cache/datastore/active_record_31.rb
|
151
|
+
- lib/record_cache/datastore/active_record_32.rb
|
163
152
|
- lib/record_cache/dispatcher.rb
|
164
153
|
- lib/record_cache/multi_read.rb
|
165
154
|
- lib/record_cache/query.rb
|
166
155
|
- lib/record_cache/statistics.rb
|
167
156
|
- lib/record_cache/strategy/base.rb
|
168
|
-
- lib/record_cache/strategy/
|
157
|
+
- lib/record_cache/strategy/full_table_cache.rb
|
169
158
|
- lib/record_cache/strategy/index_cache.rb
|
170
|
-
- lib/record_cache/strategy/
|
159
|
+
- lib/record_cache/strategy/unique_index_cache.rb
|
171
160
|
- lib/record_cache/strategy/util.rb
|
172
161
|
- lib/record_cache/test/resettable_version_store.rb
|
173
162
|
- lib/record_cache/version.rb
|
@@ -176,81 +165,87 @@ files:
|
|
176
165
|
- spec/db/schema.rb
|
177
166
|
- spec/db/seeds.rb
|
178
167
|
- spec/initializers/record_cache.rb
|
168
|
+
- spec/lib/active_record/visitor_spec.rb
|
169
|
+
- spec/lib/base_spec.rb
|
179
170
|
- spec/lib/dispatcher_spec.rb
|
180
171
|
- spec/lib/multi_read_spec.rb
|
181
172
|
- spec/lib/query_spec.rb
|
182
173
|
- spec/lib/statistics_spec.rb
|
183
174
|
- spec/lib/strategy/base_spec.rb
|
184
|
-
- spec/lib/strategy/
|
175
|
+
- spec/lib/strategy/full_table_cache_spec.rb
|
185
176
|
- spec/lib/strategy/index_cache_spec.rb
|
186
|
-
- spec/lib/strategy/
|
177
|
+
- spec/lib/strategy/query_cache_spec.rb
|
178
|
+
- spec/lib/strategy/unique_index_on_id_cache_spec.rb
|
179
|
+
- spec/lib/strategy/unique_index_on_string_cache_spec.rb
|
187
180
|
- spec/lib/strategy/util_spec.rb
|
188
181
|
- spec/lib/version_store_spec.rb
|
182
|
+
- spec/models/address.rb
|
189
183
|
- spec/models/apple.rb
|
190
184
|
- spec/models/banana.rb
|
185
|
+
- spec/models/language.rb
|
191
186
|
- spec/models/pear.rb
|
192
187
|
- spec/models/person.rb
|
193
188
|
- spec/models/store.rb
|
194
189
|
- spec/spec_helper.rb
|
195
190
|
- spec/support/after_commit.rb
|
196
191
|
- spec/support/matchers/hit_cache_matcher.rb
|
192
|
+
- spec/support/matchers/log.rb
|
197
193
|
- spec/support/matchers/miss_cache_matcher.rb
|
198
194
|
- spec/support/matchers/use_cache_matcher.rb
|
199
195
|
homepage: https://github.com/orslumen/record-cache
|
200
|
-
licenses:
|
201
|
-
|
196
|
+
licenses:
|
197
|
+
- MIT
|
198
|
+
metadata: {}
|
202
199
|
post_install_message:
|
203
|
-
rdoc_options:
|
204
|
-
|
205
|
-
require_paths:
|
200
|
+
rdoc_options: []
|
201
|
+
require_paths:
|
206
202
|
- lib
|
207
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
none: false
|
218
|
-
requirements:
|
219
|
-
- - ">="
|
220
|
-
- !ruby/object:Gem::Version
|
221
|
-
hash: 3
|
222
|
-
segments:
|
223
|
-
- 0
|
224
|
-
version: "0"
|
203
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ! '>='
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
|
+
requirements:
|
210
|
+
- - ! '>='
|
211
|
+
- !ruby/object:Gem::Version
|
212
|
+
version: '0'
|
225
213
|
requirements: []
|
226
|
-
|
227
214
|
rubyforge_project:
|
228
|
-
rubygems_version: 1.
|
215
|
+
rubygems_version: 2.1.11
|
229
216
|
signing_key:
|
230
|
-
specification_version:
|
231
|
-
summary: Record Cache v0.1.
|
232
|
-
|
217
|
+
specification_version: 4
|
218
|
+
summary: Record Cache v0.1.3 transparantly stores Records in a Cache Store and retrieve
|
219
|
+
those Records from the store when queried using Active Model.
|
220
|
+
test_files:
|
233
221
|
- spec/db/database.yml
|
234
222
|
- spec/db/schema.rb
|
235
223
|
- spec/db/seeds.rb
|
236
224
|
- spec/initializers/record_cache.rb
|
225
|
+
- spec/lib/active_record/visitor_spec.rb
|
226
|
+
- spec/lib/base_spec.rb
|
237
227
|
- spec/lib/dispatcher_spec.rb
|
238
228
|
- spec/lib/multi_read_spec.rb
|
239
229
|
- spec/lib/query_spec.rb
|
240
230
|
- spec/lib/statistics_spec.rb
|
241
231
|
- spec/lib/strategy/base_spec.rb
|
242
|
-
- spec/lib/strategy/
|
232
|
+
- spec/lib/strategy/full_table_cache_spec.rb
|
243
233
|
- spec/lib/strategy/index_cache_spec.rb
|
244
|
-
- spec/lib/strategy/
|
234
|
+
- spec/lib/strategy/query_cache_spec.rb
|
235
|
+
- spec/lib/strategy/unique_index_on_id_cache_spec.rb
|
236
|
+
- spec/lib/strategy/unique_index_on_string_cache_spec.rb
|
245
237
|
- spec/lib/strategy/util_spec.rb
|
246
238
|
- spec/lib/version_store_spec.rb
|
239
|
+
- spec/models/address.rb
|
247
240
|
- spec/models/apple.rb
|
248
241
|
- spec/models/banana.rb
|
242
|
+
- spec/models/language.rb
|
249
243
|
- spec/models/pear.rb
|
250
244
|
- spec/models/person.rb
|
251
245
|
- spec/models/store.rb
|
252
246
|
- spec/spec_helper.rb
|
253
247
|
- spec/support/after_commit.rb
|
254
248
|
- spec/support/matchers/hit_cache_matcher.rb
|
249
|
+
- spec/support/matchers/log.rb
|
255
250
|
- spec/support/matchers/miss_cache_matcher.rb
|
256
251
|
- spec/support/matchers/use_cache_matcher.rb
|