kmayer-highrise 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 1
2
+ :patch: 2
3
3
  :major: 0
4
4
  :minor: 9
data/lib/cachable.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'digest/sha1'
2
-
3
1
  # Caching is a way to speed up slow ActiveResource queries by keeping the result of
4
2
  # an ActiveResource request around to be reused by subequest requests. Caching is
5
3
  # turned off by default.
@@ -11,9 +9,12 @@ require 'digest/sha1'
11
9
  # module CachedResource
12
10
  # class Base < ActiveResource::Base
13
11
  # end
14
- # include Cachable
12
+ # class ActiveResource::Connection
13
+ # include Cachable
14
+ # end
15
15
  # end
16
16
  #
17
+ #
17
18
  # == Caching stores
18
19
  #
19
20
  # All the caching stores from ActiveSupport::Cache are available
@@ -34,9 +35,13 @@ require 'digest/sha1'
34
35
 
35
36
  module Cachable
36
37
  def self.included(base)
37
- ActiveResource::Connection.alias_method_chain :get, :cache
38
+ base.class_eval do
39
+ include InstanceMethods
40
+ alias_method_chain :get, :cache
41
+ end
38
42
  end
39
- ActiveResource::Connection.class_eval do
43
+
44
+ module InstanceMethods
40
45
  def cache_store
41
46
  @cache_store ||= nil
42
47
  end
@@ -68,7 +73,7 @@ module Cachable
68
73
  end
69
74
 
70
75
  def cache_key(*args)
71
- Digest::SHA1.hexdigest args.to_s
76
+ args.to_s
72
77
  end
73
78
 
74
79
  def fetch(args, &block)
data/lib/highrise/base.rb CHANGED
@@ -3,5 +3,8 @@ require File.expand_path(File.dirname(__FILE__) + '/../cachable')
3
3
  module Highrise
4
4
  class Base < ActiveResource::Base
5
5
  end
6
- include Cachable
6
+ class ActiveResource::Connection
7
+ include Cachable
8
+ end
7
9
  end
10
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kmayer-highrise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Marcos Tapaj\xC3\xB3s"
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-05-04 00:00:00 -07:00
13
+ date: 2009-05-05 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -109,7 +109,7 @@ files:
109
109
  - spec/highrise/version_spec.rb
110
110
  - spec/spec.opts
111
111
  - spec/spec_helper.rb
112
- has_rdoc: true
112
+ has_rdoc: false
113
113
  homepage: http://github.com/kmayer/highrise
114
114
  post_install_message:
115
115
  rdoc_options: