Permalink
Browse files

Bump version, add fixes for Moneta 0.7 series

  • Loading branch information...
1 parent d633eee commit 1862b03de687c1b9b81358fabb28cbd5922117b5 @Sutto committed Dec 31, 2012
Showing with 23 additions and 4 deletions.
  1. +8 −0 .travis.yml
  2. +4 −0 Gemfile
  3. +1 −1 README.md
  4. +9 −2 lib/rocket_pants.rb
  5. +1 −1 rocket_pants.gemspec
View
@@ -12,6 +12,14 @@ env:
- RAILS_VERSION="~>3.2.0"
- RAILS_VERSION="~>3.1.0"
- RAILS_VERSION="~>3.0.0"
+ - RAILS_VERSION="" MONETA_VERSION="~> 0.6.0"
+ - RAILS_VERSION="~>3.2.0" MONETA_VERSION="~> 0.6.0"
+ - RAILS_VERSION="~>3.1.0" MONETA_VERSION="~> 0.6.0"
+ - RAILS_VERSION="~>3.0.0" MONETA_VERSION="~> 0.6.0"
+ - RAILS_VERSION="" MONETA_VERSION="~> 0.7.0"
+ - RAILS_VERSION="~>3.2.0" MONETA_VERSION="~> 0.7.0"
+ - RAILS_VERSION="~>3.1.0" MONETA_VERSION="~> 0.7.0"
+ - RAILS_VERSION="~>3.0.0" MONETA_VERSION="~> 0.7.0"
notifications:
email:
- sutto@sutto.net
View
@@ -10,6 +10,10 @@ if rails_version && rails_version.length > 0
gem 'activerecord', rails_version
end
+if (moneta_version = ENV["MONETA_VERSION"])
+ gem 'moneta', moneta_version
+end
+
# 2.10 for the moment changes some exceptions.
gem 'rspec', '~> 2.9.0'
View
@@ -216,7 +216,7 @@ To your `Gemfile` and running `bundle install`. Next, instead of inherited from
Setting up RocketPants in your rails application is pretty simple and requires a minimal amount of effort. Inside your environment configuration, RocketPants offers the following options to control how it's configured (and their expanded alternatives):
- `config.rocket_pants.use_caching` - Defaulting to true for production environments and false elsewhere, defines whether RocketPants caching setup as described below is used.
-- `config.rocket_pants.cache` - A `Moneta::Store` instance used as the RocketPants cache, defaulting to a moneta memory instance. Change for proper caching. (See [here](https://github.com/wycats/moneta) for more information on Moneta.)
+- `config.rocket_pants.cache` - A `Moneta::Store` / Moneta adapter instance (depending on the version of Moneta in use)used as the RocketPants cache, defaulting to a memory-based. Change for proper caching. (See [here](https://github.com/minad/moneta) for more information on Moneta.)
- `config.rocket_pants.header_metadata` - Defaults to false, if true enables header metadata in the application.
- `config.rocket_pants.pass_through_errors` - Defaults true in development and test, false otherwise. If true, will pass through errors up the stack otherwise will swallow them and return a system error via JSON for any unhandled exceptions.
View
@@ -4,7 +4,6 @@
require 'action_controller'
require 'moneta'
-require 'moneta/memory'
module RocketPants
require 'rocket_pants/error'
@@ -46,12 +45,20 @@ module RocketPants
mattr_writer :cache
+ begin
+ require 'moneta/memory'
+ MONETA_LEGACY = true
+ rescue LoadError => e
+ require 'moneta'
+ MONETA_LEGACY = false
+ end
+
class << self
alias caching_enabled? caching_enabled
alias header_metadata? header_metadata
def cache
- @@cache ||= Moneta::Memory.new
+ @@cache ||= (MONETA_LEGACY ? Moneta::Memory : Moneta::Adapters::Memory).new
end
def env
View
@@ -4,7 +4,7 @@ $:.unshift lib unless $:.include?(lib)
Gem::Specification.new do |s|
s.name = "rocket_pants"
- s.version = "1.5.4"
+ s.version = "1.5.5"
s.platform = Gem::Platform::RUBY
s.authors = ["Darcy Laycock"]
s.email = ["sutto@sutto.net"]

0 comments on commit 1862b03

Please sign in to comment.