sprockets-torquebox-cache 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in sprockets-cache-redis.gemspec
4
+ gemspec
@@ -0,0 +1,47 @@
1
+ Sprockets Torquebox Cache
2
+ ====================
3
+
4
+ A cache store for Sprockets which utilities Torquebox Infinispan Cache.
5
+
6
+ Usage
7
+ -----
8
+
9
+ Gemfile:
10
+
11
+ gem 'sprockets'
12
+ gem 'sprockets-torquebox-cache'
13
+ ...
14
+
15
+ config.ru:
16
+
17
+ require 'sprockets-cache-redis'
18
+ env = Sprockets::Environment.new
19
+ env.cache = Sprockets::Cache::Torquebox.new(Torquebox::Infinispan::Cache.new())
20
+ ...
21
+
22
+ Only pass it an instance of Torquebox::Infinispan::Cache.
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.
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.
47
+
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,26 @@
1
+ module Sprockets
2
+ module Cache
3
+ # Utilites Torquebox Infinispan Cache for Sprocket caching
4
+ #
5
+ # environment.cache = Torquebox::Infinispan::Cache.new(...)
6
+ #
7
+ class Torquebox
8
+ VERSION = "0.0.1"
9
+
10
+ def initialize(cache)
11
+ @cache = cache
12
+ end
13
+
14
+ # Lookup value in cache
15
+ def [](key)
16
+ @cache.get path_for(key)
17
+ end
18
+
19
+ # Save value to cache
20
+ def []=(key, value)
21
+ @cache.put key, value
22
+ value
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "sprockets-torquebox-cache"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "sprockets-torquebox-cache"
7
+ s.version = Sprockets::Cache::Torquebox::VERSION
8
+ s.authors = ["Carl Hörberg"]
9
+ s.email = ["carl.hoerberg@gmail.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{A Torquebox cache store for Sprockets}
12
+ s.description = %q{}
13
+
14
+ s.rubyforge_project = "sprockets-torquebox-cache"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+ end
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sprockets-torquebox-cache
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Carl Hörberg
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-12-14 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: ''
15
+ email:
16
+ - carl.hoerberg@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - README.markdown
24
+ - Rakefile
25
+ - lib/sprockets-torquebox-cache.rb
26
+ - sprockets-torquebox-cache.gemspec
27
+ homepage: ''
28
+ licenses: []
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project: sprockets-torquebox-cache
47
+ rubygems_version: 1.8.10
48
+ signing_key:
49
+ specification_version: 3
50
+ summary: A Torquebox cache store for Sprockets
51
+ test_files: []