Created
February 5, 2010 21:49
-
-
Save nmerouze/296301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rack/cache" | |
if Rails::VERSION::MAJOR == 2 | |
Rails.configuration.middleware.use Rack::Cache, | |
:metastore => "file:#{Rails.root + "cache/rack/meta"}", | |
:entitystore => "file:#{Rails.root + "cache/rack/body"}", | |
:verbose => true | |
else | |
module Cache | |
class Railtie < Rails::Railtie | |
railtie_name :rails_cache | |
initializer "rails_cache.insert_rack_cache" do |app| | |
app.config.middleware.use Rack::Cache, | |
:metastore => "file:#{Rails.root + "cache/rack/meta"}", | |
:entitystore => "file:#{Rails.root + "cache/rack/body"}", | |
:verbose => true | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rack/cache" | |
Rails.configuration.middleware.use Rack::Cache, | |
:metastore => "file:#{Rails.root + "cache/rack/meta"}", | |
:entitystore => "file:#{Rails.root + "cache/rack/body"}", | |
:verbose => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rack/cache" | |
module Cache | |
class Railtie < Rails::Railtie | |
railtie_name :rails_cache | |
initializer "rails_cache.insert_rack_cache" do |app| | |
app.config.middleware.use Rack::Cache, | |
:metastore => "file:#{Rails.root + "cache/rack/meta"}", | |
:entitystore => "file:#{Rails.root + "cache/rack/body"}", | |
:verbose => true | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION | |
require File.join(File.dirname(__FILE__), 'boot') | |
Rails::Initializer.run do |config| | |
config.gem "rails-cache", :lib => "rails/cache" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "rails-cache", :require => "rails/cache", :path => "../rails-cache" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rake" | |
begin | |
require "jeweler" | |
Jeweler::Tasks.new do |gem| | |
gem.name = "rails-cache" | |
gem.summary = "Add Rack::Cache to your Rails app" | |
gem.email = "[email protected]" | |
gem.homepage = "http://github.com/nmerouze/rails-cache" | |
gem.authors = ["Nicolas Mérouze"] | |
gem.files = Dir["*", "{lib}/**/*"] | |
gem.add_dependency("rack-cache", "~> 0.5.2") | |
end | |
Jeweler::GemcutterTasks.new | |
rescue LoadError | |
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment