<commit_before>= Redis::Objects - Map Redis types directly to Ruby objects

This is *not* an ORM. People that are wrapping ORM’s around Redis are missing the point.

The killer feature of Redis is that it allows you to perform _atomic_ operations
on _individual_ data structures, like counters, lists, and sets.  The *atomic* part is HUGE.
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://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:

1. Easy to integrate directly with existing ORMs - ActiveRecord, DataMapper, etc.  Add counters to your model!
2. Complex data structures are automatically Marshaled (if you set :marshal => true)
3. Integers are returned as integers, rather than '17'
4. Higher-level types are provided, such as Locks, that wrap multiple calls

This gem originally arose out of a need for high-concurrency atomic operations;
for a fun rant on the topic, see {An Atomic Rant}[http://nateware.com/2010/02/18/an-atomic-rant],
or scroll down to "Atomicity" in this README.

There are two ways to use Redis::Objects, either as an include in a model class (to
integrate with ORMs or other classes), or by using new with the type of data structure
you want to create. 

== Installation

Add it to your Gemfile as:

    gem 'redis-objects', :require => 'redis/objects'

== Example 1: Model Class Usage

Using Redis::Objects this way makes it trivial to integrate Redis types with an
existing ActiveRecord model, DataMapper resource, or other class.  Redis::Objects
will work with _any_ class that provides an +id+ method that returns a unique
value.  Redis::Objects will automatically create keys that are unique to
each object, in the format:

    model_name:id:field_name

=== Initialization<commit_msg>update README to drop no-longer-needed :require option<commit_after>= Redis::Objects - Map Redis types directly to Ruby objects

This is *not* an ORM. People that are wrapping ORM’s around Redis are missing the point.

The killer feature of Redis is that it allows you to perform _atomic_ operations
on _individual_ data structures, like counters, lists, and sets.  The *atomic* part is HUGE.
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://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:

1. Easy to integrate directly with existing ORMs - ActiveRecord, DataMapper, etc.  Add counters to your model!
2. Complex data structures are automatically Marshaled (if you set :marshal => true)
3. Integers are returned as integers, rather than '17'
4. Higher-level types are provided, such as Locks, that wrap multiple calls

This gem originally arose out of a need for high-concurrency atomic operations;
for a fun rant on the topic, see {An Atomic Rant}[http://nateware.com/2010/02/18/an-atomic-rant],
or scroll down to "Atomicity" in this README.

There are two ways to use Redis::Objects, either as an include in a model class (to
integrate with ORMs or other classes), or by using new with the type of data structure
you want to create. 

== Installation

Add it to your Gemfile as:

    gem 'redis-objects'

== Example 1: Model Class Usage

Using Redis::Objects this way makes it trivial to integrate Redis types with an
existing ActiveRecord model, DataMapper resource, or other class.  Redis::Objects
will work with _any_ class that provides an +id+ method that returns a unique
value.  Redis::Objects will automatically create keys that are unique to
each object, in the format:

    model_name:id:field_name

=== Initialization
{'fraction_non_alphanumeric': 0.06222439980401764, 'fraction_numerical': 0.007349338559529643, 'mean_word_length': 4.465863453815261, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6217717', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1096, 'n_words': 605}