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 +1 -1
- data/CHANGELOG.markdown +4 -0
- data/README.markdown +116 -151
- data/activity_feed.gemspec +1 -0
- data/lib/activity_feed.rb +6 -1
- data/lib/activity_feed/mongoid/item.rb +31 -0
- data/lib/activity_feed/version.rb +1 -1
- data/spec/activity_feed_spec.rb +39 -0
- data/spec/feed_spec.rb +12 -0
- data/spec/spec_helper.rb +9 -1
- data/spec/version_spec.rb +1 -1
- metadata +141 -39
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use ruby-1.9.3
|
1
|
+
rvm use ruby-1.9.3@activity_feed_gem --create
|
data/CHANGELOG.markdown
CHANGED
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
|
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
|
-
|
46
|
-
=>
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
=>
|
51
|
-
|
52
|
-
|
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
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
=>
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
=>
|
108
|
-
|
109
|
-
|
110
|
-
|
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
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
=>
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
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
|
-
|
178
|
-
=>
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
=>
|
183
|
-
|
184
|
-
|
185
|
-
|
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
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
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
|
+
|
data/activity_feed.gemspec
CHANGED
@@ -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
|
data/spec/activity_feed_spec.rb
CHANGED
@@ -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 = '
|
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
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.
|
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-
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
356
|
+
hash: -660248918297139575
|
255
357
|
requirements: []
|
256
358
|
rubyforge_project: activity_feed
|
257
|
-
rubygems_version: 1.8.
|
359
|
+
rubygems_version: 1.8.23
|
258
360
|
signing_key:
|
259
361
|
specification_version: 3
|
260
362
|
summary: Activity feeds backed by Redis
|