sprockets-cache-redis 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,11 +6,42 @@ A cache store for Sprockets which utilities Redis.
6
6
  Usage
7
7
  -----
8
8
 
9
- require 'sprocket-cache-redis'
9
+ Gemfile:
10
+
11
+ gem 'sprockets'
12
+ gem 'sprockets-cache-redis'
13
+ ...
14
+
15
+ config.ru:
16
+
17
+ require 'sprockets-cache-redis'
10
18
  env = Sprockets::Environment.new
11
19
  env.cache = Sprockets::Cache::RedisStore.new(redis, 'sprockets')
12
20
  ...
13
21
 
14
- Where the first argument is a Redis connection, and the other is a key_prefix.
22
+ Where the first argument is a Redis connection, and the other (which is optional) is a key_prefix.
23
+
24
+ License
25
+ -------
26
+ (MIT license)
27
+
28
+ Copyright (C) 2011 by Carl Hörberg
29
+
30
+ Permission is hereby granted, free of charge, to any person obtaining a copy
31
+ of this software and associated documentation files (the "Software"), to deal
32
+ in the Software without restriction, including without limitation the rights
33
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
34
+ copies of the Software, and to permit persons to whom the Software is
35
+ furnished to do so, subject to the following conditions:
36
+
37
+ The above copyright notice and this permission notice shall be included in
38
+ all copies or substantial portions of the Software.
15
39
 
40
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
43
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
45
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
46
+ THE SOFTWARE.
16
47
 
@@ -1,5 +1,3 @@
1
- require 'digest/md5'
2
-
3
1
  module Sprockets
4
2
  module Cache
5
3
  # A simple Redis cache store.
@@ -21,11 +19,12 @@ module Sprockets
21
19
  # Save value to cache
22
20
  def []=(key, value)
23
21
  @redis.set path_for(key), Marshal.dump(value)
22
+ value
24
23
  end
25
24
 
26
25
  private
27
26
  def path_for(key)
28
- @key_prefix + ':' + ::Digest::MD5.hexdigest(key)
27
+ "#{@key_prefix}:#{key}"
29
28
  end
30
29
  end
31
30
  end
@@ -1,7 +1,7 @@
1
1
  module Sprockets
2
2
  module Cache
3
3
  module Redis
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-cache-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-10 00:00:00.000000000Z
12
+ date: 2011-11-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ''
15
15
  email:
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  requirements: []
48
48
  rubyforge_project: sprockets-cache-redis
49
- rubygems_version: 1.8.6
49
+ rubygems_version: 1.8.10
50
50
  signing_key:
51
51
  specification_version: 3
52
52
  summary: A Redis cache store for Sprockets