redis-objects-legacy 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.travis.yml +16 -0
- data/ATOMICITY.rdoc +154 -0
- data/CHANGELOG.rdoc +362 -0
- data/Gemfile +4 -0
- data/LICENSE +202 -0
- data/README.md +600 -0
- data/Rakefile +14 -0
- data/lib/redis/base_object.rb +62 -0
- data/lib/redis/counter.rb +145 -0
- data/lib/redis/enumerable_object.rb +28 -0
- data/lib/redis/hash_key.rb +163 -0
- data/lib/redis/helpers/core_commands.rb +89 -0
- data/lib/redis/list.rb +160 -0
- data/lib/redis/lock.rb +89 -0
- data/lib/redis/objects/connection_pool_proxy.rb +31 -0
- data/lib/redis/objects/counters.rb +155 -0
- data/lib/redis/objects/hashes.rb +60 -0
- data/lib/redis/objects/lists.rb +58 -0
- data/lib/redis/objects/locks.rb +73 -0
- data/lib/redis/objects/sets.rb +58 -0
- data/lib/redis/objects/sorted_sets.rb +49 -0
- data/lib/redis/objects/values.rb +64 -0
- data/lib/redis/objects/version.rb +5 -0
- data/lib/redis/objects.rb +199 -0
- data/lib/redis/set.rb +182 -0
- data/lib/redis/sorted_set.rb +325 -0
- data/lib/redis/value.rb +65 -0
- data/lib/redis-objects-legacy.rb +1 -0
- data/spec/redis_autoload_objects_spec.rb +46 -0
- data/spec/redis_namespace_compat_spec.rb +24 -0
- data/spec/redis_objects_active_record_spec.rb +162 -0
- data/spec/redis_objects_conn_spec.rb +276 -0
- data/spec/redis_objects_custom_serializer.rb +198 -0
- data/spec/redis_objects_instance_spec.rb +1666 -0
- data/spec/redis_objects_model_spec.rb +1097 -0
- data/spec/spec_helper.rb +92 -0
- metadata +214 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 21b943720cf2d5afd7c5c0b3c56a153e985bb07be87acfa052d9e49767e465ef
|
4
|
+
data.tar.gz: b84df11fc241e8dbf20442d99ff0e311af4bb41754e5cd1fd21f7b8c6cc551ef
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 605ca6256f9cd704b7543082278ca01c7cc507983cfbebc30de724a9b40f50a0867ba83db22d44ab57167f98f8f18817894b214b5385e81616edde3a0eb4152d
|
7
|
+
data.tar.gz: 653417a26755edc0047a6a589b9f1f0ef06f080d09999d09e3899cf92ebbb5989670f7d19a6bf9c1549c9aee82ae332e222a4a17f8f24551fa36aa7074886a67
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
# This intended to fix bundler bug in Ruby 1.9.3 (see https://github.com/travis-ci/travis-ci/issues/5239)
|
4
|
+
before_install:
|
5
|
+
- gem install bundler
|
6
|
+
|
7
|
+
rvm:
|
8
|
+
- 2.3.8
|
9
|
+
- 2.4.10
|
10
|
+
- 2.5.9
|
11
|
+
- 2.6.7
|
12
|
+
- 2.7.3
|
13
|
+
- 3.0.1
|
14
|
+
|
15
|
+
# For code coverage reports
|
16
|
+
script: bundle exec rake
|
data/ATOMICITY.rdoc
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
= An Atomic Rant
|
2
|
+
|
3
|
+
== Brush Up Your Resume
|
4
|
+
|
5
|
+
You are probably not handling atomic operations properly in your app, and
|
6
|
+
probably have some nasty lurking race conditions. The worst part is these
|
7
|
+
will get worse as your user count increases, are difficult to reproduce,
|
8
|
+
and usually happen to your most critical pieces of code. (And no, your
|
9
|
+
rspec tests can't catch them either.)
|
10
|
+
|
11
|
+
Let's assume you're writing an app to enable students to enroll in courses.
|
12
|
+
You need to ensure that no more than 30 students can sign up for a given course.
|
13
|
+
In your enrollment code, you have something like this:
|
14
|
+
|
15
|
+
@course = Course.find(1)
|
16
|
+
if @course.num_students < 30
|
17
|
+
@course.course_students.create!(:student_id => 101)
|
18
|
+
@course.num_students += 1
|
19
|
+
@course.save!
|
20
|
+
else
|
21
|
+
# course is full
|
22
|
+
end
|
23
|
+
|
24
|
+
You're screwed. You now have 32 people in your 30 person class, and you have
|
25
|
+
no idea what happened.
|
26
|
+
|
27
|
+
"Well no duh," you're saying, "even the {ActiveRecord docs mention locking}[http://api.rubyonrails.org/classes/ActiveRecord/Locking/Pessimistic.html],
|
28
|
+
so I'll just use that."
|
29
|
+
|
30
|
+
@course = Course.find(1, :lock => true)
|
31
|
+
if @course.num_students < 30
|
32
|
+
# ...
|
33
|
+
|
34
|
+
Nice try, but now you've introduced other issues. Any other piece of code
|
35
|
+
in your entire app that needs to update _anything_ about the course - maybe
|
36
|
+
the course name, or start date, or location - is now serialized. If you need high
|
37
|
+
concurrency, you're still screwed.
|
38
|
+
|
39
|
+
You think, "ah-ha, the problem is having a separate counter!"
|
40
|
+
|
41
|
+
@course = Course.find(1)
|
42
|
+
if @course.course_students.count < 30
|
43
|
+
@course.course_students.create!(:student_id => 101)
|
44
|
+
else
|
45
|
+
# course is full
|
46
|
+
end
|
47
|
+
|
48
|
+
Nope. Still screwed.
|
49
|
+
|
50
|
+
== The Root Down
|
51
|
+
|
52
|
+
It's worth understanding the root issue, and how to address it.
|
53
|
+
|
54
|
+
Race conditions arise from the difference in time between *evaluating* and *altering*
|
55
|
+
a value. In our example, we fetched the record, then checked the value, then
|
56
|
+
changed it. The more lines of code between those operations, and the higher your user
|
57
|
+
count, the bigger the window of opportunity for other clients to get the data in an
|
58
|
+
inconsistent state.
|
59
|
+
|
60
|
+
Sometimes race conditions don't matter in practice, since often a user is
|
61
|
+
only operating their own data. This has a race condition, but is probably ok:
|
62
|
+
|
63
|
+
@post = Post.create(:user_id => @user.id, :title => "Whattup", ...)
|
64
|
+
@user.total_posts += 1 # update my post count
|
65
|
+
|
66
|
+
But this _would_ be problematic:
|
67
|
+
|
68
|
+
@post = Post.create(:user_id => @user.id, :title => "Whattup", ...)
|
69
|
+
@blog.total_posts += 1 # update post count across all users
|
70
|
+
|
71
|
+
As multiple users could be adding posts concurrently.
|
72
|
+
|
73
|
+
In a traditional RDBMS, you can increment counters atomically (but not return them)
|
74
|
+
by firing off an update statement that self-references the column:
|
75
|
+
|
76
|
+
update users set total_posts = total_posts + 1 where id = 372
|
77
|
+
|
78
|
+
You may have seen {ActiveRecord's increment_counter class method}[http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002278],
|
79
|
+
which wraps this functionality. But outside of being cumbersome, this has
|
80
|
+
the side effect that your object is no longer in sync with the DB, so you
|
81
|
+
get other issues:
|
82
|
+
|
83
|
+
Blog.increment_counter :total_posts, @blog.id
|
84
|
+
if @blog.total_posts == 1000
|
85
|
+
# the 1000th poster - award them a gold star!
|
86
|
+
|
87
|
+
The DB says 1000, but your @blog object still says 999, and the right person
|
88
|
+
doesn't get their gold star. Sad faces all around.
|
89
|
+
|
90
|
+
== A Better Way
|
91
|
+
|
92
|
+
Bottom line: Any operation that could alter a value *must* return that value in
|
93
|
+
the _same_ _operation_ for it to be atomic. If you do a separate get then set,
|
94
|
+
or set then get, you're open to a race condition. There are very few systems that
|
95
|
+
support an "increment and return" type operation, and Redis is one of them
|
96
|
+
(Oracle sequences are another).
|
97
|
+
|
98
|
+
When you think of the specific things that you need to ensure, many of these will
|
99
|
+
reduce to numeric operations:
|
100
|
+
|
101
|
+
* Ensuring there are no more than 30 students in a course
|
102
|
+
* Getting more than 2 but less than 6 people in a game
|
103
|
+
* Keeping a chat room to a max of 50 people
|
104
|
+
* Correctly recording the total number of blog posts
|
105
|
+
* Only allowing one piece of code to reorder a large dataset at a time
|
106
|
+
|
107
|
+
All except the last one can be implemented with counters. The last one
|
108
|
+
will need a carefully placed lock.
|
109
|
+
|
110
|
+
The best way I've found to balance atomicity and concurrency is, for each value,
|
111
|
+
actually create two counters:
|
112
|
+
|
113
|
+
* A counter you base logic on (eg, +slots_taken+)
|
114
|
+
* A counter users see (eg, +current_students+)
|
115
|
+
|
116
|
+
The reason you want two counters is you'll need to change the value of the logic
|
117
|
+
counter *first*, _before_ checking it, to address any race conditions. This means
|
118
|
+
the value can get wonky momentarily (eg, there could be 32 +slots_taken+ for a 30-person
|
119
|
+
course). This doesn't affect its function - indeed, it's part of what makes it work - but
|
120
|
+
does mean you don't want to display it.
|
121
|
+
|
122
|
+
So, taking our +Course+ example:
|
123
|
+
|
124
|
+
class Course < ActiveRecord::Base
|
125
|
+
include Redis::Atoms
|
126
|
+
|
127
|
+
counter :slots_taken
|
128
|
+
counter :current_students
|
129
|
+
end
|
130
|
+
|
131
|
+
Then:
|
132
|
+
|
133
|
+
@course = Course.find(1)
|
134
|
+
@course.slots_taken.increment do |val|
|
135
|
+
if val <= @course.max_students
|
136
|
+
@course.course_students.create!(:student_id => 101)
|
137
|
+
@course.current_students.increment
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
Race-condition free. And, with the separate +current_students+ counter, your
|
142
|
+
views get consistent information about the course, since it will only be
|
143
|
+
incremented on success. There is still a race condition where +current_students+
|
144
|
+
could be less than the real number of +CourseStudent+ records, but since you'll be
|
145
|
+
displaying these values in a view (after that block completes) you shouldn't see
|
146
|
+
this manifest in real-world usage.
|
147
|
+
|
148
|
+
Now you can sleep soundly, without fear of getting fired at 3am via an angry
|
149
|
+
phone call from your boss. (At least, not about this...)
|
150
|
+
|
151
|
+
== Author
|
152
|
+
|
153
|
+
Copyright (c) 2009 {Nate Wiger}[http://nate.wiger.org]. All Rights Reserved.
|
154
|
+
Rant released under {Creative Commons}[http://creativecommons.org/licenses/by/3.0/legalcode].
|
data/CHANGELOG.rdoc
ADDED
@@ -0,0 +1,362 @@
|
|
1
|
+
= Changelog for Redis::Objects
|
2
|
+
|
3
|
+
== 1.5.1 (10 Jul 2021)
|
4
|
+
|
5
|
+
* Added double-splat for **options to account for Ruby 3.0 [Nate Wiger]
|
6
|
+
|
7
|
+
* Fix ConnectionPoolProxy Ruby 3.0 compatibility Fix: https://github.com/nateware/redis-objects/pull/258 [Jean byroot Boussier]
|
8
|
+
|
9
|
+
* Change Redis#exists to Redis#exists? * bump redis version to 4.2 [Alina Hryshchuk]
|
10
|
+
|
11
|
+
* Local variable `dir` is not in use since 98226b95f35ef455f231692fdb679dfd61200a78 [Akira Matsuda]
|
12
|
+
|
13
|
+
* Issue 249: when atomic decrbyfloat fails, increment back instead of decrementing again [Slava Samoliuk]
|
14
|
+
|
15
|
+
* Update documentation to reflect ability to assign values directly [Artin Boghosian]
|
16
|
+
|
17
|
+
* Allow directly assigning values of lists, hashes and sets [Artin Boghosian]
|
18
|
+
|
19
|
+
|
20
|
+
== 1.5.0 (18 Sep 2019)
|
21
|
+
|
22
|
+
* updated README on expireat [Nate Wiger]
|
23
|
+
|
24
|
+
* Add option for using a custom serializer [Tomás Rojas]
|
25
|
+
|
26
|
+
* DRY up objects to enable custom prefixing when desired [Tomás Rojas]
|
27
|
+
|
28
|
+
* Allow spop to return multiple members [Evan Paul]
|
29
|
+
|
30
|
+
* Rename #delete! to #redis_delete_objects [Mattias Pfeiffer]
|
31
|
+
|
32
|
+
* Make deletion simpler with just 1 call to Redis [Mattias Pfeiffer]
|
33
|
+
|
34
|
+
* Move `CoreCommands` inclusion to `BaseObject` [Tomás Rojas]
|
35
|
+
|
36
|
+
* Move `Enumerable` functionality to `EnumerableObject` [Tomás Rojas]
|
37
|
+
|
38
|
+
* Move `attr_reader`s to `Redis::BaseObject` [Tomás Rojas]
|
39
|
+
|
40
|
+
== 1.4.3 (7 Oct 2018)
|
41
|
+
|
42
|
+
* Merge pull request #235 from johnc219/fix/end-time-expiration Add expiration in seconds to obtain end_time [Nate Wiger]
|
43
|
+
|
44
|
+
* Merge pull request #223 from artinboghosian/compress-redis-value Allow compression of value stored in Redis::Value to save memory on R… [Nate Wiger]
|
45
|
+
|
46
|
+
* Merge pull request #224 from artinboghosian/sorted-set-missing-operations Fix set operation methods on SortedSets [Nate Wiger]
|
47
|
+
|
48
|
+
* Merge pull request #233 from tmattia/master Add SortedSet#count alias so it's consistent with Set#count [Nate Wiger]
|
49
|
+
|
50
|
+
* Merge pull request #236 from nateware/revert-220-threadsafe Revert "Make Redis::Objects.connection thread-safe" [Nate Wiger]
|
51
|
+
|
52
|
+
* Revert "Make Redis::Objects.connection thread-safe" [Nate Wiger]
|
53
|
+
|
54
|
+
== 1.4.2 (29 Aug 2018)
|
55
|
+
|
56
|
+
* Merge pull request #227 from D-system/optimise_lock Optimise lock [Nate Wiger]
|
57
|
+
|
58
|
+
* Merge pull request #228 from D-system/travis_ruby_2.5 Travis: test against ruby 2.5 [Nate Wiger]
|
59
|
+
|
60
|
+
* Travis: test against ruby 2.5 [Thomas Brennetot]
|
61
|
+
|
62
|
+
* Lock: update comment [Thomas Brennetot]
|
63
|
+
|
64
|
+
* Lock: add backward compatibility [Thomas Brennetot]
|
65
|
+
|
66
|
+
* Use SET with the NX and the expiration option in a single request [Thomas Brennetot]
|
67
|
+
|
68
|
+
* Merge pull request #218 from edwardbako/list_pushed_count Return count of lpush & rpush commands [Nate Wiger]
|
69
|
+
|
70
|
+
* Merge pull request #220 from gammons/threadsafe Make Redis::Objects.connection thread-safe [Nate Wiger]
|
71
|
+
|
72
|
+
* Make Redis::Objects.connection threadsafe [Grant Ammons]
|
73
|
+
|
74
|
+
* Return count of lpush & rpush commands [Edward Bako]
|
75
|
+
|
76
|
+
* Removed support for versions of Ruby < 2.2 [Nate Wiger]
|
77
|
+
|
78
|
+
== 1.4.1 (Unreleased)
|
79
|
+
|
80
|
+
* Buggy release that was removed
|
81
|
+
|
82
|
+
== 1.4.0 (7 Dec 2017)
|
83
|
+
|
84
|
+
* Bumped dependency to redis.rb 4.0 [Nate Wiger]
|
85
|
+
|
86
|
+
== 1.3.1 (29 Aug 2017)
|
87
|
+
|
88
|
+
* Merge pull request #213 from onk/feature/proc_expireat Allow to set proc for expireat [Nate Wiger]
|
89
|
+
|
90
|
+
* Merge pull request #212 from yuzixun/hotfix/counter modify Counter#nil? [Nate Wiger]
|
91
|
+
|
92
|
+
* Merge pull request #207 from i2bskn/improve_bulk_get Reduce query to Redis. [Nate Wiger]
|
93
|
+
|
94
|
+
* Merge pull request #209 from yuzixun/hotfix/hash_key/bulk_related fix error when fields/keys is an array [Nate Wiger]
|
95
|
+
|
96
|
+
* Use pre-calculated symbols for instance_variable_(get|set) for performance #211 [Nate Wiger]
|
97
|
+
|
98
|
+
* Weird inheriting from version AR::Migration thingy [Nate Wiger]
|
99
|
+
|
100
|
+
* Reduce query to Redis. Don't query to Redis if #bulk_get/#bulk_values arguments is empty. [i2bskn]
|
101
|
+
|
102
|
+
== 1.3.0 (11 Mar 2017)
|
103
|
+
|
104
|
+
* handle two Redis::Counter objects adding/subtracting [Nate Wiger]
|
105
|
+
|
106
|
+
* Merge pull request #193 from Galathius/Galathius-patch-1 Doesn't set default value to redis when just try read [Galathius]
|
107
|
+
|
108
|
+
* Merge pull request #194 from oggy/pop-shift-n Add support for popping/shifting multiple elements from a List. [oggy]
|
109
|
+
|
110
|
+
* Merge pull request #199 from bf4/fix_hashkey_hmget_empty_collection Fixes case of hmget empty collection [bf4]
|
111
|
+
|
112
|
+
* Merge pull request #200 from liukgg/master Add method "mget" to improve efficiency for fetching values of multiple objects [liukgg]
|
113
|
+
|
114
|
+
* Fixes case of hmget empty collection to return nil or raise the appropriate error [Benjamin Fleischer]
|
115
|
+
|
116
|
+
* Merge pull request #189 from mneumark/add_delete_whole_object_method Add @object.delete! whole object delete method [mneumark]
|
117
|
+
|
118
|
+
* fix some tests for changes in AR 4.2 [nateware]
|
119
|
+
|
120
|
+
* Add support for popping/shifting multiple elements from a List like ruby's array [George Ogata]
|
121
|
+
|
122
|
+
* Merge pull request #187 from rossta/bug_fix_to_json Add more complete #to_json and #as_json to also address recursion bugs [Ross Kaffenberger]
|
123
|
+
|
124
|
+
* Doesn't set default value to redis if just try to read [Ilya Kamenko]
|
125
|
+
|
126
|
+
* Add specs for #as_json [Ross Kaffenberger]
|
127
|
+
|
128
|
+
* Implement BaseObject#as_json and #to_json in terms of #to_hash [Ross Kaffenberger]
|
129
|
+
|
130
|
+
* Add delete! method to Redis::Objects [Micah Neumark]
|
131
|
+
|
132
|
+
* Implement #value, #to_json for Redis::BaseObject to fix previous situations where #to_json would hang [Ross Kaffenberger]
|
133
|
+
|
134
|
+
* Reproduce blocking #to_json call issue #134 When using ActiveSupport's Object#to_json [Ross Kaffenberger]
|
135
|
+
|
136
|
+
== 1.2.1 (1 Nov 2015)
|
137
|
+
|
138
|
+
* Fixed use of #tap which caused issues with pipelined calls [Ross Kaffenberger]
|
139
|
+
|
140
|
+
* Removed setnx on get some value with default option [Ilya Kamenko]
|
141
|
+
|
142
|
+
== 1.2.0 (30 Apr 2015)
|
143
|
+
|
144
|
+
* New expiration implementation to address edge cases and missing methods [Ross Kaffenberger]
|
145
|
+
|
146
|
+
* Add support for expiration/expireat on HashKey#update [Ross Kaffenberger]
|
147
|
+
|
148
|
+
* Make locks with 0 timeout possible [Jean Boussier]
|
149
|
+
|
150
|
+
* Update hdel methods to support deleting multiple keys [Star]
|
151
|
+
|
152
|
+
== 1.1.0 (21 Jan 2015)
|
153
|
+
|
154
|
+
* Support connection_pool usage via a proxy object [Jared Jenkins]
|
155
|
+
|
156
|
+
* Fix typo on :counter usage [Kevin Bongart]
|
157
|
+
|
158
|
+
* Use parent redis_id_field if present [Arnaud Lavrard]
|
159
|
+
|
160
|
+
* Fetch the objects options through a redis_options method [Arnaud Lavrard]
|
161
|
+
|
162
|
+
== 1.0.1 (14 Oct 2014)
|
163
|
+
|
164
|
+
* Array handling for unmarshal [dreyks]
|
165
|
+
|
166
|
+
* Test against Ruby 2.1 / 2.2 on Travis CI [tricknotes]
|
167
|
+
|
168
|
+
* Redis::Set#randmember method accept count as optional parameter [xeviknal]
|
169
|
+
|
170
|
+
== 1.0.0 (25 Jul 2014)
|
171
|
+
|
172
|
+
* Fix expiration filter to handle atomic blocks, remove method aliasing [nateware]
|
173
|
+
|
174
|
+
* Fix incrbyfloat to actually return a float [james-lawrence]
|
175
|
+
|
176
|
+
* Allow false as default: value (bugfix) [james-lawrence]
|
177
|
+
|
178
|
+
* Allow unionstore and interstore between sorted sets and sets [jrdi]
|
179
|
+
|
180
|
+
* Add syntax highlighting to README.md [bartolsthoorn]
|
181
|
+
|
182
|
+
== 0.9.1 (25 Mar 2014)
|
183
|
+
|
184
|
+
* Fix bad marshal calls in SortedSet [Fleurer, nateware]
|
185
|
+
|
186
|
+
* Handle marshalling/unmarshalling of nil values [anujdas]
|
187
|
+
|
188
|
+
* Add :default as synonym to :start for Counter [Fleurer]
|
189
|
+
|
190
|
+
== 0.9.0 (6 Feb 2014)
|
191
|
+
|
192
|
+
* Ensure we don't double-unmarshal values, which could be a security issue [markijbema, nateware]
|
193
|
+
|
194
|
+
* Support a custom redis connection per redis key [hfwang]
|
195
|
+
|
196
|
+
* HashKey#fetch now behaves more similarly to Ruby [datapimp]
|
197
|
+
|
198
|
+
* Add incrbyfloat and decrbyfloat for values and hashes [nateware]
|
199
|
+
|
200
|
+
* Add support for @sorted_set.merge and variadic zadd [hfwang]
|
201
|
+
|
202
|
+
* Add support for srandmember for sets [LYY]
|
203
|
+
|
204
|
+
* Handle @set << [] in an intelligent way [kitchen]
|
205
|
+
|
206
|
+
* Add multi-unshift functionality [nateware]
|
207
|
+
|
208
|
+
* Additional test coverage for @sorted_set.merge and other ops [nateware]
|
209
|
+
|
210
|
+
== 0.8.0 (9 Nov 2013)
|
211
|
+
|
212
|
+
* Refactor to modular include/extend approach to enable hooking and remove evals [nateware]
|
213
|
+
|
214
|
+
* Custom id field via redis_id_field :whatever [liuming]
|
215
|
+
|
216
|
+
* Support marshaling of sorted set key names for incr/decr [hfwang]
|
217
|
+
|
218
|
+
* Add support for pushing multiple values into a list [scranton]
|
219
|
+
|
220
|
+
* Fix problematic typo in HashKey#fill [johnmaxwell]
|
221
|
+
|
222
|
+
* Fix wrong parameter order for revrangebyscore method [FoGhost]
|
223
|
+
|
224
|
+
* Convert to using Bundler from Jeweler to manage gem [nateware]
|
225
|
+
|
226
|
+
== 0.7.0 (27 Feb 2013)
|
227
|
+
|
228
|
+
* Enable inheritance of Redis::Objects models [rossta]
|
229
|
+
|
230
|
+
* Finally fix require/autoload so "require 'redis/foo'" is not needed [nateware]
|
231
|
+
|
232
|
+
* Redis::Objects.redis= now properly sets subclass handles as expected [nateware]
|
233
|
+
|
234
|
+
* Add lib/redis-objects.rb for easier Gemfile require [notEthan]
|
235
|
+
|
236
|
+
* Fix wrong readme line, fix some indentation [giglemad]
|
237
|
+
|
238
|
+
== 0.6.1 (13 Dec 2012)
|
239
|
+
|
240
|
+
* Fixed error that incorrectly specified activerecord as a gem dep [nateware]
|
241
|
+
|
242
|
+
== 0.6.0 (13 Dec 2012)
|
243
|
+
|
244
|
+
* Add +@set.merge()+ method to add multiple members at once [hfwang]
|
245
|
+
|
246
|
+
* Add +insert+ method to Redis::List instances [giglemad]
|
247
|
+
|
248
|
+
* Updated APIs for recent redis-server sort API compat [nateware]
|
249
|
+
|
250
|
+
* Add HashKey#bulk_values for fetching values in the same order than the given keys [aspgems]
|
251
|
+
|
252
|
+
* Lists now handle the insert command
|
253
|
+
|
254
|
+
* Changed +@sset.score+ method on SortedSet to return nil for invalid members [hkarthik]
|
255
|
+
|
256
|
+
* Test using redis-objects counters and fix when AR passes a string
|
257
|
+
|
258
|
+
* Add LSET to lists [neonlex]
|
259
|
+
|
260
|
+
* Fix interstore/unionstore for redis 2.6 [david]
|
261
|
+
|
262
|
+
* Redis-rb 3.0.0 support [seomoz]
|
263
|
+
|
264
|
+
* group_set_with_scores is no longer needed.
|
265
|
+
|
266
|
+
== 0.5.2 (13 Jun 2012)
|
267
|
+
|
268
|
+
* Added Redis::SortedSet#member? method [Karl Varga]
|
269
|
+
|
270
|
+
* Added +ttl+ method to CoreCommands [Karl Varga]
|
271
|
+
|
272
|
+
== 0.5.1 (23 May 2011)
|
273
|
+
|
274
|
+
* Fixed super class delegation conflicts with Redis Counters vs ActiveRecord [Tim Aßmann]
|
275
|
+
|
276
|
+
* Added zcount method to SortedSet [dunedain289]
|
277
|
+
|
278
|
+
* Updated redis-objects to look for Redis.current and prefer it over global $redis variable [Jean Boussier]
|
279
|
+
|
280
|
+
* Updated URLs to reflect new redis.io website [Jérémy Lecour]
|
281
|
+
|
282
|
+
== 0.5.0 (8 Nov 2010)
|
283
|
+
|
284
|
+
* Incompatible change: Had to rename Redis::Hash to Redis::HashKey due to internal conflicts with Redis lib and Ruby [Nate Wiger]
|
285
|
+
|
286
|
+
* Fixed AR counter override so that Redis::Objects doesn't hide AR counters [Mattias Pfeiffer]
|
287
|
+
|
288
|
+
* Fixed delete problem with Redis::List and complex values [Esdras Mayrink]
|
289
|
+
|
290
|
+
* Fix Redis::HashKey to support complex (marshaled) types [Mattias Pfeiffer]
|
291
|
+
|
292
|
+
* Group results of SortedSet#rangebyscore and #revrangebyscore if :withscores option is passed [Szymon Nowak]
|
293
|
+
|
294
|
+
* Updated Redis DEL semantics per API change [Gabe da Silveira]
|
295
|
+
|
296
|
+
== 0.4.1 (23 Aug 2010)
|
297
|
+
|
298
|
+
* Fixes for Ruby 1.8 failures due to missing flatten() [Gabe da Silveira]
|
299
|
+
|
300
|
+
* Enable subclasses of classes mixing in Redis::Objects to automatically pick up objects from their superclasses [Gabe da Silveira]
|
301
|
+
|
302
|
+
* Renamed prefix() and field_key() to redis_prefix() and redis_field_key() to prevent gem conflicts [Jason Meinzer]
|
303
|
+
|
304
|
+
* Fixed a typo in delete_if and added missing test coverage [Julio Capote, Nate Wiger]
|
305
|
+
|
306
|
+
== 0.4.0 (11 Aug 2010)
|
307
|
+
|
308
|
+
* Full support for redis hashes via new Redis::Hash class [Julio Capote, Nate Wiger]
|
309
|
+
|
310
|
+
* Now dependent on redis-rb client 2.0.4 or later. Should still be backwards compatible with redis-server 1.x
|
311
|
+
|
312
|
+
* Fixes to sets and sorted sets to bring them up to speed with redis-rb 2.0 from tomstuart [Tom Stuart]
|
313
|
+
|
314
|
+
* Incompatible change: Update list[x,y] and sorted_set[x,y] to work consistently with Ruby in all cases [Tom Stuart]
|
315
|
+
|
316
|
+
* Refactoring to make constructors common across all object types from dbalatero [David Balatero]
|
317
|
+
|
318
|
+
* Renamed :withscores option to :with_scores for consistency with redis-rb 2.0, but kept backwards compat [Tom Stuart, Nate Wiger]
|
319
|
+
|
320
|
+
== 0.3.2 (21 Jul 2010)
|
321
|
+
|
322
|
+
* New "maxlength" option to Redis::List can create length-limited lists (eg, like a ring buffer) from dbalatero [David Balatero]
|
323
|
+
|
324
|
+
* Fix score conversions in Redis::SortedSet (scores are floats, not ints) from tomstuart [Tom Stuart]
|
325
|
+
|
326
|
+
* Switched from rspec to bacon for tests
|
327
|
+
|
328
|
+
== 0.3.1 (1 Jun 2010)
|
329
|
+
|
330
|
+
* Integrated fixes for sorted_set deletions from capotej [Julio Capote]
|
331
|
+
|
332
|
+
== 0.3.0 (14 Apr 2010)
|
333
|
+
|
334
|
+
* Due to Ruby 1.9 bugs and performance considerations, marshaling of data types is now OFF by default. You must say :marshal => true for any objects that you want serialization enabled on. [Nate Wiger]
|
335
|
+
|
336
|
+
* Sorted Set class changed slightly due to feedback. You can now get an individual element back via @set['item'] since it acts like a Hash.
|
337
|
+
|
338
|
+
== 0.2.4 (9 Apr 2010)
|
339
|
+
|
340
|
+
* Added sorted set support via Redis::SortedSet [Nate Wiger]
|
341
|
+
|
342
|
+
== 0.2.3 (18 Feb 2010)
|
343
|
+
|
344
|
+
* Added lock expiration to Redis::Lock [Ben VandenBos]
|
345
|
+
|
346
|
+
* Fixed some bugs [Ben VandenBos]
|
347
|
+
|
348
|
+
* Added lock tests and test helpers [Ben VandenBos]
|
349
|
+
|
350
|
+
== 0.2.2 (14 Dec 2009)
|
351
|
+
|
352
|
+
* Added @set.diff(@set2) with "^" and "-" synonyms (oversight). [Nate Wiger]
|
353
|
+
|
354
|
+
* Implemented Redis core commands in all data types, such as rename. [Nate Wiger]
|
355
|
+
|
356
|
+
* Renamed Redis::Serialize to Redis::Helpers::Serialize to keep Redis:: cleaner. [Nate Wiger]
|
357
|
+
|
358
|
+
* More spec coverage. [Nate Wiger]
|
359
|
+
|
360
|
+
== 0.2.1 (27 Nov 2009)
|
361
|
+
|
362
|
+
* First worthwhile public release, with good spec coverage and functionality. [Nate Wiger]
|
data/Gemfile
ADDED