cached_resource 3.0.0 → 4.0.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: a93c586d68149afe39b531b4fa7b9230a1ad71f5
4
- data.tar.gz: 66c08229d6334ebd4f79d771a70d26fa3d82c495
3
+ metadata.gz: 1da93573faeee91075cb30f90b71dc9e4ac9dec5
4
+ data.tar.gz: 884eba1ec80a0184456a1de1e1e966fda965a461
5
5
  SHA512:
6
- metadata.gz: 84c687552fa91f2bcd6384e01f63b1682b086442d57d0311d4a0c1e77e13ec602cee0ddb2aa9f62595b17a3b3a1bc70622f745b66117934640d313eb5c6323aa
7
- data.tar.gz: 17655fde4e9427fcd3989be0c1aa9cfce1b5e93a0ea9797e71da4d3f40f8287954189d59e6fbfb28f4361578c5e6c45272be28e384eb948e45c55059915efd08
6
+ metadata.gz: c2670efa06013b198090f5b62f60daae68f4a9c87b53bfe7cc16be162eea9a26373faa0947e754e5145e513da2717046f549ad65520066de3bfa62225d1400c1
7
+ data.tar.gz: c439a57ebe49cd3cb88acbb095c09af729b851659bbde40f72c40d08c323728cc2d123c80a80c8304dc1d3d58e541d96c4d791af04d2c4a15524563d730f2331
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - 1.9.2
4
4
  - 1.9.3
5
5
  - 2.0.0
6
+ - 2.1.0
6
7
 
7
8
  gemfile:
8
9
  - gemfiles/Gemfile.rails-3.2.x
data/README.md CHANGED
@@ -8,7 +8,7 @@ CachedResource is a Ruby gem whose goal is to increase the performance of intera
8
8
  CachedResource supports the following Ruby versions:
9
9
 
10
10
  * 1.9.2, 1.9.3
11
- * 2.0.0
11
+ * 2.0.0, 2.1.0
12
12
 
13
13
  If you require 1.8.7 support, please use version 2.3.4.
14
14
 
@@ -6,6 +6,7 @@ require 'cached_resource/cached_resource'
6
6
  require 'cached_resource/configuration'
7
7
  require 'cached_resource/caching'
8
8
  require 'cached_resource/version'
9
+ require 'active_resource'
9
10
 
10
11
  module CachedResource
11
12
  # nada
@@ -14,4 +15,4 @@ end
14
15
  # Include model methods in ActiveResource::Base
15
16
  class ActiveResource::Base
16
17
  include CachedResource::Model
17
- end
18
+ end
@@ -110,7 +110,7 @@ module CachedResource
110
110
 
111
111
  # Generate the request cache key.
112
112
  def cache_key(*arguments)
113
- "#{name.parameterize.gsub("-", "/")}/#{arguments.join('/')}".downcase
113
+ "#{name.parameterize.gsub("-", "/")}/#{arguments.join('/')}".downcase.delete(' ')
114
114
  end
115
115
 
116
116
  # Make a full duplicate of an ActiveResource record.
@@ -1,3 +1,3 @@
1
1
  module CachedResource
2
- VERSION = "3.0.0"
2
+ VERSION = "4.0.0"
3
3
  end
@@ -36,6 +36,7 @@ describe CachedResource do
36
36
  ActiveResource::HttpMock.reset!
37
37
  ActiveResource::HttpMock.respond_to do |mock|
38
38
  mock.get "/things/1.json", {}, @thing_json
39
+ mock.get "/things/1.json?foo=bar", {}, @thing_json
39
40
  mock.get "/things/fded.json", {}, @string_thing_json
40
41
  end
41
42
  end
@@ -50,6 +51,11 @@ describe CachedResource do
50
51
  Thing.cached_resource.cache.read("thing/fded").should == result
51
52
  end
52
53
 
54
+ it "should cache without whitespace in keys" do
55
+ result = Thing.find(1, :from => 'path', :params => { :foo => 'bar' })
56
+ Thing.cached_resource.cache.read('thing/1/{:from=>"path",:params=>{:foo=>"bar"}}').should == result
57
+ end
58
+
53
59
  it "should empty the cache when clear_cache is called" do
54
60
  result = Thing.find(1)
55
61
  Thing.clear_cache
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cached_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Chan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-13 00:00:00.000000000 Z
11
+ date: 2014-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activeresource
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: nilio
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Enables request-based caching for ActiveResource
@@ -86,9 +86,9 @@ executables: []
86
86
  extensions: []
87
87
  extra_rdoc_files: []
88
88
  files:
89
- - .gitignore
90
- - .rspec
91
- - .travis.yml
89
+ - ".gitignore"
90
+ - ".rspec"
91
+ - ".travis.yml"
92
92
  - Gemfile
93
93
  - MIT-LICENSE
94
94
  - README.md
@@ -112,17 +112,17 @@ require_paths:
112
112
  - lib
113
113
  required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - '>='
120
+ - - ">="
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.0.5
125
+ rubygems_version: 2.2.1
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Caching for ActiveResource