simple_cacheable 1.4.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82a842613fa2c2177a47105e827c286a0c959e4e
4
- data.tar.gz: 21bcf0508eb353b7f4899392f47951138a4a3f3d
3
+ metadata.gz: 87dfaba75352a1ad0723253e70dc284bb7e5be24
4
+ data.tar.gz: f7cf5fcd01962777884b277f0c5cc882d1c91155
5
5
  SHA512:
6
- metadata.gz: 8aef917182c022c49718748fef29f2b1b9152526d2de85021ccff9082386d3620ef867fe677a5c087c99ccbdb63cf3b4067a032db497ab6db728d3a5fc357edd
7
- data.tar.gz: 046e1c0509df6ee8ad09a35865515ada8927018881b333fe2698146aa561c0f5ff2e237a750eee1a0a08ef5550adb298907a64f34e44239d4750dafe178eab0b
6
+ metadata.gz: cce398f40d4d4ac785b5ec0b497ac94fe2c9b6994793cb8ca2d3f7897df5f2ffce9bcad2e9476966a56644cfc1755a693b19940c120f9b2b3329111e2b751e81
7
+ data.tar.gz: 74922005637353c9f67739702c2cd1f16ac8b8b23fc4890d43d57a0a9e5a5908b49c2dac61049efbb37e06b20eb6b174e8860a0e78267db581b0e966d12129ec
@@ -1,7 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.0.0
5
4
  env: DB=sqlite
6
- service:
5
+ services:
7
6
  - memcached
7
+ gemfile:
8
+ - gemfiles/3.2.gemfile
9
+ - gemfiles/4.0.gemfile
@@ -0,0 +1,7 @@
1
+ appraise "3.2" do
2
+ gem "rails", "~> 3.2.16"
3
+ end
4
+
5
+ appraise "4.0" do
6
+ gem "rails", "~> 4.0.0"
7
+ end
data/ChangeLog CHANGED
@@ -1,3 +1,12 @@
1
+ 1.5.0
2
+ * Better polymorphic support
3
+ * Memoization of all lookups to stop repeats
4
+ * Marshalling of AR objects fixed
5
+ * friendly with FriendlyID and slugs
6
+ * Tested against Rails 4 and 3.2
7
+ * Cache implementation for outside use with marshal handling
8
+ * Methods handle all argument datatypes
9
+
1
10
  1.4.1
2
11
  * Fixed all silent failures for assocations that didn't exist
3
12
 
data/Gemfile CHANGED
@@ -3,13 +3,14 @@ source "http://rubygems.org"
3
3
  # Specify your gem's dependencies in cacheable.gemspec
4
4
  gemspec
5
5
 
6
- platforms :ruby do
7
- gem "sqlite3"
8
- gem "memcached"
9
- end
6
+ gem 'appraisal'
7
+ gem "sqlite3"
8
+ gem "memcached"
10
9
 
11
- platforms :jruby do
12
- gem "activerecord-jdbc-adapter"
13
- gem "activerecord-jdbcsqlite3-adapter"
14
- gem "jruby-memcached"
15
- end
10
+ # TODO: Appraisal Platforms coming
11
+ # https://github.com/thoughtbot/appraisal/pull/69
12
+ # platforms :jruby do
13
+ # gem "activerecord-jdbc-adapter"
14
+ # gem "activerecord-jdbcsqlite3-adapter"
15
+ # gem "jruby-memcached"
16
+ # end
@@ -1,78 +1,77 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_cacheable (1.4.0)
5
- rails (>= 3.0.0)
4
+ simple_cacheable (1.5.0)
5
+ rails (>= 3)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- actionmailer (4.0.0)
11
- actionpack (= 4.0.0)
12
- mail (~> 2.5.3)
13
- actionpack (4.0.0)
14
- activesupport (= 4.0.0)
10
+ actionmailer (4.0.2)
11
+ actionpack (= 4.0.2)
12
+ mail (~> 2.5.4)
13
+ actionpack (4.0.2)
14
+ activesupport (= 4.0.2)
15
15
  builder (~> 3.1.0)
16
16
  erubis (~> 2.7.0)
17
17
  rack (~> 1.5.2)
18
18
  rack-test (~> 0.6.2)
19
- activemodel (4.0.0)
20
- activesupport (= 4.0.0)
19
+ activemodel (4.0.2)
20
+ activesupport (= 4.0.2)
21
21
  builder (~> 3.1.0)
22
- activerecord (4.0.0)
23
- activemodel (= 4.0.0)
22
+ activerecord (4.0.2)
23
+ activemodel (= 4.0.2)
24
24
  activerecord-deprecated_finders (~> 1.0.2)
25
- activesupport (= 4.0.0)
25
+ activesupport (= 4.0.2)
26
26
  arel (~> 4.0.0)
27
27
  activerecord-deprecated_finders (1.0.3)
28
- activerecord-jdbc-adapter (1.2.9.1)
29
- activerecord-jdbcsqlite3-adapter (1.2.9)
30
- activerecord-jdbc-adapter (~> 1.2.9)
31
- jdbc-sqlite3 (~> 3.7.2)
32
- activesupport (4.0.0)
28
+ activesupport (4.0.2)
33
29
  i18n (~> 0.6, >= 0.6.4)
34
30
  minitest (~> 4.2)
35
31
  multi_json (~> 1.3)
36
32
  thread_safe (~> 0.1)
37
33
  tzinfo (~> 0.3.37)
38
- arel (4.0.0)
39
- atomic (1.1.10)
40
- atomic (1.1.10-java)
34
+ appraisal (0.5.2)
35
+ bundler
36
+ rake
37
+ arel (4.0.1)
38
+ atomic (1.1.14)
39
+ atomic (1.1.14-java)
41
40
  builder (3.1.4)
42
41
  diff-lcs (1.1.3)
43
42
  erubis (2.7.0)
43
+ friendly_id (5.0.2)
44
+ activerecord (~> 4.0.0)
44
45
  hike (1.2.3)
45
- i18n (0.6.4)
46
- jdbc-sqlite3 (3.7.2.1)
47
- jruby-memcached (0.5.5)
46
+ i18n (0.6.9)
48
47
  mail (2.5.4)
49
48
  mime-types (~> 1.16)
50
49
  treetop (~> 1.4.8)
51
- memcached (1.6.1)
50
+ memcached (1.7.0)
52
51
  metaclass (0.0.1)
53
- mime-types (1.23)
52
+ mime-types (1.25.1)
54
53
  minitest (4.7.5)
55
54
  mocha (0.10.5)
56
55
  metaclass (~> 0.0.1)
57
- multi_json (1.7.7)
56
+ multi_json (1.8.4)
58
57
  polyglot (0.3.3)
59
58
  rack (1.5.2)
60
59
  rack-test (0.6.2)
61
60
  rack (>= 1.0)
62
- rails (4.0.0)
63
- actionmailer (= 4.0.0)
64
- actionpack (= 4.0.0)
65
- activerecord (= 4.0.0)
66
- activesupport (= 4.0.0)
61
+ rails (4.0.2)
62
+ actionmailer (= 4.0.2)
63
+ actionpack (= 4.0.2)
64
+ activerecord (= 4.0.2)
65
+ activesupport (= 4.0.2)
67
66
  bundler (>= 1.3.0, < 2.0)
68
- railties (= 4.0.0)
67
+ railties (= 4.0.2)
69
68
  sprockets-rails (~> 2.0.0)
70
- railties (4.0.0)
71
- actionpack (= 4.0.0)
72
- activesupport (= 4.0.0)
69
+ railties (4.0.2)
70
+ actionpack (= 4.0.2)
71
+ activesupport (= 4.0.2)
73
72
  rake (>= 0.8.7)
74
73
  thor (>= 0.18.1, < 2.0)
75
- rake (10.1.0)
74
+ rake (10.1.1)
76
75
  rspec (2.8.0)
77
76
  rspec-core (~> 2.8.0)
78
77
  rspec-expectations (~> 2.8.0)
@@ -81,35 +80,34 @@ GEM
81
80
  rspec-expectations (2.8.0)
82
81
  diff-lcs (~> 1.1.2)
83
82
  rspec-mocks (2.8.0)
84
- sprockets (2.10.0)
83
+ sprockets (2.10.1)
85
84
  hike (~> 1.2)
86
85
  multi_json (~> 1.0)
87
86
  rack (~> 1.0)
88
87
  tilt (~> 1.1, != 1.3.0)
89
- sprockets-rails (2.0.0)
88
+ sprockets-rails (2.0.1)
90
89
  actionpack (>= 3.0)
91
90
  activesupport (>= 3.0)
92
91
  sprockets (~> 2.8)
93
- sqlite3 (1.3.7)
92
+ sqlite3 (1.3.8)
94
93
  thor (0.18.1)
95
- thread_safe (0.1.2)
94
+ thread_safe (0.1.3)
96
95
  atomic
97
- thread_safe (0.1.2-java)
96
+ thread_safe (0.1.3-java)
98
97
  atomic
99
98
  tilt (1.4.1)
100
- treetop (1.4.14)
99
+ treetop (1.4.15)
101
100
  polyglot
102
101
  polyglot (>= 0.3.1)
103
- tzinfo (0.3.37)
102
+ tzinfo (0.3.38)
104
103
 
105
104
  PLATFORMS
106
105
  java
107
106
  ruby
108
107
 
109
108
  DEPENDENCIES
110
- activerecord-jdbc-adapter
111
- activerecord-jdbcsqlite3-adapter
112
- jruby-memcached
109
+ appraisal
110
+ friendly_id
113
111
  memcached
114
112
  mocha (= 0.10.5)
115
113
  rspec (= 2.8)
data/README.md CHANGED
@@ -63,6 +63,16 @@ Usage
63
63
  end
64
64
  end
65
65
 
66
+ Advanced Usage
67
+ --------------
68
+
69
+ ````ruby
70
+ # Utilize Simple Cacheable to cache ActiveRecord objects without marshalling errors
71
+ Cacheable.fetch "collection_of_twelve_users", expires_in: 1.day do
72
+ User.limit(12)
73
+ end
74
+ ````
75
+
66
76
  Install
67
77
  -------
68
78
 
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env rake
2
+
2
3
  require "bundler/gem_tasks"
4
+ require 'appraisal'
3
5
 
4
6
  require 'rspec/core/rake_task'
5
7
 
@@ -8,13 +8,15 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Richard Huang", "Scott Carleton"]
10
10
  s.email = ["flyerhzm@gmail.com", "scott@artsicle.com"]
11
- s.homepage = "https://github.com/flyerhzm/simple-cacheable"
11
+ s.homepage = "https://github.com/flyerhzm/simple_cacheable"
12
12
  s.summary = %q{a simple cache implementation based on activerecord}
13
13
  s.description = %q{a simple cache implementation based on activerecord}
14
+ s.license = "MIT"
14
15
 
15
- s.add_dependency("rails", ">= 3.0.0")
16
+ s.add_dependency("rails", ">= 3")
16
17
  s.add_development_dependency("rspec", "2.8")
17
18
  s.add_development_dependency("mocha", "0.10.5")
19
+ s.add_development_dependency("friendly_id")
18
20
 
19
21
  s.files = `git ls-files`.split("\n")
20
22
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "sqlite3"
7
+ gem "memcached"
8
+ gem "rails", "~> 3.2.16"
9
+
10
+ gemspec :path=>"../"
@@ -0,0 +1,117 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ simple_cacheable (1.4.1)
5
+ rails (>= 3)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ actionmailer (3.2.16)
11
+ actionpack (= 3.2.16)
12
+ mail (~> 2.5.4)
13
+ actionpack (3.2.16)
14
+ activemodel (= 3.2.16)
15
+ activesupport (= 3.2.16)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.4)
19
+ rack (~> 1.4.5)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.2.1)
23
+ activemodel (3.2.16)
24
+ activesupport (= 3.2.16)
25
+ builder (~> 3.0.0)
26
+ activerecord (3.2.16)
27
+ activemodel (= 3.2.16)
28
+ activesupport (= 3.2.16)
29
+ arel (~> 3.0.2)
30
+ tzinfo (~> 0.3.29)
31
+ activeresource (3.2.16)
32
+ activemodel (= 3.2.16)
33
+ activesupport (= 3.2.16)
34
+ activesupport (3.2.16)
35
+ i18n (~> 0.6, >= 0.6.4)
36
+ multi_json (~> 1.0)
37
+ appraisal (0.5.2)
38
+ bundler
39
+ rake
40
+ arel (3.0.3)
41
+ builder (3.0.4)
42
+ diff-lcs (1.1.3)
43
+ erubis (2.7.0)
44
+ friendly_id (4.0.10.1)
45
+ activerecord (>= 3.0, < 4.0)
46
+ hike (1.2.3)
47
+ i18n (0.6.9)
48
+ journey (1.0.4)
49
+ json (1.8.1)
50
+ mail (2.5.4)
51
+ mime-types (~> 1.16)
52
+ treetop (~> 1.4.8)
53
+ memcached (1.7.0)
54
+ metaclass (0.0.2)
55
+ mime-types (1.25.1)
56
+ mocha (0.10.5)
57
+ metaclass (~> 0.0.1)
58
+ multi_json (1.8.4)
59
+ polyglot (0.3.3)
60
+ rack (1.4.5)
61
+ rack-cache (1.2)
62
+ rack (>= 0.4)
63
+ rack-ssl (1.3.3)
64
+ rack
65
+ rack-test (0.6.2)
66
+ rack (>= 1.0)
67
+ rails (3.2.16)
68
+ actionmailer (= 3.2.16)
69
+ actionpack (= 3.2.16)
70
+ activerecord (= 3.2.16)
71
+ activeresource (= 3.2.16)
72
+ activesupport (= 3.2.16)
73
+ bundler (~> 1.0)
74
+ railties (= 3.2.16)
75
+ railties (3.2.16)
76
+ actionpack (= 3.2.16)
77
+ activesupport (= 3.2.16)
78
+ rack-ssl (~> 1.3.2)
79
+ rake (>= 0.8.7)
80
+ rdoc (~> 3.4)
81
+ thor (>= 0.14.6, < 2.0)
82
+ rake (10.1.1)
83
+ rdoc (3.12.2)
84
+ json (~> 1.4)
85
+ rspec (2.8.0)
86
+ rspec-core (~> 2.8.0)
87
+ rspec-expectations (~> 2.8.0)
88
+ rspec-mocks (~> 2.8.0)
89
+ rspec-core (2.8.0)
90
+ rspec-expectations (2.8.0)
91
+ diff-lcs (~> 1.1.2)
92
+ rspec-mocks (2.8.0)
93
+ sprockets (2.2.2)
94
+ hike (~> 1.2)
95
+ multi_json (~> 1.0)
96
+ rack (~> 1.0)
97
+ tilt (~> 1.1, != 1.3.0)
98
+ sqlite3 (1.3.8)
99
+ thor (0.18.1)
100
+ tilt (1.4.1)
101
+ treetop (1.4.15)
102
+ polyglot
103
+ polyglot (>= 0.3.1)
104
+ tzinfo (0.3.38)
105
+
106
+ PLATFORMS
107
+ ruby
108
+
109
+ DEPENDENCIES
110
+ appraisal
111
+ friendly_id
112
+ memcached
113
+ mocha (= 0.10.5)
114
+ rails (~> 3.2.16)
115
+ rspec (= 2.8)
116
+ simple_cacheable!
117
+ sqlite3
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "sqlite3"
7
+ gem "memcached"
8
+ gem "rails", "~> 4.0.0"
9
+
10
+ gemspec :path=>"../"
@@ -0,0 +1,112 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ simple_cacheable (1.4.1)
5
+ rails (>= 3)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ actionmailer (4.0.2)
11
+ actionpack (= 4.0.2)
12
+ mail (~> 2.5.4)
13
+ actionpack (4.0.2)
14
+ activesupport (= 4.0.2)
15
+ builder (~> 3.1.0)
16
+ erubis (~> 2.7.0)
17
+ rack (~> 1.5.2)
18
+ rack-test (~> 0.6.2)
19
+ activemodel (4.0.2)
20
+ activesupport (= 4.0.2)
21
+ builder (~> 3.1.0)
22
+ activerecord (4.0.2)
23
+ activemodel (= 4.0.2)
24
+ activerecord-deprecated_finders (~> 1.0.2)
25
+ activesupport (= 4.0.2)
26
+ arel (~> 4.0.0)
27
+ activerecord-deprecated_finders (1.0.3)
28
+ activesupport (4.0.2)
29
+ i18n (~> 0.6, >= 0.6.4)
30
+ minitest (~> 4.2)
31
+ multi_json (~> 1.3)
32
+ thread_safe (~> 0.1)
33
+ tzinfo (~> 0.3.37)
34
+ appraisal (0.5.2)
35
+ bundler
36
+ rake
37
+ arel (4.0.1)
38
+ atomic (1.1.14)
39
+ builder (3.1.4)
40
+ diff-lcs (1.1.3)
41
+ erubis (2.7.0)
42
+ friendly_id (5.0.2)
43
+ activerecord (~> 4.0.0)
44
+ hike (1.2.3)
45
+ i18n (0.6.9)
46
+ mail (2.5.4)
47
+ mime-types (~> 1.16)
48
+ treetop (~> 1.4.8)
49
+ memcached (1.7.0)
50
+ metaclass (0.0.2)
51
+ mime-types (1.25.1)
52
+ minitest (4.7.5)
53
+ mocha (0.10.5)
54
+ metaclass (~> 0.0.1)
55
+ multi_json (1.8.4)
56
+ polyglot (0.3.3)
57
+ rack (1.5.2)
58
+ rack-test (0.6.2)
59
+ rack (>= 1.0)
60
+ rails (4.0.2)
61
+ actionmailer (= 4.0.2)
62
+ actionpack (= 4.0.2)
63
+ activerecord (= 4.0.2)
64
+ activesupport (= 4.0.2)
65
+ bundler (>= 1.3.0, < 2.0)
66
+ railties (= 4.0.2)
67
+ sprockets-rails (~> 2.0.0)
68
+ railties (4.0.2)
69
+ actionpack (= 4.0.2)
70
+ activesupport (= 4.0.2)
71
+ rake (>= 0.8.7)
72
+ thor (>= 0.18.1, < 2.0)
73
+ rake (10.1.1)
74
+ rspec (2.8.0)
75
+ rspec-core (~> 2.8.0)
76
+ rspec-expectations (~> 2.8.0)
77
+ rspec-mocks (~> 2.8.0)
78
+ rspec-core (2.8.0)
79
+ rspec-expectations (2.8.0)
80
+ diff-lcs (~> 1.1.2)
81
+ rspec-mocks (2.8.0)
82
+ sprockets (2.10.1)
83
+ hike (~> 1.2)
84
+ multi_json (~> 1.0)
85
+ rack (~> 1.0)
86
+ tilt (~> 1.1, != 1.3.0)
87
+ sprockets-rails (2.0.1)
88
+ actionpack (>= 3.0)
89
+ activesupport (>= 3.0)
90
+ sprockets (~> 2.8)
91
+ sqlite3 (1.3.8)
92
+ thor (0.18.1)
93
+ thread_safe (0.1.3)
94
+ atomic
95
+ tilt (1.4.1)
96
+ treetop (1.4.15)
97
+ polyglot
98
+ polyglot (>= 0.3.1)
99
+ tzinfo (0.3.38)
100
+
101
+ PLATFORMS
102
+ ruby
103
+
104
+ DEPENDENCIES
105
+ appraisal
106
+ friendly_id
107
+ memcached
108
+ mocha (= 0.10.5)
109
+ rails (~> 4.0.0)
110
+ rspec (= 2.8)
111
+ simple_cacheable!
112
+ sqlite3