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 +1 -1
- data/lib/cachable.rb +11 -6
- data/lib/highrise/base.rb +4 -1
- metadata +3 -3
data/VERSION.yml
CHANGED
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
|
-
#
|
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
|
-
|
38
|
+
base.class_eval do
|
39
|
+
include InstanceMethods
|
40
|
+
alias_method_chain :get, :cache
|
41
|
+
end
|
38
42
|
end
|
39
|
-
|
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
|
-
|
76
|
+
args.to_s
|
72
77
|
end
|
73
78
|
|
74
79
|
def fetch(args, &block)
|
data/lib/highrise/base.rb
CHANGED
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.
|
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-
|
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:
|
112
|
+
has_rdoc: false
|
113
113
|
homepage: http://github.com/kmayer/highrise
|
114
114
|
post_install_message:
|
115
115
|
rdoc_options:
|