padrino-cache 0.10.6 → 0.10.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/padrino-cache/store/redis.rb +14 -0
- data/test/helper.rb +1 -1
- data/test/test_stores.rb +8 -0
- metadata +35 -34
@@ -89,6 +89,20 @@ module Padrino
|
|
89
89
|
def flush
|
90
90
|
@backend.flushdb
|
91
91
|
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Redis has a ton of powerful features (see: https://github.com/redis/redis-rb), which we
|
95
|
+
# can't use due to how strict the cache library is. This method catches all method calls and
|
96
|
+
# tries to pass them on the the redis gem.
|
97
|
+
#
|
98
|
+
# @api private
|
99
|
+
def method_missing(name, *args, &block)
|
100
|
+
if @backend.respond_to?(name)
|
101
|
+
@backend.send(name, *args, &block)
|
102
|
+
else
|
103
|
+
super
|
104
|
+
end
|
105
|
+
end
|
92
106
|
end # Redis
|
93
107
|
end # Store
|
94
108
|
end # Cache
|
data/test/helper.rb
CHANGED
@@ -3,9 +3,9 @@ PADRINO_ROOT = File.dirname(__FILE__) unless defined?(PADRINO_ROOT)
|
|
3
3
|
|
4
4
|
require File.expand_path('../../../load_paths', __FILE__)
|
5
5
|
require File.join(File.dirname(__FILE__), '..', '..', 'padrino-core', 'test', 'helper')
|
6
|
+
require 'uuid'
|
6
7
|
require 'padrino-cache'
|
7
8
|
require 'fileutils'
|
8
|
-
require 'uuid'
|
9
9
|
|
10
10
|
class MiniTest::Spec
|
11
11
|
|
data/test/test_stores.rb
CHANGED
@@ -61,6 +61,7 @@ rescue LoadError
|
|
61
61
|
end
|
62
62
|
|
63
63
|
begin
|
64
|
+
raise LoadError, 'Not working on Travis ...'
|
64
65
|
require 'dalli'
|
65
66
|
# we're just going to assume memcached is running on the default port
|
66
67
|
Padrino::Cache::Store::Memcache.new(::Dalli::Client.new('127.0.0.1:11211', :exception_retry_limit => 1).set('ping','alive'))
|
@@ -96,6 +97,13 @@ begin
|
|
96
97
|
Padrino.cache.flush
|
97
98
|
end
|
98
99
|
|
100
|
+
eval <<-REDIS_TEST
|
101
|
+
should 'add a value to a list' do
|
102
|
+
Padrino.cache.lpush(@test_key, "test")
|
103
|
+
assert_equal "test", Padrino.cache.lpop(@test_key)
|
104
|
+
end
|
105
|
+
REDIS_TEST
|
106
|
+
|
99
107
|
eval COMMON_TESTS
|
100
108
|
end
|
101
109
|
rescue LoadError
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: padrino-cache
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.10.7
|
4
5
|
prerelease:
|
5
|
-
version: 0.10.6
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Padrino Team
|
9
9
|
- Nathan Esquenazi
|
10
10
|
- Davide D'Agostino
|
@@ -12,29 +12,31 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
- !ruby/object:Gem::Dependency
|
15
|
+
date: 2012-06-20 00:00:00.000000000 Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
19
18
|
name: padrino-core
|
20
|
-
|
21
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
22
20
|
none: false
|
23
|
-
requirements:
|
24
|
-
- -
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.10.
|
21
|
+
requirements:
|
22
|
+
- - '='
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 0.10.7
|
27
25
|
type: :runtime
|
28
|
-
|
26
|
+
prerelease: false
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - '='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.10.7
|
29
33
|
description: Caching support for memcached, page and fragment
|
30
34
|
email: padrinorb@gmail.com
|
31
35
|
executables: []
|
32
|
-
|
33
36
|
extensions: []
|
34
|
-
|
35
|
-
extra_rdoc_files:
|
37
|
+
extra_rdoc_files:
|
36
38
|
- README.rdoc
|
37
|
-
files:
|
39
|
+
files:
|
38
40
|
- .document
|
39
41
|
- .gitignore
|
40
42
|
- .yardopts
|
@@ -57,32 +59,31 @@ files:
|
|
57
59
|
- test/test_stores.rb
|
58
60
|
homepage: http://www.padrinorb.com
|
59
61
|
licenses: []
|
60
|
-
|
61
62
|
post_install_message:
|
62
|
-
rdoc_options:
|
63
|
+
rdoc_options:
|
63
64
|
- --charset=UTF-8
|
64
|
-
require_paths:
|
65
|
+
require_paths:
|
65
66
|
- lib
|
66
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
68
|
none: false
|
68
|
-
requirements:
|
69
|
-
- -
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version:
|
72
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ! '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
74
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
77
78
|
version: 1.3.6
|
78
79
|
requirements: []
|
79
|
-
|
80
80
|
rubyforge_project: padrino-cache
|
81
|
-
rubygems_version: 1.8.
|
81
|
+
rubygems_version: 1.8.21
|
82
82
|
signing_key:
|
83
83
|
specification_version: 3
|
84
84
|
summary: Page and fragment caching for Padrino
|
85
|
-
test_files:
|
85
|
+
test_files:
|
86
86
|
- test/helper.rb
|
87
87
|
- test/test_padrino_cache.rb
|
88
88
|
- test/test_stores.rb
|
89
|
+
has_rdoc:
|