Skip to content

Commit

Permalink
Bump version, add fixes for Moneta 0.7 series
Browse files Browse the repository at this point in the history
  • Loading branch information
Sutto committed Dec 31, 2012
1 parent d633eee commit 1862b03
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Expand Up @@ -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
4 changes: 4 additions & 0 deletions Gemfile
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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.

Expand Down
11 changes: 9 additions & 2 deletions lib/rocket_pants.rb
Expand Up @@ -4,7 +4,6 @@
require 'action_controller'

require 'moneta'
require 'moneta/memory'

module RocketPants
require 'rocket_pants/error'
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rocket_pants.gemspec
Expand Up @@ -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"]
Expand Down

0 comments on commit 1862b03

Please sign in to comment.