From 4f00a6e07c3f5a03f0e59184822dde33c1574d1e Mon Sep 17 00:00:00 2001 From: phoet Date: Thu, 28 Oct 2010 19:57:28 +0200 Subject: [PATCH] bump versionuse bundler and do some refactoring --- .document | 1 + .gitignore | 3 ++- .rvmrc | 2 +- CHANGELOG | 7 +++++++ Gemfile | 4 ++++ Gemfile.lock | 20 ++++++++++++++++++++ lib/rails_redis_cache.rb | 8 ++++---- rails_redis_cache.gemspec | 13 +++++++------ 8 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/.document b/.document index 0327034..9e723d1 100644 --- a/.document +++ b/.document @@ -1,2 +1,3 @@ lib/*.rb README.rdoc +CHANGELOG diff --git a/.gitignore b/.gitignore index 7b28b5d..ac78eee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ html pkg *.gem -.DS_Store \ No newline at end of file +.DS_Store +.bundle diff --git a/.rvmrc b/.rvmrc index aae24c2..4192b32 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1,2 +1,2 @@ -rvm 1.9.1@rails_redis_cache +rvm 1.9.1@rails_redis_cache --create rvm wrapper 1.9.1@rails_redis_cache textmate diff --git a/CHANGELOG b/CHANGELOG index c2af051..39df310 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +0.0.4 + +* less restrictive dependencies with '~>' +* use bundler for dependency management +* switching development to 'develop' branch +* add real git tags for releases + 0.0.3 * provide fix for edge-case when redis did not store the time-key properly diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..a6f1fd7 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source :gemcutter + +# dependencies in rails_redis_cache.gemspec +gemspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..9b4ac03 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,20 @@ +PATH + remote: . + specs: + rails_redis_cache (0.0.4) + activesupport (~> 3.0.0) + redis (~> 2.0.0) + +GEM + remote: http://rubygems.org/ + specs: + activesupport (3.0.1) + redis (2.0.12) + +PLATFORMS + ruby + +DEPENDENCIES + activesupport (~> 3.0.0) + rails_redis_cache! + redis (~> 2.0.0) diff --git a/lib/rails_redis_cache.rb b/lib/rails_redis_cache.rb index b70c7b5..e32bb11 100644 --- a/lib/rails_redis_cache.rb +++ b/lib/rails_redis_cache.rb @@ -4,7 +4,7 @@ require 'time' module ActiveSupport - module Cache + module Cache # RailsRedisCache is Rails 3 cache store implementation using the key value store Redis. # @@ -57,12 +57,12 @@ def increment(name, amount = 1, options = nil) end def decrement(name, amount = 1, options = nil) - write(name, -1 * amount + read(name, options).to_i, options) + increment(name, amount * -1, options) end def cleanup(options = nil) - p value_keys = @redis.keys("#{VALUE_PREF}_*") - p time_keys = @redis.keys("#{TIME_PREF}_*") + value_keys = @redis.keys("#{VALUE_PREF}_*") + time_keys = @redis.keys("#{TIME_PREF}_*") @redis.del *(value_keys + time_keys) end diff --git a/rails_redis_cache.gemspec b/rails_redis_cache.gemspec index 3456087..0604c79 100644 --- a/rails_redis_cache.gemspec +++ b/rails_redis_cache.gemspec @@ -2,21 +2,22 @@ spec = Gem::Specification.new do |s| s.name = 'rails_redis_cache' - s.version = '0.0.3' + s.version = '0.0.4' s.author = 'Peter Schröder' - s.description = 'Rails cache store implementation using Redis.' + s.description = 'Rails 3 cache store implementation using Redis.' s.email = 'phoetmail@googlemail.com' s.homepage = 'http://github.com/phoet/rails_redis_cache' - s.summary = 'Rails cache store implementation using Redis.' + s.rubyforge_project = 'http://github.com/phoet/rails_redis_cache' + s.summary = 'Rails 3 cache store implementation using Redis. See http://github.com/phoet/rails_redis_cache for more information.' s.has_rdoc = true s.rdoc_options = ['-a', '--inline-source', '--charset=UTF-8'] - s.files = Dir.glob('lib/*.rb') + %w(README.rdoc) + s.files = Dir.glob('lib/*.rb') + %w(README.rdoc CHANGELOG) s.test_files = Dir.glob('test/test_*.rb') - s.add_dependency('activesupport', '~> 3.0.0.beta') - s.add_dependency('redis', '~> 2.0.5') + s.add_dependency('activesupport', '~> 3.0.0') + s.add_dependency('redis', '~> 2.0.0') end