simple_cacheable 1.1.5 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,3 +2,12 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in cacheable.gemspec
4
4
  gemspec
5
+
6
+ platforms :ruby do
7
+ gem "sqlite3-ruby"
8
+ end
9
+
10
+ platforms :jruby do
11
+ gem "activerecord-jdbc-adapter"
12
+ gem "activerecord-jdbcsqlite3-adapter"
13
+ end
data/README.md CHANGED
@@ -4,7 +4,7 @@ cacheable
4
4
  cacheable is a simple cache implementation based on activerecord, it is
5
5
  extracted from [rails-bestpractices.com][1].
6
6
 
7
- it supports activerecord >= 3.0.0
7
+ it supports activerecord >= 3.0.0, works on 1.9.2, 1.9.3 and jruby.
8
8
 
9
9
  Introduction
10
10
  ------------
data/cacheable.gemspec CHANGED
@@ -15,7 +15,6 @@ Gem::Specification.new do |s|
15
15
  s.add_dependency("rails", ">= 3.0.0")
16
16
  s.add_development_dependency("rspec")
17
17
  s.add_development_dependency("mocha")
18
- s.add_development_dependency("sqlite3-ruby")
19
18
 
20
19
  s.files = `git ls-files`.split("\n")
21
20
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
data/lib/cacheable.rb CHANGED
@@ -64,6 +64,7 @@ module Cacheable
64
64
  association = reflect_on_association(association_name)
65
65
  if :belongs_to == association.macro
66
66
  polymorphic = association.options[:polymorphic]
67
+ polymorphic ||= false
67
68
  class_eval <<-EOF
68
69
  def cached_#{association_name}
69
70
  Rails.cache.fetch belong_association_cache_key("#{association_name}", #{polymorphic}) do
@@ -1,3 +1,3 @@
1
1
  module Cacheable
2
- VERSION = "1.1.5"
2
+ VERSION = "1.2.0"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
4
4
  require 'rails'
5
5
  require 'active_record'
6
6
  require 'rspec'
7
- require 'mocha'
7
+ require 'mocha_standalone'
8
8
 
9
9
  require 'cacheable'
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_cacheable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-28 00:00:00.000000000Z
12
+ date: 2012-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70220191384840 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 3.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70220191384840
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.0.0
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rspec
27
- requirement: &70220191384420 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70220191384420
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: mocha
38
- requirement: &70220191414920 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,18 +53,12 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70220191414920
47
- - !ruby/object:Gem::Dependency
48
- name: sqlite3-ruby
49
- requirement: &70220191414500 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
50
57
  none: false
51
58
  requirements:
52
59
  - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
- type: :development
56
- prerelease: false
57
- version_requirements: *70220191414500
58
62
  description: a simple cache implementation based on activerecord
59
63
  email:
60
64
  - flyerhzm@gmail.com
@@ -89,15 +93,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
93
  - - ! '>='
90
94
  - !ruby/object:Gem::Version
91
95
  version: '0'
96
+ segments:
97
+ - 0
98
+ hash: -1878933439133819997
92
99
  required_rubygems_version: !ruby/object:Gem::Requirement
93
100
  none: false
94
101
  requirements:
95
102
  - - ! '>='
96
103
  - !ruby/object:Gem::Version
97
104
  version: '0'
105
+ segments:
106
+ - 0
107
+ hash: -1878933439133819997
98
108
  requirements: []
99
109
  rubyforge_project:
100
- rubygems_version: 1.8.15
110
+ rubygems_version: 1.8.24
101
111
  signing_key:
102
112
  specification_version: 3
103
113
  summary: a simple cache implementation based on activerecord