kasket 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -17,6 +17,7 @@ tmtags
17
17
  coverage
18
18
  rdoc
19
19
  pkg
20
+ .rvmrc
20
21
 
21
22
  ## PROJECT::SPECIFIC
22
23
  test/debug.log
data/kasket.gemspec ADDED
@@ -0,0 +1,90 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{kasket}
8
+ s.version = "0.8.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Mick Staugaard", "Eric Chapweske"]
12
+ s.date = %q{2010-08-24}
13
+ s.description = %q{puts a cap on your queries}
14
+ s.email = %q{mick@staugaard.com}
15
+ s.extra_rdoc_files = [
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ ".document",
20
+ ".gitignore",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "kasket.gemspec",
24
+ "lib/kasket.rb",
25
+ "lib/kasket/active_record_patches.rb",
26
+ "lib/kasket/configuration_mixin.rb",
27
+ "lib/kasket/dirty_mixin.rb",
28
+ "lib/kasket/query_parser.rb",
29
+ "lib/kasket/read_mixin.rb",
30
+ "lib/kasket/reload_association_mixin.rb",
31
+ "lib/kasket/write_mixin.rb",
32
+ "test/cache_expiry_test.rb",
33
+ "test/configuration_mixin_test.rb",
34
+ "test/database.yml",
35
+ "test/dirty_test.rb",
36
+ "test/find_one_test.rb",
37
+ "test/find_some_test.rb",
38
+ "test/fixtures/blogs.yml",
39
+ "test/fixtures/comments.yml",
40
+ "test/fixtures/posts.yml",
41
+ "test/helper.rb",
42
+ "test/parser_test.rb",
43
+ "test/read_mixin_test.rb",
44
+ "test/test_models.rb",
45
+ "test/transaction_test.rb"
46
+ ]
47
+ s.homepage = %q{http://github.com/staugaard/kasket}
48
+ s.rdoc_options = ["--charset=UTF-8"]
49
+ s.require_paths = ["lib"]
50
+ s.rubygems_version = %q{1.3.7}
51
+ s.summary = %q{A write back caching layer on active record}
52
+ s.test_files = [
53
+ "test/cache_expiry_test.rb",
54
+ "test/configuration_mixin_test.rb",
55
+ "test/dirty_test.rb",
56
+ "test/find_one_test.rb",
57
+ "test/find_some_test.rb",
58
+ "test/helper.rb",
59
+ "test/parser_test.rb",
60
+ "test/read_mixin_test.rb",
61
+ "test/test_models.rb",
62
+ "test/transaction_test.rb"
63
+ ]
64
+
65
+ if s.respond_to? :specification_version then
66
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
67
+ s.specification_version = 3
68
+
69
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
70
+ s.add_runtime_dependency(%q<activerecord>, [">= 2.3.4"])
71
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.3.4"])
72
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
73
+ s.add_development_dependency(%q<mocha>, [">= 0"])
74
+ s.add_development_dependency(%q<temping>, [">= 1.3.0"])
75
+ else
76
+ s.add_dependency(%q<activerecord>, [">= 2.3.4"])
77
+ s.add_dependency(%q<activesupport>, [">= 2.3.4"])
78
+ s.add_dependency(%q<shoulda>, [">= 0"])
79
+ s.add_dependency(%q<mocha>, [">= 0"])
80
+ s.add_dependency(%q<temping>, [">= 1.3.0"])
81
+ end
82
+ else
83
+ s.add_dependency(%q<activerecord>, [">= 2.3.4"])
84
+ s.add_dependency(%q<activesupport>, [">= 2.3.4"])
85
+ s.add_dependency(%q<shoulda>, [">= 0"])
86
+ s.add_dependency(%q<mocha>, [">= 0"])
87
+ s.add_dependency(%q<temping>, [">= 1.3.0"])
88
+ end
89
+ end
90
+
data/lib/kasket.rb CHANGED
@@ -14,7 +14,7 @@ module Kasket
14
14
  class Version
15
15
  MAJOR = 0
16
16
  MINOR = 8
17
- PATCH = 0
17
+ PATCH = 1
18
18
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
19
19
  end
20
20
 
@@ -28,11 +28,11 @@ module Kasket
28
28
  key_value_map = Rails.cache.read_multi(*query[:key])
29
29
  missing_ids = []
30
30
 
31
- key_value_map.each do |key, value|
32
- if value.nil?
33
- missing_ids << key.split('=').last.to_i
34
- else
31
+ query[:key].each do |key|
32
+ if value = key_value_map[key]
35
33
  key_value_map[key] = instantiate(value.dup)
34
+ else
35
+ missing_ids << key.split('=').last.to_i
36
36
  end
37
37
  end
38
38
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kasket
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 0
10
- version: 0.8.0
9
+ - 1
10
+ version: 0.8.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mick Staugaard
@@ -108,6 +108,7 @@ files:
108
108
  - .gitignore
109
109
  - README.rdoc
110
110
  - Rakefile
111
+ - kasket.gemspec
111
112
  - lib/kasket.rb
112
113
  - lib/kasket/active_record_patches.rb
113
114
  - lib/kasket/configuration_mixin.rb