activity_feed 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use ruby-1.9.3-p0@activity_feed_gem --create
1
+ rvm use ruby-1.9.3@activity_feed_gem --create
data/CHANGELOG.markdown CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.4.0
4
+
5
+ * Added support for [Mongoid](http://www.mongoid.org)
6
+
3
7
  ## 1.3.0
4
8
 
5
9
  * `ActivityFeed.update_item(user_id, item_id, timestamp, aggregate = false)` allows for updating an activity feed item in the personal or aggregate feed
data/README.markdown CHANGED
@@ -15,7 +15,7 @@ or:
15
15
  `gem 'activity_feed'`
16
16
 
17
17
  Make sure your redis server is running! Redis configuration is outside the scope of this README, but
18
- check out the Redis documentation, http://redis.io/documentation.
18
+ check out the [Redis documentation](http://redis.io/documentation).
19
19
 
20
20
  ## Configuration
21
21
 
@@ -42,23 +42,14 @@ ActivityFeed.redis = $redis
42
42
  ActivityFeed defaults to using memory-backed persistence, storing the full item as JSON in Redis.
43
43
 
44
44
  ```ruby
45
- ruby-1.9.2-p290 :001 > require 'redis'
46
- => true
47
- ruby-1.9.2-p290 :002 > $redis = Redis.new(:host => 'localhost', :port => 6379)
48
- => #<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>
49
- ruby-1.9.2-p290 :003 > require 'activity_feed'
50
- => true
51
- ruby-1.9.2-p290 :004 > ActivityFeed.redis = $redis
52
- => #<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>
53
- ruby-1.9.2-p290 :005 > ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'Text')
54
- => #<ActivityFeed::Memory::Item:0x00000100ceaaa8 @attributes={:user_id=>1, :nickname=>"David Czarnecki", :type=>"activity-type", :text=>"Text"}, @user_id=1, @nickname="David Czarnecki", @type="activity-type", @text="Text">
55
- ruby-1.9.2-p290 :006 > ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'More text')
56
- => #<ActivityFeed::Memory::Item:0x000001022b0c48 @attributes={:user_id=>1, :nickname=>"David Czarnecki", :type=>"activity-type", :text=>"More text"}, @user_id=1, @nickname="David Czarnecki", @type="activity-type", @text="More text">
57
- ruby-1.9.2-p290 :007 > feed = ActivityFeed::Feed.new(1)
58
- => #<ActivityFeed::Feed:0x00000103023b78 @feederboard=#<Leaderboard:0x00000103023a88 @leaderboard_name="activity:feed:1", @page_size=25, @redis_connection=#<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>>>
59
- ruby-1.9.2-p290 :008 > feed.page(1)
60
- => [{"user_id"=>1, "nickname"=>"David Czarnecki", "type"=>"activity-type", "text"=>"More text"}, {"user_id"=>1, "nickname"=>"David Czarnecki", "type"=>"activity-type", "text"=>"Text"}]
61
- ruby-1.9.2-p290 :009 >
45
+ require 'redis'
46
+ $redis = Redis.new(:host => 'localhost', :port => 6379)
47
+ require 'activity_feed'
48
+ ActivityFeed.redis = $redis
49
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'Text')
50
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'More text')
51
+ feed = ActivityFeed::Feed.new(1)
52
+ feed.page(1)
62
53
  ```
63
54
 
64
55
  ### ActiveRecord persistence
@@ -73,55 +64,41 @@ ActivityFeed.persistence = :active_record
73
64
  Example:
74
65
 
75
66
  ```ruby
76
- ruby-1.9.2-p290 :001 > require 'active_record'
77
- => true
78
- ruby-1.9.2-p290 :002 >
79
- ruby-1.9.2-p290 :003 > ActiveRecord::Base.establish_connection(
80
- ruby-1.9.2-p290 :004 > :adapter => "sqlite3",
81
- ruby-1.9.2-p290 :005 > :database => ":memory:"
82
- ruby-1.9.2-p290 :006?> )
83
- => #<ActiveRecord::ConnectionAdapters::ConnectionPool:0x00000101329cc0 @spec=#<ActiveRecord::Base::ConnectionSpecification:0x00000101329d38 @config={:adapter=>"sqlite3", :database=>":memory:"}, @adapter_method="sqlite3_connection">, @reserved_connections={}, @connection_mutex=#<Monitor:0x00000101329bd0 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x00000101329b80>>, @queue=#<MonitorMixin::ConditionVariable:0x00000101329b30 @monitor=#<Monitor:0x00000101329bd0 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x00000101329b80>>, @cond=#<ConditionVariable:0x00000101329b08 @waiters=[], @waiters_mutex=#<Mutex:0x00000101329978>>>, @timeout=5, @size=5, @connections=[], @checked_out=[], @automatic_reconnect=true, @tables={}, @visitor=nil, @columns={}, @columns_hash={}, @column_defaults={}, @primary_keys={}>
84
- ruby-1.9.2-p290 :007 >
85
- ruby-1.9.2-p290 :008 > ActiveRecord::Migration.verbose = false
86
- => false
87
- ruby-1.9.2-p290 :009 >
88
- ruby-1.9.2-p290 :010 > ActiveRecord::Schema.define do
89
- ruby-1.9.2-p290 :011 > create_table :activity_feed_items, :force => true do |t|
90
- ruby-1.9.2-p290 :012 > t.integer :user_id
91
- ruby-1.9.2-p290 :013?> t.string :nickname
92
- ruby-1.9.2-p290 :014?> t.string :type
93
- ruby-1.9.2-p290 :015?> t.string :title
94
- ruby-1.9.2-p290 :016?> t.text :text
95
- ruby-1.9.2-p290 :017?> t.string :url
96
- ruby-1.9.2-p290 :018?> t.string :icon
97
- ruby-1.9.2-p290 :019?> t.boolean :sticky
98
- ruby-1.9.2-p290 :020?>
99
- ruby-1.9.2-p290 :021 > t.timestamps
100
- ruby-1.9.2-p290 :022?> end
101
- ruby-1.9.2-p290 :023?>
102
- ruby-1.9.2-p290 :024 > add_index :activity_feed_items, :user_id
103
- ruby-1.9.2-p290 :025?> end
104
- => nil
105
- ruby-1.9.2-p290 :026 >
106
- ruby-1.9.2-p290 :027 > require 'redis'
107
- => true
108
- ruby-1.9.2-p290 :028 > $redis = Redis.new(:host => 'localhost', :port => 6379)
109
- => #<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>
110
- ruby-1.9.2-p290 :029 > require 'activity_feed'
111
- => true
112
- ruby-1.9.2-p290 :030 > ActivityFeed.redis = $redis
113
- => #<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>
114
- ruby-1.9.2-p290 :031 > ActivityFeed.persistence = :active_record
115
- => :active_record
116
- ruby-1.9.2-p290 :032 > ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'Text')
117
- => #<ActivityFeed::ActiveRecord::Item id: 1, user_id: 1, nickname: "David Czarnecki", type: nil, title: nil, text: "Text", url: nil, icon: nil, sticky: nil, created_at: "2011-09-14 15:08:22", updated_at: "2011-09-14 15:08:22">
118
- ruby-1.9.2-p290 :033 > ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'More text')
119
- => #<ActivityFeed::ActiveRecord::Item id: 2, user_id: 1, nickname: "David Czarnecki", type: nil, title: nil, text: "More text", url: nil, icon: nil, sticky: nil, created_at: "2011-09-14 15:08:25", updated_at: "2011-09-14 15:08:25">
120
- ruby-1.9.2-p290 :034 > feed = ActivityFeed::Feed.new(1)
121
- => #<ActivityFeed::Feed:0x000001030f1898 @feederboard=#<Leaderboard:0x000001030f1578 @leaderboard_name="activity:feed:1", @page_size=25, @redis_connection=#<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>>>
122
- ruby-1.9.2-p290 :035 > feed.page(1)
123
- => [#<ActivityFeed::ActiveRecord::Item id: 2, user_id: 1, nickname: "David Czarnecki", type: nil, title: nil, text: "More text", url: nil, icon: nil, sticky: nil, created_at: "2011-09-14 15:08:25", updated_at: "2011-09-14 15:08:25">, #<ActivityFeed::ActiveRecord::Item id: 1, user_id: 1, nickname: "David Czarnecki", type: nil, title: nil, text: "Text", url: nil, icon: nil, sticky: nil, created_at: "2011-09-14 15:08:22", updated_at: "2011-09-14 15:08:22">]
124
- ruby-1.9.2-p290 :036 >
67
+ require 'active_record'
68
+
69
+ ActiveRecord::Base.establish_connection(
70
+ :adapter => "sqlite3",
71
+ :database => ":memory:"
72
+ )
73
+
74
+ ActiveRecord::Migration.verbose = false
75
+
76
+ ActiveRecord::Schema.define do
77
+ create_table :activity_feed_items, :force => true do |t|
78
+ t.integer :user_id
79
+ t.string :nickname
80
+ t.string :type
81
+ t.string :title
82
+ t.text :text
83
+ t.string :url
84
+ t.string :icon
85
+ t.boolean :sticky
86
+
87
+ t.timestamps
88
+ end
89
+
90
+ add_index :activity_feed_items, :user_id
91
+ end
92
+
93
+ require 'redis'
94
+ $redis = Redis.new(:host => 'localhost', :port => 6379)
95
+ require 'activity_feed'
96
+ ActivityFeed.redis = $redis
97
+ ActivityFeed.persistence = :active_record
98
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'Text')
99
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'More text')
100
+ feed = ActivityFeed::Feed.new(1)
101
+ feed.page(1)
125
102
  ```
126
103
 
127
104
  ### MongoMapper persistence
@@ -142,31 +119,52 @@ MongoMapper.database = 'activity_feeds_production'
142
119
  ```
143
120
 
144
121
  ```ruby
145
- ruby-1.9.2-p290 :001 > require 'mongo_mapper'
146
- => true
147
- ruby-1.9.2-p290 :002 > MongoMapper.connection = Mongo::Connection.new('localhost', 27017)
148
- => #<Mongo::Connection:0x00000100c7d520 @host_to_try=["localhost", 27017], @port=nil, @host=nil, @slave_ok=nil, @auths=[], @id_lock=#<Mutex:0x00000100c7d480>, @pool_size=1, @timeout=5.0, @op_timeout=nil, @connection_mutex=#<Mutex:0x00000100c7d458>, @safe=false, @safe_mutexes={#<TCPSocket:(closed)>=>#<Mutex:0x00000100c6f8a8>, #<TCPSocket:fd 5>=>#<Mutex:0x00000100c6db70>}, @queue=#<ConditionVariable:0x00000100c7d390 @waiters=[], @waiters_mutex=#<Mutex:0x00000100c7d340>>, @primary=["localhost", 27017], @primary_pool=#<Mongo::Pool:0x00000100c6f128 @connection=#<Mongo::Connection:0x00000100c7d520 ...>, @port=27017, @host="localhost", @size=1, @timeout=5.0, @connection_mutex=#<Mutex:0x00000100c6f100>, @queue=#<ConditionVariable:0x00000100c6f0b0 @waiters=[], @waiters_mutex=#<Mutex:0x00000100c6f060>>, @socket_ops={#<TCPSocket:fd 5>=>[]}, @sockets=[#<TCPSocket:fd 5>], @pids={#<TCPSocket:fd 5>=>61344}, @checked_out=[]>, @logger=nil, @read_primary=true>
149
- ruby-1.9.2-p290 :003 > MongoMapper.database = 'activity_feed_gem_test'
150
- => "activity_feed_gem_test"
151
- ruby-1.9.2-p290 :004 > require 'redis'
152
- => true
153
- ruby-1.9.2-p290 :005 > $redis = Redis.new(:host => 'localhost', :port => 6379)
154
- => #<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>
155
- ruby-1.9.2-p290 :006 > require 'activity_feed'
156
- => true
157
- ruby-1.9.2-p290 :007 > ActivityFeed.redis = $redis
158
- => #<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>
159
- ruby-1.9.2-p290 :008 > ActivityFeed.persistence = :mongo_mapper
160
- => :mongo_mapper
161
- ruby-1.9.2-p290 :009 > ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'Text')
162
- => #<ActivityFeed::MongoMapper::Item _id: BSON::ObjectId('4e70dcc512dac1efa0000001'), created_at: 2011-09-14 16:56:37 UTC, nickname: "David Czarnecki", text: "Text", type: "activity-type", updated_at: 2011-09-14 16:56:37 UTC, user_id: 1>
163
- ruby-1.9.2-p290 :010 > ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'More text')
164
- => #<ActivityFeed::MongoMapper::Item _id: BSON::ObjectId('4e70dcc512dac1efa0000003'), created_at: 2011-09-14 16:56:37 UTC, nickname: "David Czarnecki", text: "More text", type: "activity-type", updated_at: 2011-09-14 16:56:37 UTC, user_id: 1>
165
- ruby-1.9.2-p290 :011 > feed = ActivityFeed::Feed.new(1)
166
- => #<ActivityFeed::Feed:0x00000100c583d8 @feederboard=#<Leaderboard:0x00000100c58298 @leaderboard_name="activity:feed:1", @page_size=25, @redis_connection=#<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>>>
167
- ruby-1.9.2-p290 :012 > feed.page(1)
168
- => [#<ActivityFeed::MongoMapper::Item _id: BSON::ObjectId('4e70dcc512dac1efa0000003'), created_at: 2011-09-14 16:56:37 UTC, nickname: "David Czarnecki", text: "More text", type: "activity-type", updated_at: 2011-09-14 16:56:37 UTC, user_id: 1>, #<ActivityFeed::MongoMapper::Item _id: BSON::ObjectId('4e70dcc512dac1efa0000001'), created_at: 2011-09-14 16:56:37 UTC, nickname: "David Czarnecki", text: "Text", type: "activity-type", updated_at: 2011-09-14 16:56:37 UTC, user_id: 1>]
169
- ruby-1.9.2-p290 :013 >
122
+ require 'mongo_mapper'
123
+ MongoMapper.connection = Mongo::Connection.new('localhost', 27017)
124
+ MongoMapper.database = 'activity_feed_gem_test'
125
+ require 'redis'
126
+ $redis = Redis.new(:host => 'localhost', :port => 6379)
127
+ require 'activity_feed'
128
+ ActivityFeed.redis = $redis
129
+ ActivityFeed.persistence = :mongo_mapper
130
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'Text')
131
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'More text')
132
+ feed = ActivityFeed::Feed.new(1)
133
+ feed.page(1)
134
+ ```
135
+
136
+ ### Mongoid persistence
137
+
138
+ ActivityFeed can also use Mongoid to persist the items to more durable storage while
139
+ keeping the IDs for the activity feed items in Redis. You can set this using:
140
+
141
+ ```ruby
142
+ ActivityFeed.persistence = :mongoid
143
+ ```
144
+
145
+ Make sure Mongoid is configured correctly before setting this option.
146
+ If using Activity Feed outside of Rails, you can do:
147
+
148
+ ```ruby
149
+ Mongoid.configure do |config|
150
+ config.master = Mongo::Connection.new.db("activity_feed_gem_test")
151
+ end
152
+ ```
153
+
154
+ ```ruby
155
+ require 'mongoid'
156
+ Mongoid.configure do |config|
157
+ config.master = Mongo::Connection.new.db("activity_feed_gem_test")
158
+ end
159
+ require 'redis'
160
+ $redis = Redis.new(:host => 'localhost', :port => 6379)
161
+ require 'activity_feed'
162
+ ActivityFeed.redis = $redis
163
+ ActivityFeed.persistence = :mongoid
164
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'Text')
165
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'More text')
166
+ feed = ActivityFeed::Feed.new(1)
167
+ feed.page(1)
170
168
  ```
171
169
 
172
170
  ### Ohm persistence
@@ -174,25 +172,15 @@ ruby-1.9.2-p290 :013 >
174
172
  ActivityFeed can also use Ohm to persist the items in Redis. You can set this using:
175
173
 
176
174
  ```ruby
177
- ruby-1.9.2-p290 :001 > require 'redis'
178
- => true
179
- ruby-1.9.2-p290 :002 > $redis = Redis.new(:host => 'localhost', :port => 6379)
180
- => #<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.5)>
181
- ruby-1.9.2-p290 :003 > require 'activity_feed'
182
- => true
183
- ruby-1.9.2-p290 :004 > ActivityFeed.redis = $redis
184
- => #<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.5)>
185
- ruby-1.9.2-p290 :005 > ActivityFeed.persistence = :ohm
186
- => :ohm
187
- ruby-1.9.2-p290 :006 > ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'Text')
188
- => #<ActivityFeed::Ohm::Item:1 created_at="2011-10-08 17:40:03 UTC" updated_at="2011-10-08 17:40:03 UTC" user_id=1 nickname="David Czarnecki" type="activity-type" title=nil text="Text" url=nil icon=nil sticky=nil>
189
- ruby-1.9.2-p290 :007 > ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'More text')
190
- => #<ActivityFeed::Ohm::Item:2 created_at="2011-10-08 17:40:25 UTC" updated_at="2011-10-08 17:40:25 UTC" user_id=1 nickname="David Czarnecki" type="activity-type" title=nil text="More text" url=nil icon=nil sticky=nil>
191
- ruby-1.9.2-p290 :008 > feed = ActivityFeed::Feed.new(1)
192
- => #<ActivityFeed::Feed:0x007fd009bc05f8 @feederboard=#<Leaderboard:0x007fd009bc0508 @leaderboard_name="activity:feed:1", @page_size=25, @redis_connection=#<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.5)>>>
193
- ruby-1.9.2-p290 :009 > feed.page(1)
194
- => [#<ActivityFeed::Ohm::Item:2 created_at="2011-10-08 17:40:25 UTC" updated_at="2011-10-08 17:40:25 UTC" user_id="1" nickname="David Czarnecki" type="activity-type" title=nil text="More text" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:1 created_at="2011-10-08 17:40:03 UTC" updated_at="2011-10-08 17:40:03 UTC" user_id="1" nickname="David Czarnecki" type="activity-type" title=nil text="Text" url=nil icon=nil sticky=nil>]
195
- ruby-1.9.2-p290 :010 >
175
+ require 'redis'
176
+ $redis = Redis.new(:host => 'localhost', :port => 6379)
177
+ require 'activity_feed'
178
+ ActivityFeed.redis = $redis
179
+ ActivityFeed.persistence = :ohm
180
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'Text')
181
+ ActivityFeed.create_item(:user_id => 1, :nickname => 'David Czarnecki', :type => 'activity-type', :text => 'More text')
182
+ feed = ActivityFeed::Feed.new(1)
183
+ feed.page(1)
196
184
  ```
197
185
 
198
186
  ### Custom persistence
@@ -241,42 +229,22 @@ You can control aggregation globally by setting the ActivityFeed.aggregate prope
241
229
  Below is an example of an aggregate feed:
242
230
 
243
231
  ```ruby
244
- ruby-1.9.2-p290 :001 > require 'activity_feed'
245
- => true
246
- ruby-1.9.2-p290 :002 > require 'pp'
247
- => true
248
- ruby-1.9.2-p290 :003 >
249
- ruby-1.9.2-p290 :004 > $redis = Redis.new(:host => '127.0.0.1', :port => 6379)
250
- => #<Redis client v2.2.2 connected to redis://127.0.0.1:6379/0 (Redis v2.4.4)>
251
- ruby-1.9.2-p290 :005 > ActivityFeed.redis = $redis
252
- => #<Redis client v2.2.2 connected to redis://127.0.0.1:6379/0 (Redis v2.4.4)>
253
- ruby-1.9.2-p290 :006 > ActivityFeed.persistence = :ohm
254
- => :ohm
255
- ruby-1.9.2-p290 :007 >
256
- ruby-1.9.2-p290 :008 > 1.upto(5) do |index|
257
- ruby-1.9.2-p290 :009 > item = ActivityFeed.create_item(:user_id => 1, :nickname => 'nickname_1', :text => "text_#{index}")
258
- ruby-1.9.2-p290 :010?> sleep(1)
259
- ruby-1.9.2-p290 :011?> another_item = ActivityFeed.create_item(:user_id => 2, :nickname => 'nickname_2', :text => "test_nickname2_#{index}")
260
- ruby-1.9.2-p290 :012?> sleep(1)
261
- ruby-1.9.2-p290 :013?> ActivityFeed.aggregate_item(another_item, 1)
262
- ruby-1.9.2-p290 :014?> end
263
- => 1
264
- ruby-1.9.2-p290 :015 >
265
- ruby-1.9.2-p290 :016 > feed = ActivityFeed::Feed.new(1)
266
- => #<ActivityFeed::Feed:0x000001014b9298 @feederboard=#<Leaderboard:0x000001014b91a8 @leaderboard_name="activity:feed:1", @page_size=25, @redis_connection=#<Redis client v2.2.2 connected to redis://127.0.0.1:6379/0 (Redis v2.4.4)>>, @feederboard_aggregate=#<Leaderboard:0x000001014b9090 @leaderboard_name="activity:feed:aggregate:1", @page_size=25, @redis_connection=#<Redis client v2.2.2 connected to redis://127.0.0.1:6379/0 (Redis v2.4.4)>>>
267
- ruby-1.9.2-p290 :017 > pp feed.page(1, true)
268
- [#<ActivityFeed::Ohm::Item:10 created_at="2011-11-29 21:18:40 UTC" updated_at="2011-11-29 21:18:40 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_5" url=nil icon=nil sticky=nil>,
269
- #<ActivityFeed::Ohm::Item:9 created_at="2011-11-29 21:18:39 UTC" updated_at="2011-11-29 21:18:39 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_5" url=nil icon=nil sticky=nil>,
270
- #<ActivityFeed::Ohm::Item:8 created_at="2011-11-29 21:18:38 UTC" updated_at="2011-11-29 21:18:38 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_4" url=nil icon=nil sticky=nil>,
271
- #<ActivityFeed::Ohm::Item:7 created_at="2011-11-29 21:18:37 UTC" updated_at="2011-11-29 21:18:37 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_4" url=nil icon=nil sticky=nil>,
272
- #<ActivityFeed::Ohm::Item:6 created_at="2011-11-29 21:18:36 UTC" updated_at="2011-11-29 21:18:36 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_3" url=nil icon=nil sticky=nil>,
273
- #<ActivityFeed::Ohm::Item:5 created_at="2011-11-29 21:18:35 UTC" updated_at="2011-11-29 21:18:35 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_3" url=nil icon=nil sticky=nil>,
274
- #<ActivityFeed::Ohm::Item:4 created_at="2011-11-29 21:18:34 UTC" updated_at="2011-11-29 21:18:34 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_2" url=nil icon=nil sticky=nil>,
275
- #<ActivityFeed::Ohm::Item:3 created_at="2011-11-29 21:18:33 UTC" updated_at="2011-11-29 21:18:33 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_2" url=nil icon=nil sticky=nil>,
276
- #<ActivityFeed::Ohm::Item:2 created_at="2011-11-29 21:18:32 UTC" updated_at="2011-11-29 21:18:32 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_1" url=nil icon=nil sticky=nil>,
277
- #<ActivityFeed::Ohm::Item:1 created_at="2011-11-29 21:18:31 UTC" updated_at="2011-11-29 21:18:31 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_1" url=nil icon=nil sticky=nil>]
278
- => [#<ActivityFeed::Ohm::Item:10 created_at="2011-11-29 21:18:40 UTC" updated_at="2011-11-29 21:18:40 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_5" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:9 created_at="2011-11-29 21:18:39 UTC" updated_at="2011-11-29 21:18:39 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_5" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:8 created_at="2011-11-29 21:18:38 UTC" updated_at="2011-11-29 21:18:38 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_4" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:7 created_at="2011-11-29 21:18:37 UTC" updated_at="2011-11-29 21:18:37 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_4" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:6 created_at="2011-11-29 21:18:36 UTC" updated_at="2011-11-29 21:18:36 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_3" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:5 created_at="2011-11-29 21:18:35 UTC" updated_at="2011-11-29 21:18:35 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_3" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:4 created_at="2011-11-29 21:18:34 UTC" updated_at="2011-11-29 21:18:34 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_2" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:3 created_at="2011-11-29 21:18:33 UTC" updated_at="2011-11-29 21:18:33 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_2" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:2 created_at="2011-11-29 21:18:32 UTC" updated_at="2011-11-29 21:18:32 UTC" user_id="2" nickname="nickname_2" type=nil title=nil text="test_nickname2_1" url=nil icon=nil sticky=nil>, #<ActivityFeed::Ohm::Item:1 created_at="2011-11-29 21:18:31 UTC" updated_at="2011-11-29 21:18:31 UTC" user_id="1" nickname="nickname_1" type=nil title=nil text="text_1" url=nil icon=nil sticky=nil>]
279
- ruby-1.9.2-p290 :018 >
232
+ require 'activity_feed'
233
+ require 'pp'
234
+ $redis = Redis.new(:host => '127.0.0.1', :port => 6379)
235
+ ActivityFeed.redis = $redis
236
+ ActivityFeed.persistence = :ohm
237
+
238
+ 1.upto(5) do |index|
239
+ item = ActivityFeed.create_item(:user_id => 1, :nickname => 'nickname_1', :text => "text_#{index}")
240
+ sleep(1)
241
+ another_item = ActivityFeed.create_item(:user_id => 2, :nickname => 'nickname_2', :text => "test_nickname2_#{index}")
242
+ sleep(1)
243
+ ActivityFeed.aggregate_item(another_item, 1)
244
+ end
245
+
246
+ feed = ActivityFeed::Feed.new(1)
247
+ pp feed.page(1, true)
280
248
  ```
281
249
 
282
250
  ### Updating and Removing Activity Feed Items
@@ -288,10 +256,6 @@ ActivityFeed.update_item(user_id, item_id, timestamp, aggregate = false)
288
256
  ActivityFeed.delete_item(user_id, item_id, aggregate = false)
289
257
  ```
290
258
 
291
- ## Future Plans
292
-
293
- * Suggestions?
294
-
295
259
  ## Contributing to Activity Feed
296
260
 
297
261
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
@@ -305,3 +269,4 @@ ActivityFeed.delete_item(user_id, item_id, aggregate = false)
305
269
  ## Copyright
306
270
 
307
271
  Copyright (c) 2011-2012 David Czarnecki. See LICENSE.txt for further details.
272
+
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_development_dependency('database_cleaner')
25
25
  s.add_development_dependency('fabrication')
26
26
 
27
+ s.add_development_dependency('mongoid')
27
28
  s.add_development_dependency('mongo_mapper')
28
29
  s.add_development_dependency('mongo_ext')
29
30
  s.add_development_dependency('bson_ext')
data/lib/activity_feed.rb CHANGED
@@ -26,6 +26,9 @@ module ActivityFeed
26
26
  when :mongo_mapper
27
27
  require 'activity_feed/mongo_mapper/item'
28
28
  klazz = ActivityFeed::MongoMapper::Item
29
+ when :mongoid
30
+ require 'activity_feed/mongoid/item'
31
+ klazz = ActivityFeed::Mongoid::Item
29
32
  when :ohm
30
33
  require 'activity_feed/ohm/item'
31
34
  klazz = ActivityFeed::Ohm::Item
@@ -50,7 +53,7 @@ module ActivityFeed
50
53
  def self.aggregate_item(item, user_id = nil)
51
54
  user_id_for_aggregate = user_id.nil? ? item.user_id : user_id
52
55
  case @@persistence_type
53
- when :active_record, :mongo_mapper
56
+ when :active_record, :mongo_mapper, :mongoid
54
57
  ActivityFeed.redis.zadd(ActivityFeed.feed_key(user_id_for_aggregate, true), item.created_at.to_i, item.id)
55
58
  when :ohm
56
59
  ActivityFeed.redis.zadd(ActivityFeed.feed_key(user_id_for_aggregate, true), DateTime.parse(item.created_at).to_i, item.id)
@@ -67,6 +70,8 @@ module ActivityFeed
67
70
  JSON.parse(item_or_item_id)
68
71
  when :mongo_mapper
69
72
  ActivityFeed::MongoMapper::Item.find(item_or_item_id)
73
+ when :mongoid
74
+ ActivityFeed::Mongoid::Item.find(item_or_item_id)
70
75
  when :ohm
71
76
  ActivityFeed::Ohm::Item[item_or_item_id]
72
77
  else
@@ -0,0 +1,31 @@
1
+ require 'mongoid'
2
+
3
+ module ActivityFeed
4
+ module Mongoid
5
+ class Item
6
+ include ::Mongoid::Document
7
+ include ::Mongoid::Timestamps
8
+
9
+ field :user_id, type: Integer
10
+ validates_presence_of :user_id
11
+
12
+ field :nickname, type: String
13
+ field :type, type: String
14
+ field :title, type: String
15
+ field :text, type: String
16
+ field :url, type: String
17
+ field :icon, type: String
18
+ field :sticky, type: Boolean
19
+
20
+ index :user_id
21
+
22
+ after_save :update_redis
23
+
24
+ private
25
+
26
+ def update_redis
27
+ ActivityFeed.redis.zadd(ActivityFeed.feed_key(self.user_id), self.created_at.to_i, self.id)
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module ActivityFeed
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -34,6 +34,18 @@ describe ActivityFeed do
34
34
  ActivityFeed::MongoMapper::Item.count.should be(1)
35
35
  end
36
36
 
37
+ it 'should allow you to create a new item using :mongoid' do
38
+ user_id = 1
39
+ ActivityFeed.persistence = :mongoid
40
+
41
+ ActivityFeed::Mongoid::Item.count.should be(0)
42
+ ActivityFeed.redis.zcard(ActivityFeed.feed_key(user_id)).should be(0)
43
+ activity_feed_item = ActivityFeed.create_item(:user_id => user_id, :text => 'This is text for my activity feed')
44
+ ActivityFeed.redis.zcard(ActivityFeed.feed_key(user_id)).should be(1)
45
+ ActivityFeed.redis.zcard(ActivityFeed.feed_key(user_id, true)).should be(1)
46
+ ActivityFeed::Mongoid::Item.count.should be(1)
47
+ end
48
+
37
49
  it 'should allow you to create a new item using :active_record' do
38
50
  user_id = 1
39
51
  ActivityFeed.persistence = :active_record
@@ -90,6 +102,15 @@ describe ActivityFeed do
90
102
  loaded_item.should == item
91
103
  end
92
104
 
105
+ it 'should allow you to load an item using :mongoid' do
106
+ user_id = 1
107
+ ActivityFeed.persistence = :mongoid
108
+
109
+ item = ActivityFeed.create_item(:user_id => user_id, :text => 'This is text for my activity feed')
110
+ loaded_item = ActivityFeed.load_item(item.id)
111
+ loaded_item.should == item
112
+ end
113
+
93
114
  it 'should allow you to load an item using :active_record' do
94
115
  user_id = 1
95
116
  ActivityFeed.persistence = :active_record
@@ -235,6 +256,24 @@ describe ActivityFeed do
235
256
  Timecop.return
236
257
  end
237
258
 
259
+ it "should allow you to update an item from the personal activity feed using :mongoid" do
260
+ ActivityFeed.persistence = :mongoid
261
+
262
+ item_1 = ActivityFeed.create_item(item_attrs, false)
263
+ Timecop.travel(DateTime.now + 10)
264
+ item_2 = ActivityFeed.create_item(item_attrs, false)
265
+ Timecop.travel(DateTime.now + 10)
266
+ item_3 = ActivityFeed.create_item(item_attrs, false)
267
+ Timecop.travel(DateTime.now + 10)
268
+
269
+ feed = ActivityFeed::Feed.new(user_id)
270
+ feed.page(1).first.id.should == item_3.id
271
+
272
+ ActivityFeed.update_item(user_id, item_1.id, DateTime.now.to_i)
273
+ feed.page(1).first.id.should == item_1.id
274
+ Timecop.return
275
+ end
276
+
238
277
  it "should allow you to update an item from the personal aggregate feed" do
239
278
  ActivityFeed.persistence = :ohm
240
279
 
data/spec/feed_spec.rb CHANGED
@@ -34,6 +34,18 @@ describe ActivityFeed::Feed do
34
34
  feed.page(1).size.should be(5)
35
35
  end
36
36
 
37
+ it 'should pull up the correct list of ActivityFeed::Mongoid::Item when calling #page using :mongoid' do
38
+ ActivityFeed.persistence = :mongoid
39
+ ActivityFeed::Mongoid::Item.count.should be(0)
40
+ 1.upto(5) do |index|
41
+ item = ActivityFeed.create_item(:user_id => 1, :nickname => 'nickname_1', :text => "text_#{index}")
42
+ end
43
+ ActivityFeed::Mongoid::Item.count.should be(5)
44
+
45
+ feed = ActivityFeed::Feed.new(1)
46
+ feed.page(1).size.should be(5)
47
+ end
48
+
37
49
  it 'should pull up the correct list of ActivityFeed::Ohm::Item when calling #page using :ohm' do
38
50
  ActivityFeed.persistence = :ohm
39
51
  ActivityFeed::Ohm::Item.all.count.should be(0)
data/spec/spec_helper.rb CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'rspec'
3
3
  require 'redis'
4
4
  require 'mongo_mapper'
5
+ require 'mongoid'
5
6
  require 'database_cleaner'
6
7
  require 'fabrication'
7
8
  require 'json'
@@ -10,7 +11,12 @@ $redis = Redis.new(:host => '127.0.0.1', :port => 6379)
10
11
 
11
12
  # TODO: Move to spec/mongo_mapper
12
13
  MongoMapper.connection = Mongo::Connection.new('localhost', 27017)
13
- MongoMapper.database = 'activity_feed_gem_test'
14
+ MongoMapper.database = 'activity_feed_gem_test_mongo_mapper'
15
+
16
+ Mongoid.configure do |config|
17
+ config.master = Mongo::Connection.new.db("activity_feed_gem_test_mongoid")
18
+ # config.mongoid.logger = false
19
+ end
14
20
 
15
21
  # TODO: Move to spec/active_record
16
22
  require 'active_record'
@@ -41,6 +47,7 @@ end
41
47
 
42
48
  DatabaseCleaner[:active_record].strategy = :transaction
43
49
  DatabaseCleaner[:mongo_mapper].strategy = :truncation
50
+ DatabaseCleaner[:mongoid].strategy = :truncation
44
51
 
45
52
  require 'activity_feed'
46
53
 
@@ -49,6 +56,7 @@ ActivityFeed.redis = $redis
49
56
  require 'activity_feed/active_record/item'
50
57
  require 'activity_feed/memory/item'
51
58
  require 'activity_feed/mongo_mapper/item'
59
+ require 'activity_feed/mongoid/item'
52
60
  require 'activity_feed/ohm/item'
53
61
  require 'activity_feed/custom/item'
54
62
 
data/spec/version_spec.rb CHANGED
@@ -2,6 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe ActivityFeed do
4
4
  it "should be the correct version" do
5
- ActivityFeed::VERSION.should == '1.3.0'
5
+ ActivityFeed::VERSION.should == '1.4.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activity_feed
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-12 00:00:00.000000000 Z
12
+ date: 2012-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &2152337140 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2152337140
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rspec
27
- requirement: &2152334740 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *2152334740
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: database_cleaner
38
- requirement: &2152332900 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *2152332900
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: fabrication
49
- requirement: &2152331820 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,31 @@ dependencies:
54
69
  version: '0'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *2152331820
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: mongoid
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
58
94
  - !ruby/object:Gem::Dependency
59
95
  name: mongo_mapper
60
- requirement: &2152352640 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
61
97
  none: false
62
98
  requirements:
63
99
  - - ! '>='
@@ -65,10 +101,15 @@ dependencies:
65
101
  version: '0'
66
102
  type: :development
67
103
  prerelease: false
68
- version_requirements: *2152352640
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
69
110
  - !ruby/object:Gem::Dependency
70
111
  name: mongo_ext
71
- requirement: &2152350760 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
72
113
  none: false
73
114
  requirements:
74
115
  - - ! '>='
@@ -76,10 +117,15 @@ dependencies:
76
117
  version: '0'
77
118
  type: :development
78
119
  prerelease: false
79
- version_requirements: *2152350760
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
80
126
  - !ruby/object:Gem::Dependency
81
127
  name: bson_ext
82
- requirement: &2152349740 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
83
129
  none: false
84
130
  requirements:
85
131
  - - ! '>='
@@ -87,10 +133,15 @@ dependencies:
87
133
  version: '0'
88
134
  type: :development
89
135
  prerelease: false
90
- version_requirements: *2152349740
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
91
142
  - !ruby/object:Gem::Dependency
92
143
  name: activerecord
93
- requirement: &2152348380 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
94
145
  none: false
95
146
  requirements:
96
147
  - - ! '>='
@@ -98,10 +149,15 @@ dependencies:
98
149
  version: '0'
99
150
  type: :development
100
151
  prerelease: false
101
- version_requirements: *2152348380
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
102
158
  - !ruby/object:Gem::Dependency
103
159
  name: sqlite3
104
- requirement: &2152346760 !ruby/object:Gem::Requirement
160
+ requirement: !ruby/object:Gem::Requirement
105
161
  none: false
106
162
  requirements:
107
163
  - - ! '>='
@@ -109,10 +165,15 @@ dependencies:
109
165
  version: '0'
110
166
  type: :development
111
167
  prerelease: false
112
- version_requirements: *2152346760
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
113
174
  - !ruby/object:Gem::Dependency
114
175
  name: ohm
115
- requirement: &2152367940 !ruby/object:Gem::Requirement
176
+ requirement: !ruby/object:Gem::Requirement
116
177
  none: false
117
178
  requirements:
118
179
  - - ! '>='
@@ -120,10 +181,15 @@ dependencies:
120
181
  version: '0'
121
182
  type: :development
122
183
  prerelease: false
123
- version_requirements: *2152367940
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
124
190
  - !ruby/object:Gem::Dependency
125
191
  name: ohm-contrib
126
- requirement: &2152367000 !ruby/object:Gem::Requirement
192
+ requirement: !ruby/object:Gem::Requirement
127
193
  none: false
128
194
  requirements:
129
195
  - - ! '>='
@@ -131,10 +197,15 @@ dependencies:
131
197
  version: '0'
132
198
  type: :development
133
199
  prerelease: false
134
- version_requirements: *2152367000
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ! '>='
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
135
206
  - !ruby/object:Gem::Dependency
136
207
  name: timecop
137
- requirement: &2152365760 !ruby/object:Gem::Requirement
208
+ requirement: !ruby/object:Gem::Requirement
138
209
  none: false
139
210
  requirements:
140
211
  - - ! '>='
@@ -142,10 +213,15 @@ dependencies:
142
213
  version: '0'
143
214
  type: :development
144
215
  prerelease: false
145
- version_requirements: *2152365760
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
146
222
  - !ruby/object:Gem::Dependency
147
223
  name: activesupport
148
- requirement: &2152364200 !ruby/object:Gem::Requirement
224
+ requirement: !ruby/object:Gem::Requirement
149
225
  none: false
150
226
  requirements:
151
227
  - - ! '>='
@@ -153,10 +229,15 @@ dependencies:
153
229
  version: '0'
154
230
  type: :runtime
155
231
  prerelease: false
156
- version_requirements: *2152364200
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
234
+ requirements:
235
+ - - ! '>='
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
157
238
  - !ruby/object:Gem::Dependency
158
239
  name: i18n
159
- requirement: &2152363160 !ruby/object:Gem::Requirement
240
+ requirement: !ruby/object:Gem::Requirement
160
241
  none: false
161
242
  requirements:
162
243
  - - ! '>='
@@ -164,10 +245,15 @@ dependencies:
164
245
  version: '0'
165
246
  type: :runtime
166
247
  prerelease: false
167
- version_requirements: *2152363160
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
250
+ requirements:
251
+ - - ! '>='
252
+ - !ruby/object:Gem::Version
253
+ version: '0'
168
254
  - !ruby/object:Gem::Dependency
169
255
  name: json
170
- requirement: &2152361640 !ruby/object:Gem::Requirement
256
+ requirement: !ruby/object:Gem::Requirement
171
257
  none: false
172
258
  requirements:
173
259
  - - ! '>='
@@ -175,10 +261,15 @@ dependencies:
175
261
  version: '0'
176
262
  type: :runtime
177
263
  prerelease: false
178
- version_requirements: *2152361640
264
+ version_requirements: !ruby/object:Gem::Requirement
265
+ none: false
266
+ requirements:
267
+ - - ! '>='
268
+ - !ruby/object:Gem::Version
269
+ version: '0'
179
270
  - !ruby/object:Gem::Dependency
180
271
  name: redis
181
- requirement: &2152384420 !ruby/object:Gem::Requirement
272
+ requirement: !ruby/object:Gem::Requirement
182
273
  none: false
183
274
  requirements:
184
275
  - - ! '>='
@@ -186,10 +277,15 @@ dependencies:
186
277
  version: '0'
187
278
  type: :runtime
188
279
  prerelease: false
189
- version_requirements: *2152384420
280
+ version_requirements: !ruby/object:Gem::Requirement
281
+ none: false
282
+ requirements:
283
+ - - ! '>='
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
190
286
  - !ruby/object:Gem::Dependency
191
287
  name: leaderboard
192
- requirement: &2152382940 !ruby/object:Gem::Requirement
288
+ requirement: !ruby/object:Gem::Requirement
193
289
  none: false
194
290
  requirements:
195
291
  - - ! '>='
@@ -197,7 +293,12 @@ dependencies:
197
293
  version: '0'
198
294
  type: :runtime
199
295
  prerelease: false
200
- version_requirements: *2152382940
296
+ version_requirements: !ruby/object:Gem::Requirement
297
+ none: false
298
+ requirements:
299
+ - - ! '>='
300
+ - !ruby/object:Gem::Version
301
+ version: '0'
201
302
  description: Activity feeds backed by Redis
202
303
  email:
203
304
  - dczarnecki@agoragames.com
@@ -219,6 +320,7 @@ files:
219
320
  - lib/activity_feed/feed.rb
220
321
  - lib/activity_feed/memory/item.rb
221
322
  - lib/activity_feed/mongo_mapper/item.rb
323
+ - lib/activity_feed/mongoid/item.rb
222
324
  - lib/activity_feed/ohm/item.rb
223
325
  - lib/activity_feed/version.rb
224
326
  - spec/activity_feed/custom/item.rb
@@ -242,7 +344,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
242
344
  version: '0'
243
345
  segments:
244
346
  - 0
245
- hash: 4587144125303236754
347
+ hash: -660248918297139575
246
348
  required_rubygems_version: !ruby/object:Gem::Requirement
247
349
  none: false
248
350
  requirements:
@@ -251,10 +353,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
353
  version: '0'
252
354
  segments:
253
355
  - 0
254
- hash: 4587144125303236754
356
+ hash: -660248918297139575
255
357
  requirements: []
256
358
  rubyforge_project: activity_feed
257
- rubygems_version: 1.8.10
359
+ rubygems_version: 1.8.23
258
360
  signing_key:
259
361
  specification_version: 3
260
362
  summary: Activity feeds backed by Redis