Permalink
Browse files

cancelling the rename for now, adding in warning message to the gem

  • Loading branch information...
1 parent 5a4ef80 commit 2c0c98fd82c05a974549490469c90fb3f02edcdb @whoahbot committed Feb 14, 2012
View
@@ -1,4 +1,4 @@
-h1. dm-redis
+h1. dm-redis-adapter
This is a <a href="http://datamapper.org">DataMapper</a> adapter for the <a href="http://redis.io/">Redis</a> key-value store.
@@ -8,8 +8,13 @@ Redis is a very fast key-value store with some interesting data structures added
Marrying DataMapper to Redis allows for schema-less models, you can add fields at any time without having to create a migration. DataMapper also allows us to store non-native Redis types in the db, like Date fields.
+h1. Upgrading
+
+Please note that as of version 0.5.3 of the gem, the key names that are used for storage have changed and break compatibility with previous versions!
+
h1. Changelog
+* v0.5.3 Support for inheritance via sfeu and ujifgc, this version *breaks compatibility* with previous versions of the gem
* v0.4.0 Support for dm-core v1.1.0
* v0.3.0 Updates to support ruby 1.9.2 (thanks arbarlow!)
* v0.2.1 Fixes to sorting
@@ -21,12 +26,12 @@ h1. Install
Prerequisites:
* Redis:
-** <a href="http://code.google.com/p/redis/">Redis, v2.2 series</a>
+** <a href="http://code.google.com/p/redis/">Redis, >= v2.2 series</a>
-Install the dm-redis adapter:
+Install the dm-redis-adapter:
<pre>
<code>
- > gem install dm-redis
+ > gem install dm-redis-adapter
</code>
</pre>
@@ -38,7 +43,7 @@ Setup your adapter, define your models and properties:
<code>
require 'rubygems'
require 'dm-core'
- require 'dm-redis'
+ require 'dm-redis-adapter'
DataMapper.setup(:default, {:adapter => "redis"})
View
@@ -10,11 +10,11 @@ end
require 'spec/rake/spectask'
-GEM = 'dm-redis'
-GEM_NAME = 'dm-redis'
+GEM = 'dm-redis-adapter'
+GEM_NAME = 'dm-redis-adapter'
AUTHORS = ['Dan Herrera']
EMAIL = "whoahbot@gmail.com"
-HOMEPAGE = "http://github.com/whoahbot/dm-redis"
+HOMEPAGE = "http://github.com/whoahbot/dm-redis-adapter"
SUMMARY = "DataMapper adapter for the Redis key-value database"
begin
@@ -4,24 +4,35 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{dm-redis}
+ s.name = "dm-redis-adapter"
s.version = "0.6.0"
+ s.post_install_message = <<EOF
+***********************************************************************************************
+
+ * IMPORTANT *
+ This version of dm-redis changes the key names for data in Redis.
+ If you have been using dm-redis-adapter in the past, using this gem will not allow you to
+ retreive your data!
+
+***********************************************************************************************
+EOF
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Dan Herrera"]
- s.date = %q{2012-02-08}
- s.description = %q{DataMapper adapter for the Redis key-value database}
- s.email = %q{whoahbot@gmail.com}
+ s.date = "2012-02-13"
+ s.description = "DataMapper adapter for the Redis key-value database"
+ s.email = "whoahbot@gmail.com"
s.extra_rdoc_files = [
"MIT-LICENSE"
]
s.files = [
"MIT-LICENSE",
"README.textile",
"Rakefile",
- "lib/dm-redis.rb",
- "lib/dm-redis/adapter.rb",
- "lib/dm-redis/spec/setup.rb",
+ "lib/dm-redis-adapter.rb",
+ "lib/dm-redis-adapter/adapter.rb",
+ "lib/dm-redis-adapter/spec/setup.rb",
"spec/dm_redis_associations_spec.rb",
"spec/dm_redis_finding_spec.rb",
"spec/dm_redis_inheritenance_spec.rb",
@@ -31,11 +42,11 @@ Gem::Specification.new do |s|
"spec/spec_helper.rb",
"spec/textual_keys_spec.rb"
]
- s.homepage = %q{http://github.com/whoahbot/dm-redis}
+ s.homepage = "http://github.com/whoahbot/dm-redis-adapter"
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.6.2}
- s.summary = %q{DataMapper adapter for the Redis key-value database}
+ s.rubygems_version = "1.8.16"
+ s.summary = "DataMapper adapter for the Redis key-value database"
s.test_files = [
"spec/dm_redis_associations_spec.rb",
"spec/dm_redis_finding_spec.rb",
View
@@ -0,0 +1 @@
+require 'dm-redis-adapter/adapter'
File renamed without changes.
@@ -1,4 +1,4 @@
-require 'dm-redis'
+require 'dm-redis-adapter'
require 'dm-core/spec/setup'
module DataMapper
View
@@ -1 +0,0 @@
-require 'dm-redis/adapter'
View
@@ -10,7 +10,7 @@
require 'dm-core'
require 'dm-core/spec/shared/adapter_spec'
-require 'dm-redis/spec/setup'
+require 'dm-redis-adapter/spec/setup'
ENV['ADAPTER'] = 'redis'
ENV['ADAPTER_SUPPORTS'] = 'all'
View
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+describe DataMapper::Adapters::RedisAdapter do
+ before(:all) do
+ @adapter = DataMapper.setup(:default, {
+ :adapter => "redis",
+ :db => 15
+ })
+ end
+
+ after(:all) do
+ Redis.new(:db => 15).flushdb
+ end
+
+ describe "textual keys" do
+ it "should return the key" do
+ class Foo
+ include DataMapper::Resource
+ property :hostname, Text, :key => true
+ property :ip_address, Text
+ end
+ DataMapper.finalize
+
+ Foo.create(:hostname => "hostname1", :ip_address => '127.0.0.1')
+
+ Foo.first.hostname.should == "hostname1"
+ end
+ end
+end

0 comments on commit 2c0c98f

Please sign in to comment.