cache-machine 0.2.0 → 0.2.1
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.
- data/Gemfile +1 -6
- data/Gemfile.lock +70 -63
- data/cache-machine.gemspec +5 -5
- data/lib/cache_machine/cache/collection.rb +5 -4
- data/spec/lib/cache_machine/cache/collection_spec.rb +10 -4
- metadata +7 -7
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,73 +1,76 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
rack (~> 1.
|
15
|
-
rack-mount (~> 0.
|
16
|
-
rack-test (~> 0.
|
17
|
-
|
18
|
-
activemodel (3.
|
19
|
-
activesupport (= 3.
|
20
|
-
builder (~>
|
21
|
-
i18n (~> 0.
|
22
|
-
activerecord (3.
|
23
|
-
activemodel (= 3.
|
24
|
-
activesupport (= 3.
|
25
|
-
arel (~> 2.
|
26
|
-
tzinfo (~> 0.3.
|
27
|
-
activeresource (3.
|
28
|
-
activemodel (= 3.
|
29
|
-
activesupport (= 3.
|
30
|
-
activesupport (3.
|
31
|
-
|
32
|
-
|
4
|
+
actionmailer (3.1.4)
|
5
|
+
actionpack (= 3.1.4)
|
6
|
+
mail (~> 2.3.0)
|
7
|
+
actionpack (3.1.4)
|
8
|
+
activemodel (= 3.1.4)
|
9
|
+
activesupport (= 3.1.4)
|
10
|
+
builder (~> 3.0.0)
|
11
|
+
erubis (~> 2.7.0)
|
12
|
+
i18n (~> 0.6)
|
13
|
+
rack (~> 1.3.6)
|
14
|
+
rack-cache (~> 1.1)
|
15
|
+
rack-mount (~> 0.8.2)
|
16
|
+
rack-test (~> 0.6.1)
|
17
|
+
sprockets (~> 2.0.3)
|
18
|
+
activemodel (3.1.4)
|
19
|
+
activesupport (= 3.1.4)
|
20
|
+
builder (~> 3.0.0)
|
21
|
+
i18n (~> 0.6)
|
22
|
+
activerecord (3.1.4)
|
23
|
+
activemodel (= 3.1.4)
|
24
|
+
activesupport (= 3.1.4)
|
25
|
+
arel (~> 2.2.3)
|
26
|
+
tzinfo (~> 0.3.29)
|
27
|
+
activeresource (3.1.4)
|
28
|
+
activemodel (= 3.1.4)
|
29
|
+
activesupport (= 3.1.4)
|
30
|
+
activesupport (3.1.4)
|
31
|
+
multi_json (~> 1.0)
|
32
|
+
arel (2.2.3)
|
33
|
+
builder (3.0.0)
|
33
34
|
diff-lcs (1.1.2)
|
34
|
-
erubis (2.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
bundler (~> 1.0)
|
40
|
-
git (>= 1.2.5)
|
41
|
-
rake
|
42
|
-
mail (2.2.19)
|
43
|
-
activesupport (>= 2.3.6)
|
35
|
+
erubis (2.7.0)
|
36
|
+
hike (1.2.1)
|
37
|
+
i18n (0.6.0)
|
38
|
+
json (1.6.5)
|
39
|
+
mail (2.3.3)
|
44
40
|
i18n (>= 0.4.0)
|
45
41
|
mime-types (~> 1.16)
|
46
42
|
treetop (~> 1.4.8)
|
47
|
-
mime-types (1.
|
48
|
-
|
49
|
-
|
50
|
-
rack
|
43
|
+
mime-types (1.17.2)
|
44
|
+
multi_json (1.1.0)
|
45
|
+
polyglot (0.3.3)
|
46
|
+
rack (1.3.6)
|
47
|
+
rack-cache (1.2)
|
48
|
+
rack (>= 0.4)
|
49
|
+
rack-mount (0.8.3)
|
51
50
|
rack (>= 1.0.0)
|
52
|
-
rack-
|
51
|
+
rack-ssl (1.3.2)
|
52
|
+
rack
|
53
|
+
rack-test (0.6.1)
|
53
54
|
rack (>= 1.0)
|
54
|
-
rails (3.
|
55
|
-
actionmailer (= 3.
|
56
|
-
actionpack (= 3.
|
57
|
-
activerecord (= 3.
|
58
|
-
activeresource (= 3.
|
59
|
-
activesupport (= 3.
|
55
|
+
rails (3.1.4)
|
56
|
+
actionmailer (= 3.1.4)
|
57
|
+
actionpack (= 3.1.4)
|
58
|
+
activerecord (= 3.1.4)
|
59
|
+
activeresource (= 3.1.4)
|
60
|
+
activesupport (= 3.1.4)
|
60
61
|
bundler (~> 1.0)
|
61
|
-
railties (= 3.
|
62
|
-
railties (3.
|
63
|
-
actionpack (= 3.
|
64
|
-
activesupport (= 3.
|
62
|
+
railties (= 3.1.4)
|
63
|
+
railties (3.1.4)
|
64
|
+
actionpack (= 3.1.4)
|
65
|
+
activesupport (= 3.1.4)
|
66
|
+
rack-ssl (~> 1.3.2)
|
65
67
|
rake (>= 0.8.7)
|
66
68
|
rdoc (~> 3.4)
|
67
|
-
thor (~> 0.14.
|
68
|
-
rake (0.9.2)
|
69
|
+
thor (~> 0.14.6)
|
70
|
+
rake (0.9.2.2)
|
69
71
|
rcov (0.9.9)
|
70
|
-
rdoc (3.
|
72
|
+
rdoc (3.12)
|
73
|
+
json (~> 1.4)
|
71
74
|
rspec (2.6.0)
|
72
75
|
rspec-core (~> 2.6.0)
|
73
76
|
rspec-expectations (~> 2.6.0)
|
@@ -81,21 +84,25 @@ GEM
|
|
81
84
|
activesupport (~> 3.0)
|
82
85
|
railties (~> 3.0)
|
83
86
|
rspec (~> 2.6.0)
|
84
|
-
|
87
|
+
sprockets (2.0.3)
|
88
|
+
hike (~> 1.2)
|
89
|
+
rack (~> 1.0)
|
90
|
+
tilt (~> 1.1, != 1.3.0)
|
91
|
+
sqlite3 (1.3.5)
|
85
92
|
sqlite3-ruby (1.3.3)
|
86
93
|
sqlite3 (>= 1.3.3)
|
87
94
|
thor (0.14.6)
|
88
|
-
|
95
|
+
tilt (1.3.3)
|
96
|
+
treetop (1.4.10)
|
97
|
+
polyglot
|
89
98
|
polyglot (>= 0.3.1)
|
90
|
-
tzinfo (0.3.
|
99
|
+
tzinfo (0.3.32)
|
91
100
|
|
92
101
|
PLATFORMS
|
93
102
|
ruby
|
94
103
|
|
95
104
|
DEPENDENCIES
|
96
|
-
|
97
|
-
jeweler (~> 1.6.2)
|
98
|
-
rails
|
105
|
+
rails (= 3.1.4)
|
99
106
|
rcov
|
100
107
|
rspec
|
101
108
|
rspec-rails
|
data/cache-machine.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{cache-machine}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Sergei Zinin", "Kevin Goslar"]
|
9
|
-
s.date = %q{2012-03-
|
9
|
+
s.date = %q{2012-03-19}
|
10
10
|
s.description = %q{A Ruby on Rails framework to support cache management based on explicitely modeled caching dependencies.}
|
11
11
|
s.email = %q{szinin@partyearth.com}
|
12
12
|
s.extra_rdoc_files = %w{LICENSE.txt README.md}
|
@@ -22,13 +22,13 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
24
24
|
s.add_runtime_dependency(%q<rails>, [">= 3"])
|
25
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.0.
|
25
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.21"])
|
26
26
|
else
|
27
27
|
s.add_dependency(%q<rails>, [">= 3"])
|
28
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.
|
28
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.21"])
|
29
29
|
end
|
30
30
|
else
|
31
31
|
s.add_dependency(%q<rails>, [">= 3"])
|
32
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.
|
32
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.21"])
|
33
33
|
end
|
34
34
|
end
|
@@ -93,11 +93,12 @@ module CacheMachine
|
|
93
93
|
# Bind callbacks.
|
94
94
|
[*options[:on]].each { |callback| self.send(callback, &reset_cache_proc) }
|
95
95
|
|
96
|
+
#ext = Proc.new { |collection_instance|
|
97
|
+
# collection_instance.update_cache_map!(self, collection_name)
|
98
|
+
#}
|
99
|
+
|
96
100
|
# When new element appears - update maps.
|
97
|
-
|
98
|
-
:after_add => lambda { |resource_instance, collection_instance|
|
99
|
-
collection_instance.update_cache_map!(resource_instance, collection_name)
|
100
|
-
})
|
101
|
+
# ActiveRecord::Associations::Builder::CollectionAssociation.build(cache_resource, collection_name, {}, &ext)
|
101
102
|
|
102
103
|
# Hook on '<<', 'concat' operations.
|
103
104
|
#cache_resource.send(:add_association_callbacks, collection_name,
|
@@ -39,8 +39,10 @@ describe CacheMachine::Cache::Collection do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it "hooks update_map callback" do
|
42
|
-
|
43
|
-
|
42
|
+
pending "AfterAdd deprecated" do
|
43
|
+
Join.any_instance.should_receive(:update_cache_map!).once.with(cacher, :joins)
|
44
|
+
cacher.joins.create
|
45
|
+
end
|
44
46
|
end
|
45
47
|
end
|
46
48
|
|
@@ -50,11 +52,15 @@ describe CacheMachine::Cache::Collection do
|
|
50
52
|
end
|
51
53
|
|
52
54
|
it "updates direct association map" do
|
53
|
-
|
55
|
+
pending "AfterAdd deprecated" do
|
56
|
+
CacheMachine::Cache.map_adapter.should_receive(:append_id_to_map).with(cacher, :joins, kind_of(Numeric))
|
57
|
+
end
|
54
58
|
end
|
55
59
|
|
56
60
|
it "updates reverse collection map" do
|
57
|
-
|
61
|
+
pending "AfterAdd deprecated!" do
|
62
|
+
CacheMachine::Cache.map_adapter.should_receive(:append_id_to_reverse_map).with(Cacher, :joins, kind_of(Join), cacher.id)
|
63
|
+
end
|
58
64
|
end
|
59
65
|
end
|
60
66
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cache-machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sergei Zinin
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-03-
|
19
|
+
date: 2012-03-19 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rails
|
@@ -40,12 +40,12 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
hash:
|
43
|
+
hash: 61
|
44
44
|
segments:
|
45
45
|
- 1
|
46
46
|
- 0
|
47
|
-
-
|
48
|
-
version: 1.0.
|
47
|
+
- 21
|
48
|
+
version: 1.0.21
|
49
49
|
type: :development
|
50
50
|
version_requirements: *id002
|
51
51
|
description: A Ruby on Rails framework to support cache management based on explicitely modeled caching dependencies.
|