Skip to content

Commit

Permalink
Merge pull request nateware#32 from jlecour/master
Browse files Browse the repository at this point in the history
URLs to the Redis website
  • Loading branch information
Nate Wiger committed May 23, 2011
2 parents 4f2b25f + e5da753 commit 83111dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on _individual_ data structures, like counters, lists, and sets. The *atomic* p
Using an ORM wrapper that retrieves a "record", updates values, then sends those values back,
_removes_ the atomicity, cutting the nuts off the major advantage of Redis. Just use MySQL, k?

This gem provides a Rubyish interface to Redis, by mapping {Redis types}[http://code.google.com/p/redis/wiki/CommandReference]
This gem provides a Rubyish interface to Redis, by mapping {Redis types}[http://redis.io/commands]
to Ruby objects, via a thin layer over Ezra's +redis+ gem. It offers several advantages
over the lower-level redis-rb API:

Expand Down Expand Up @@ -111,12 +111,12 @@ Finally, for free, you get a +redis+ method that points directly to a Redis conn
@team.redis.get('somekey')
@team.redis.smembers('someset')

You can use the +redis+ handle to directly call any {Redis API command}[http://code.google.com/p/redis/wiki/CommandReference].
You can use the +redis+ handle to directly call any {Redis API command}[http://redis.io/commands].

== Example 2: Standalone Usage

There is a Ruby class that maps to each Redis type, with methods for each
{Redis API command}[http://code.google.com/p/redis/wiki/CommandReference].
{Redis API command}[http://redis.io/commands].
Note that calling +new+ does not imply it's actually a "new" value - it just
creates a mapping between that object and the corresponding Redis data structure,
which may already exist on the redis-server.
Expand Down Expand Up @@ -154,7 +154,7 @@ See the section on "Atomicity" for cool uses of atomic counter blocks.

=== Locks

A convenience class that wraps the pattern of {using +setnx+ to perform locking}[http://code.google.com/p/redis/wiki/SetnxCommand].
A convenience class that wraps the pattern of {using +setnx+ to perform locking}[http://redis.io/commands/setnx].

require 'redis/lock'
@lock = Redis::Lock.new('image_resizing', :expiration => 15, :timeout => 0.1)
Expand Down Expand Up @@ -331,7 +331,7 @@ a Hash and an Array. You assign like a Hash, but retrieve like an Array:
@sorted_set.incr('Peter') # shorthand
@sorted_set.incr('Jeff', 4)

The other Redis Sorted Set commands are supported as well; see {Sorted Sets API}[http://code.google.com/p/redis/wiki/SortedSets].
The other Redis Sorted Set commands are supported as well; see {Sorted Sets API}[http://redis.io/commands#sorted_set].

== Atomic Counters and Locks

Expand Down
2 changes: 2 additions & 0 deletions lib/redis/hash_key.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require File.dirname(__FILE__) + '/base_object'

class Redis
#
# Class representing a Redis hash.
Expand Down
2 changes: 1 addition & 1 deletion lib/redis/lock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def lock(&block)

# Lock is being held. Now check to see if it's expired (if we're using
# lock expiration).
# See "Handling Deadlocks" section on http://code.google.com/p/redis/wiki/SetnxCommand
# See "Handling Deadlocks" section on http://redis.io/commands/setnx
if !@options[:expiration].nil?
old_expiration = redis.get(key).to_f

Expand Down

0 comments on commit 83111dc

Please sign in to comment.