jbuilder_cache_multi 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/.travis.yml +14 -0
  4. data/Appraisals +1 -1
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +50 -0
  7. data/README.md +6 -0
  8. data/gemfiles/rails_3.0.0_jbuilder_1.5.0.gemfile +13 -0
  9. data/gemfiles/rails_3.0.0_jbuilder_1.5.0.gemfile.lock +76 -0
  10. data/gemfiles/rails_3.0.0_jbuilder_2.0.0.gemfile +13 -0
  11. data/gemfiles/rails_3.0.0_jbuilder_2.0.0.gemfile.lock +76 -0
  12. data/gemfiles/rails_3.1.0_jbuilder_1.5.0.gemfile +13 -0
  13. data/gemfiles/rails_3.1.0_jbuilder_1.5.0.gemfile.lock +86 -0
  14. data/gemfiles/rails_3.1.0_jbuilder_2.0.0.gemfile +13 -0
  15. data/gemfiles/rails_3.1.0_jbuilder_2.0.0.gemfile.lock +86 -0
  16. data/gemfiles/rails_3.2.0_jbuilder_1.5.0.gemfile +13 -0
  17. data/gemfiles/rails_3.2.0_jbuilder_1.5.0.gemfile.lock +85 -0
  18. data/gemfiles/rails_3.2.0_jbuilder_2.0.0.gemfile +13 -0
  19. data/gemfiles/rails_3.2.0_jbuilder_2.0.0.gemfile.lock +85 -0
  20. data/gemfiles/rails_4.0.0_jbuilder_1.5.0.gemfile +13 -0
  21. data/gemfiles/rails_4.0.0_jbuilder_1.5.0.gemfile.lock +67 -0
  22. data/gemfiles/rails_4.0.0_jbuilder_2.0.0.gemfile +13 -0
  23. data/gemfiles/rails_4.0.0_jbuilder_2.0.0.gemfile.lock +67 -0
  24. data/gemfiles/rails_4.1.0_jbuilder_1.5.0.gemfile +13 -0
  25. data/gemfiles/rails_4.1.0_jbuilder_1.5.0.gemfile.lock +72 -0
  26. data/gemfiles/rails_4.1.0_jbuilder_2.0.0.gemfile +13 -0
  27. data/gemfiles/rails_4.1.0_jbuilder_2.0.0.gemfile.lock +72 -0
  28. data/gemfiles/rails_5.0.0_jbuilder_1.5.0.gemfile +13 -0
  29. data/gemfiles/rails_5.0.0_jbuilder_1.5.0.gemfile.lock +87 -0
  30. data/gemfiles/rails_5.0.0_jbuilder_2.0.0.gemfile +13 -0
  31. data/gemfiles/rails_5.0.0_jbuilder_2.0.0.gemfile.lock +87 -0
  32. data/lib/jbuilder_cache_multi/jbuilder_ext.rb +40 -17
  33. data/lib/jbuilder_cache_multi/version.rb +1 -1
  34. data/test/jbuilder_template_test.rb +57 -4
  35. metadata +29 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1598251433b72aa7893091f6f06f22b55f0c98f9
4
- data.tar.gz: a5d3ffd62bfc3b1ed490171a5950cb6421cda6b4
3
+ metadata.gz: cfdba109f5f61b7d50988ce043bd791a301d3265
4
+ data.tar.gz: ef2890c59f59c8d97725eec08e37ca682226a9bf
5
5
  SHA512:
6
- metadata.gz: 6dfb710f19b14153a54af67129d9c74081178e5defb067ff878ce872cf392521140243e0b75dc0192a82dc55681635a62def577e2102e72f7cfdb0fffebcc43c
7
- data.tar.gz: 5fc7c4ca2f43027e71d40e33b9d578924cb9e25cbf86d2919c0ba391e627bbd52b7848a84d7146cafbdfd7934bf7bdc40927680e8a5ab594e19f6713a628ce7e
6
+ metadata.gz: fe54a99fb8a8569fd760f79855111419a5c7a670291b75b1ddbab23dcdf0d43ef48d73678ad191ebfc7bbb1320c7751a6925231f05dd1b90bd7575886d466e10
7
+ data.tar.gz: e8842fdb14aab037c05355412c5e066b532f912ad054d401ac68477284d8e65b60182ca0c4761e188f6381a5cbf5be739b0fc43d8bc1e832c49807b66d9e9c7d
data/.gitignore CHANGED
@@ -1,10 +1,10 @@
1
- gemfiles
2
1
  *.gem
3
2
  *.rbc
4
3
  .bundle
5
4
  .config
6
5
  .yardoc
7
- Gemfile.lock
6
+ .ruby-gemset
7
+ .ruby-version
8
8
  InstalledFiles
9
9
  _yardoc
10
10
  coverage
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ rvm:
3
+ - "2.2.3"
4
+ gemfile:
5
+ - gemfiles/rails_3.0.0_jbuilder_1.5.0.gemfile
6
+ - gemfiles/rails_3.0.0_jbuilder_2.0.0.gemfile
7
+ - gemfiles/rails_3.1.0_jbuilder_1.5.0.gemfile
8
+ - gemfiles/rails_3.1.0_jbuilder_2.0.0.gemfile
9
+ - gemfiles/rails_3.2.0_jbuilder_1.5.0.gemfile
10
+ - gemfiles/rails_3.2.0_jbuilder_2.0.0.gemfile
11
+ - gemfiles/rails_4.0.0_jbuilder_1.5.0.gemfile
12
+ - gemfiles/rails_4.0.0_jbuilder_2.0.0.gemfile
13
+ - gemfiles/rails_4.1.0_jbuilder_1.5.0.gemfile
14
+ - gemfiles/rails_4.1.0_jbuilder_2.0.0.gemfile
data/Appraisals CHANGED
@@ -1,4 +1,4 @@
1
- rails_versions = ["~> 3.0.0", "~> 3.1.0", "~> 3.2.0", "~> 4.0.0", "~> 4.1.0"]
1
+ rails_versions = ["~> 3.0.0", "~> 3.1.0", "~> 3.2.0", "~> 4.0.0", "~> 4.1.0", "~> 5.0.0"]
2
2
  jbuilder_versions = ["~> 1.5.0", "~> 2.0.0"]
3
3
 
4
4
  rails_versions.each do |r|
data/Gemfile CHANGED
@@ -5,3 +5,4 @@ gemspec
5
5
  gem "rake"
6
6
  gem "mocha", require: false
7
7
  gem "appraisal"
8
+ gem "test-unit"
@@ -0,0 +1,50 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jbuilder_cache_multi (0.0.3)
5
+ jbuilder (>= 1.5.0, < 3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activesupport (4.2.4)
11
+ i18n (~> 0.7)
12
+ json (~> 1.7, >= 1.7.7)
13
+ minitest (~> 5.1)
14
+ thread_safe (~> 0.3, >= 0.3.4)
15
+ tzinfo (~> 1.1)
16
+ appraisal (2.1.0)
17
+ bundler
18
+ rake
19
+ thor (>= 0.14.0)
20
+ i18n (0.7.0)
21
+ jbuilder (2.3.1)
22
+ activesupport (>= 3.0.0, < 5)
23
+ multi_json (~> 1.2)
24
+ json (1.8.3)
25
+ metaclass (0.0.4)
26
+ minitest (5.8.0)
27
+ mocha (1.1.0)
28
+ metaclass (~> 0.0.1)
29
+ multi_json (1.11.2)
30
+ power_assert (0.2.2)
31
+ rake (10.4.2)
32
+ test-unit (3.0.8)
33
+ power_assert
34
+ thor (0.19.1)
35
+ thread_safe (0.3.5)
36
+ tzinfo (1.2.2)
37
+ thread_safe (~> 0.1)
38
+
39
+ PLATFORMS
40
+ ruby
41
+
42
+ DEPENDENCIES
43
+ appraisal
44
+ jbuilder_cache_multi!
45
+ mocha
46
+ rake
47
+ test-unit
48
+
49
+ BUNDLED WITH
50
+ 1.10.6
data/README.md CHANGED
@@ -62,6 +62,12 @@ This will cache the entire collection. If a single item changes it will use read
62
62
 
63
63
  Last thing: If you are using a collection for the cache key, may I recommend the 'scope_cache_key' gem? (check out my fork for a Rails 4 version: https://github.com/joshblour/scope_cache_key). It very quickly calculates a hash for all items in the collection (MD5 hash of updated_at + IDs).
64
64
 
65
+ You can also conditionally cache a block by using `cache_collection_if!` like this:
66
+
67
+ json.cache_collection_if! do_cache?, @people, expires_in: 10.minutes do |person|
68
+ json.partial! 'person', :person => person
69
+ end
70
+
65
71
  ## Todo
66
72
 
67
73
  - Add support for passing a partial name as an argument (e.g. json.cache_collection! @people, partial: 'person') or maybe even just "json.cache_collection! @people" and infer the partial name from the collection...
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake"
6
+ gem "mocha", :require => false
7
+ gem "appraisal"
8
+ gem "test-unit"
9
+ gem "railties", "~> 3.0.0"
10
+ gem "actionpack", "~> 3.0.0"
11
+ gem "jbuilder", "~> 1.5.0"
12
+
13
+ gemspec :path => "../"
@@ -0,0 +1,76 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ jbuilder_cache_multi (0.0.3)
5
+ jbuilder (>= 1.5.0, < 3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ abstract (1.0.0)
11
+ actionpack (3.0.20)
12
+ activemodel (= 3.0.20)
13
+ activesupport (= 3.0.20)
14
+ builder (~> 2.1.2)
15
+ erubis (~> 2.6.6)
16
+ i18n (~> 0.5.0)
17
+ rack (~> 1.2.5)
18
+ rack-mount (~> 0.6.14)
19
+ rack-test (~> 0.5.7)
20
+ tzinfo (~> 0.3.23)
21
+ activemodel (3.0.20)
22
+ activesupport (= 3.0.20)
23
+ builder (~> 2.1.2)
24
+ i18n (~> 0.5.0)
25
+ activesupport (3.0.20)
26
+ appraisal (2.1.0)
27
+ bundler
28
+ rake
29
+ thor (>= 0.14.0)
30
+ builder (2.1.2)
31
+ erubis (2.6.6)
32
+ abstract (>= 1.0.0)
33
+ i18n (0.5.4)
34
+ jbuilder (1.5.3)
35
+ activesupport (>= 3.0.0)
36
+ multi_json (>= 1.2.0)
37
+ json (1.8.3)
38
+ metaclass (0.0.4)
39
+ mocha (1.1.0)
40
+ metaclass (~> 0.0.1)
41
+ multi_json (1.11.2)
42
+ power_assert (0.2.2)
43
+ rack (1.2.8)
44
+ rack-mount (0.6.14)
45
+ rack (>= 1.0.0)
46
+ rack-test (0.5.7)
47
+ rack (>= 1.0)
48
+ railties (3.0.20)
49
+ actionpack (= 3.0.20)
50
+ activesupport (= 3.0.20)
51
+ rake (>= 0.8.7)
52
+ rdoc (~> 3.4)
53
+ thor (~> 0.14.4)
54
+ rake (10.4.2)
55
+ rdoc (3.12.2)
56
+ json (~> 1.4)
57
+ test-unit (3.0.8)
58
+ power_assert
59
+ thor (0.14.6)
60
+ tzinfo (0.3.44)
61
+
62
+ PLATFORMS
63
+ ruby
64
+
65
+ DEPENDENCIES
66
+ actionpack (~> 3.0.0)
67
+ appraisal
68
+ jbuilder (~> 1.5.0)
69
+ jbuilder_cache_multi!
70
+ mocha
71
+ railties (~> 3.0.0)
72
+ rake
73
+ test-unit
74
+
75
+ BUNDLED WITH
76
+ 1.14.6
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake"
6
+ gem "mocha", :require => false
7
+ gem "appraisal"
8
+ gem "test-unit"
9
+ gem "railties", "~> 3.0.0"
10
+ gem "actionpack", "~> 3.0.0"
11
+ gem "jbuilder", "~> 2.0.0"
12
+
13
+ gemspec :path => "../"
@@ -0,0 +1,76 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ jbuilder_cache_multi (0.0.3)
5
+ jbuilder (>= 1.5.0, < 3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ abstract (1.0.0)
11
+ actionpack (3.0.20)
12
+ activemodel (= 3.0.20)
13
+ activesupport (= 3.0.20)
14
+ builder (~> 2.1.2)
15
+ erubis (~> 2.6.6)
16
+ i18n (~> 0.5.0)
17
+ rack (~> 1.2.5)
18
+ rack-mount (~> 0.6.14)
19
+ rack-test (~> 0.5.7)
20
+ tzinfo (~> 0.3.23)
21
+ activemodel (3.0.20)
22
+ activesupport (= 3.0.20)
23
+ builder (~> 2.1.2)
24
+ i18n (~> 0.5.0)
25
+ activesupport (3.0.20)
26
+ appraisal (2.1.0)
27
+ bundler
28
+ rake
29
+ thor (>= 0.14.0)
30
+ builder (2.1.2)
31
+ erubis (2.6.6)
32
+ abstract (>= 1.0.0)
33
+ i18n (0.5.4)
34
+ jbuilder (2.0.8)
35
+ activesupport (>= 3.0.0, < 5)
36
+ multi_json (~> 1.2)
37
+ json (1.8.3)
38
+ metaclass (0.0.4)
39
+ mocha (1.1.0)
40
+ metaclass (~> 0.0.1)
41
+ multi_json (1.11.2)
42
+ power_assert (0.2.2)
43
+ rack (1.2.8)
44
+ rack-mount (0.6.14)
45
+ rack (>= 1.0.0)
46
+ rack-test (0.5.7)
47
+ rack (>= 1.0)
48
+ railties (3.0.20)
49
+ actionpack (= 3.0.20)
50
+ activesupport (= 3.0.20)
51
+ rake (>= 0.8.7)
52
+ rdoc (~> 3.4)
53
+ thor (~> 0.14.4)
54
+ rake (10.4.2)
55
+ rdoc (3.12.2)
56
+ json (~> 1.4)
57
+ test-unit (3.0.8)
58
+ power_assert
59
+ thor (0.14.6)
60
+ tzinfo (0.3.44)
61
+
62
+ PLATFORMS
63
+ ruby
64
+
65
+ DEPENDENCIES
66
+ actionpack (~> 3.0.0)
67
+ appraisal
68
+ jbuilder (~> 2.0.0)
69
+ jbuilder_cache_multi!
70
+ mocha
71
+ railties (~> 3.0.0)
72
+ rake
73
+ test-unit
74
+
75
+ BUNDLED WITH
76
+ 1.14.6
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake"
6
+ gem "mocha", :require => false
7
+ gem "appraisal"
8
+ gem "test-unit"
9
+ gem "railties", "~> 3.1.0"
10
+ gem "actionpack", "~> 3.1.0"
11
+ gem "jbuilder", "~> 1.5.0"
12
+
13
+ gemspec :path => "../"
@@ -0,0 +1,86 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ jbuilder_cache_multi (0.0.3)
5
+ jbuilder (>= 1.5.0, < 3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (3.1.12)
11
+ activemodel (= 3.1.12)
12
+ activesupport (= 3.1.12)
13
+ builder (~> 3.0.0)
14
+ erubis (~> 2.7.0)
15
+ i18n (~> 0.6)
16
+ rack (~> 1.3.6)
17
+ rack-cache (~> 1.2)
18
+ rack-mount (~> 0.8.2)
19
+ rack-test (~> 0.6.1)
20
+ sprockets (~> 2.0.4)
21
+ activemodel (3.1.12)
22
+ activesupport (= 3.1.12)
23
+ builder (~> 3.0.0)
24
+ i18n (~> 0.6)
25
+ activesupport (3.1.12)
26
+ multi_json (~> 1.0)
27
+ appraisal (2.1.0)
28
+ bundler
29
+ rake
30
+ thor (>= 0.14.0)
31
+ builder (3.0.4)
32
+ erubis (2.7.0)
33
+ hike (1.2.3)
34
+ i18n (0.7.0)
35
+ jbuilder (1.5.3)
36
+ activesupport (>= 3.0.0)
37
+ multi_json (>= 1.2.0)
38
+ json (1.8.3)
39
+ metaclass (0.0.4)
40
+ mocha (1.1.0)
41
+ metaclass (~> 0.0.1)
42
+ multi_json (1.11.2)
43
+ power_assert (0.2.2)
44
+ rack (1.3.10)
45
+ rack-cache (1.2)
46
+ rack (>= 0.4)
47
+ rack-mount (0.8.3)
48
+ rack (>= 1.0.0)
49
+ rack-ssl (1.3.4)
50
+ rack
51
+ rack-test (0.6.3)
52
+ rack (>= 1.0)
53
+ railties (3.1.12)
54
+ actionpack (= 3.1.12)
55
+ activesupport (= 3.1.12)
56
+ rack-ssl (~> 1.3.2)
57
+ rake (>= 0.8.7)
58
+ rdoc (~> 3.4)
59
+ thor (~> 0.14.6)
60
+ rake (10.4.2)
61
+ rdoc (3.12.2)
62
+ json (~> 1.4)
63
+ sprockets (2.0.5)
64
+ hike (~> 1.2)
65
+ rack (~> 1.0)
66
+ tilt (~> 1.1, != 1.3.0)
67
+ test-unit (3.0.8)
68
+ power_assert
69
+ thor (0.14.6)
70
+ tilt (1.4.1)
71
+
72
+ PLATFORMS
73
+ ruby
74
+
75
+ DEPENDENCIES
76
+ actionpack (~> 3.1.0)
77
+ appraisal
78
+ jbuilder (~> 1.5.0)
79
+ jbuilder_cache_multi!
80
+ mocha
81
+ railties (~> 3.1.0)
82
+ rake
83
+ test-unit
84
+
85
+ BUNDLED WITH
86
+ 1.14.6
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake"
6
+ gem "mocha", :require => false
7
+ gem "appraisal"
8
+ gem "test-unit"
9
+ gem "railties", "~> 3.1.0"
10
+ gem "actionpack", "~> 3.1.0"
11
+ gem "jbuilder", "~> 2.0.0"
12
+
13
+ gemspec :path => "../"
@@ -0,0 +1,86 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ jbuilder_cache_multi (0.0.3)
5
+ jbuilder (>= 1.5.0, < 3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (3.1.12)
11
+ activemodel (= 3.1.12)
12
+ activesupport (= 3.1.12)
13
+ builder (~> 3.0.0)
14
+ erubis (~> 2.7.0)
15
+ i18n (~> 0.6)
16
+ rack (~> 1.3.6)
17
+ rack-cache (~> 1.2)
18
+ rack-mount (~> 0.8.2)
19
+ rack-test (~> 0.6.1)
20
+ sprockets (~> 2.0.4)
21
+ activemodel (3.1.12)
22
+ activesupport (= 3.1.12)
23
+ builder (~> 3.0.0)
24
+ i18n (~> 0.6)
25
+ activesupport (3.1.12)
26
+ multi_json (~> 1.0)
27
+ appraisal (2.1.0)
28
+ bundler
29
+ rake
30
+ thor (>= 0.14.0)
31
+ builder (3.0.4)
32
+ erubis (2.7.0)
33
+ hike (1.2.3)
34
+ i18n (0.7.0)
35
+ jbuilder (2.0.8)
36
+ activesupport (>= 3.0.0, < 5)
37
+ multi_json (~> 1.2)
38
+ json (1.8.3)
39
+ metaclass (0.0.4)
40
+ mocha (1.1.0)
41
+ metaclass (~> 0.0.1)
42
+ multi_json (1.11.2)
43
+ power_assert (0.2.2)
44
+ rack (1.3.10)
45
+ rack-cache (1.2)
46
+ rack (>= 0.4)
47
+ rack-mount (0.8.3)
48
+ rack (>= 1.0.0)
49
+ rack-ssl (1.3.4)
50
+ rack
51
+ rack-test (0.6.3)
52
+ rack (>= 1.0)
53
+ railties (3.1.12)
54
+ actionpack (= 3.1.12)
55
+ activesupport (= 3.1.12)
56
+ rack-ssl (~> 1.3.2)
57
+ rake (>= 0.8.7)
58
+ rdoc (~> 3.4)
59
+ thor (~> 0.14.6)
60
+ rake (10.4.2)
61
+ rdoc (3.12.2)
62
+ json (~> 1.4)
63
+ sprockets (2.0.5)
64
+ hike (~> 1.2)
65
+ rack (~> 1.0)
66
+ tilt (~> 1.1, != 1.3.0)
67
+ test-unit (3.0.8)
68
+ power_assert
69
+ thor (0.14.6)
70
+ tilt (1.4.1)
71
+
72
+ PLATFORMS
73
+ ruby
74
+
75
+ DEPENDENCIES
76
+ actionpack (~> 3.1.0)
77
+ appraisal
78
+ jbuilder (~> 2.0.0)
79
+ jbuilder_cache_multi!
80
+ mocha
81
+ railties (~> 3.1.0)
82
+ rake
83
+ test-unit
84
+
85
+ BUNDLED WITH
86
+ 1.14.6