acts_as_follower 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/README.rdoc +30 -1
- data/Rakefile +1 -1
- data/acts_as_follower.gemspec +4 -3
- data/lib/acts_as_follower/follow_scopes.rb +2 -1
- data/lib/acts_as_follower/followable.rb +15 -7
- data/lib/acts_as_follower/follower.rb +12 -5
- data/lib/acts_as_follower/follower_lib.rb +18 -0
- data/lib/acts_as_follower/version.rb +1 -1
- data/test/acts_as_followable_test.rb +11 -11
- data/test/acts_as_follower_test.rb +10 -10
- data/test/dummy30/config/environments/test.rb +0 -3
- data/test/factories/bands.rb +7 -5
- data/test/factories/users.rb +10 -8
- data/test/test_helper.rb +2 -1
- metadata +97 -84
data/.travis.yml
ADDED
data/README.rdoc
CHANGED
@@ -6,10 +6,14 @@ Main uses would be for Users to follow other Users or for Users to follow Books,
|
|
6
6
|
|
7
7
|
(Basically, to develop the type of follow system that GitHub has)
|
8
8
|
|
9
|
+
{<img src="https://travis-ci.org/tcocca/acts_as_follower.png" />}[https://travis-ci.org/tcocca/acts_as_follower]
|
10
|
+
|
9
11
|
|
10
12
|
== Installation
|
11
13
|
|
12
|
-
=== The master branch supports
|
14
|
+
=== The master branch supports Rails 4
|
15
|
+
|
16
|
+
The first release that support Rails 4 is 0.2.0
|
13
17
|
|
14
18
|
Add the gem to the gemfile:
|
15
19
|
gem "acts_as_follower"
|
@@ -19,6 +23,23 @@ Run the generator:
|
|
19
23
|
|
20
24
|
This will generate a migration file as well as a model called Follow.
|
21
25
|
|
26
|
+
=== Rails 3.x support
|
27
|
+
|
28
|
+
Rails 3 is supports in the rails_3 branch https://github.com/tcocca/acts_as_follower/tree/rails_3
|
29
|
+
The last gem release for Rails 3 support was 0.1.1, so install the gem using ~> 0.1.1
|
30
|
+
|
31
|
+
Add the gem to the gemfile:
|
32
|
+
gem "acts_as_follower", '~> 0.1.1'
|
33
|
+
|
34
|
+
or install from the branch
|
35
|
+
|
36
|
+
gem "acts_as_follower", :git => 'git://github.com/tcocca/acts_as_follower.git', :branch => 'rails_3'
|
37
|
+
|
38
|
+
Run the generator:
|
39
|
+
rails generate acts_as_follower
|
40
|
+
|
41
|
+
This will generate a migration file as well as a model called Follow.
|
42
|
+
|
22
43
|
=== Rails 2.3.x support
|
23
44
|
|
24
45
|
Rails 2.3.x is supported in the rails_2.3.x branch http://github.com/tcocca/acts_as_follower/tree/rails_2.3.x but must be installed as a plugin.
|
@@ -95,6 +116,10 @@ To get the count of all Follow records by a certain type use the following
|
|
95
116
|
There is also a method_missing to get the count by type
|
96
117
|
user.following_books_count # Calls the user.following_by_type_count('Book') method
|
97
118
|
|
119
|
+
There is now a method that will just return the Arel scope for follows so that you can chain anything else you want onto it:
|
120
|
+
book.follows_scoped
|
121
|
+
This does not return the actual follows, just the scope of followings including the followables, essentially: book.follows.unblocked.includes(:followable)
|
122
|
+
|
98
123
|
The following methods take an optional hash parameter of ActiveRecord options (:limit, :order, etc...)
|
99
124
|
follows_by_type, all_follows, all_following, following_by_type
|
100
125
|
---
|
@@ -104,6 +129,10 @@ The following methods take an optional hash parameter of ActiveRecord options (:
|
|
104
129
|
To get all the followers of a model that acts_as_followable
|
105
130
|
book.followers # Returns an array of all the followers for that book, a collection of different object types (eg. type User or type Book)
|
106
131
|
|
132
|
+
There is also a method that will just return the Arel scope for followers so that you can chain anything else you want onto it:
|
133
|
+
book.followers_scoped
|
134
|
+
This does not return the actual followers, just the scope of followings including the followers, essentially: book.followings.includes(:follower)
|
135
|
+
|
107
136
|
To get just the number of follows use
|
108
137
|
book.followers_count
|
109
138
|
|
data/Rakefile
CHANGED
data/acts_as_follower.gemspec
CHANGED
@@ -19,7 +19,8 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
21
|
s.add_development_dependency "sqlite3"
|
22
|
-
s.add_development_dependency "
|
23
|
-
s.add_development_dependency "
|
24
|
-
s.add_development_dependency "
|
22
|
+
s.add_development_dependency "shoulda_create"
|
23
|
+
s.add_development_dependency "shoulda", "3.5.0"
|
24
|
+
s.add_development_dependency "factory_girl", "4.2.0"
|
25
|
+
s.add_development_dependency "rails", "~> 4.0.0"
|
25
26
|
end
|
@@ -2,7 +2,8 @@ module ActsAsFollower #:nodoc:
|
|
2
2
|
module FollowScopes
|
3
3
|
|
4
4
|
def for_follower(follower)
|
5
|
-
where(:follower_id => follower.id,
|
5
|
+
where(:follower_id => follower.id,
|
6
|
+
:follower_type => parent_class_name(follower))
|
6
7
|
end
|
7
8
|
|
8
9
|
def for_followable(followable)
|
@@ -25,8 +25,8 @@ module ActsAsFollower #:nodoc:
|
|
25
25
|
follows = follower_type.constantize.
|
26
26
|
joins(:follows).
|
27
27
|
where('follows.blocked' => false,
|
28
|
-
'follows.followable_id' => self.id,
|
29
|
-
'follows.followable_type' => parent_class_name(self),
|
28
|
+
'follows.followable_id' => self.id,
|
29
|
+
'follows.followable_type' => parent_class_name(self),
|
30
30
|
'follows.follower_type' => follower_type)
|
31
31
|
if options.has_key?(:limit)
|
32
32
|
follows = follows.limit(options[:limit])
|
@@ -59,19 +59,27 @@ module ActsAsFollower #:nodoc:
|
|
59
59
|
self.followings.blocked.count
|
60
60
|
end
|
61
61
|
|
62
|
-
# Returns the
|
62
|
+
# Returns the followings records scoped
|
63
|
+
def followers_scoped
|
64
|
+
self.followings.includes(:follower)
|
65
|
+
end
|
66
|
+
|
63
67
|
def followers(options={})
|
64
|
-
|
68
|
+
followers_scope = followers_scoped.unblocked
|
69
|
+
followers_scope = apply_options_to_scope(followers_scope, options)
|
70
|
+
followers_scope.to_a.collect{|f| f.follower}
|
65
71
|
end
|
66
72
|
|
67
73
|
def blocks(options={})
|
68
|
-
|
74
|
+
blocked_followers_scope = followers_scoped.blocked
|
75
|
+
blocked_followers_scope = apply_options_to_scope(blocked_followers_scope, options)
|
76
|
+
blocked_followers_scope.to_a.collect{|f| f.follower}
|
69
77
|
end
|
70
78
|
|
71
79
|
# Returns true if the current instance is followed by the passed record
|
72
80
|
# Returns false if the current instance is blocked by the passed record or no follow is found
|
73
81
|
def followed_by?(follower)
|
74
|
-
self.followings.unblocked.for_follower(follower).
|
82
|
+
self.followings.unblocked.for_follower(follower).first.present?
|
75
83
|
end
|
76
84
|
|
77
85
|
def block(follower)
|
@@ -89,7 +97,7 @@ module ActsAsFollower #:nodoc:
|
|
89
97
|
private
|
90
98
|
|
91
99
|
def block_future_follow(follower)
|
92
|
-
|
100
|
+
Follow.create(:followable => self, :follower => follower, :blocked => true)
|
93
101
|
end
|
94
102
|
|
95
103
|
def block_existing_follow(follower)
|
@@ -29,7 +29,7 @@ module ActsAsFollower #:nodoc:
|
|
29
29
|
# Does not allow duplicate records to be created.
|
30
30
|
def follow(followable)
|
31
31
|
if self != followable
|
32
|
-
self.follows.
|
32
|
+
self.follows.find_or_create_by(followable_id: followable.id, followable_type: parent_class_name(followable))
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -40,14 +40,21 @@ module ActsAsFollower #:nodoc:
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
# returns the follows records to the current instance
|
44
|
+
def follows_scoped
|
45
|
+
self.follows.unblocked.includes(:followable)
|
46
|
+
end
|
47
|
+
|
43
48
|
# Returns the follow records related to this instance by type.
|
44
49
|
def follows_by_type(followable_type, options={})
|
45
|
-
|
50
|
+
follows_scope = follows_scoped.for_followable_type(followable_type)
|
51
|
+
follows_scope = apply_options_to_scope(follows_scope, options)
|
46
52
|
end
|
47
53
|
|
48
54
|
# Returns the follow records related to this instance with the followable included.
|
49
55
|
def all_follows(options={})
|
50
|
-
|
56
|
+
follows_scope = follows_scoped
|
57
|
+
follows_scope = apply_options_to_scope(follows_scope, options)
|
51
58
|
end
|
52
59
|
|
53
60
|
# Returns the actual records which this instance is following.
|
@@ -60,8 +67,8 @@ module ActsAsFollower #:nodoc:
|
|
60
67
|
followables = followable_type.constantize.
|
61
68
|
joins(:followings).
|
62
69
|
where('follows.blocked' => false,
|
63
|
-
'follows.follower_id' => self.id,
|
64
|
-
'follows.follower_type' => parent_class_name(self),
|
70
|
+
'follows.follower_id' => self.id,
|
71
|
+
'follows.follower_type' => parent_class_name(self),
|
65
72
|
'follows.followable_type' => followable_type)
|
66
73
|
if options.has_key?(:limit)
|
67
74
|
followables = followables.limit(options[:limit])
|
@@ -11,5 +11,23 @@ module ActsAsFollower
|
|
11
11
|
return obj.class.name
|
12
12
|
end
|
13
13
|
|
14
|
+
def apply_options_to_scope(scope, options = {})
|
15
|
+
if options.has_key?(:limit)
|
16
|
+
scope = scope.limit(options[:limit])
|
17
|
+
end
|
18
|
+
if options.has_key?(:includes)
|
19
|
+
scope = scope.includes(options[:includes])
|
20
|
+
end
|
21
|
+
if options.has_key?(:joins)
|
22
|
+
scope = scope.joins(options[:joins])
|
23
|
+
end
|
24
|
+
if options.has_key?(:where)
|
25
|
+
scope = scope.order(options[:where])
|
26
|
+
end
|
27
|
+
if options.has_key?(:order)
|
28
|
+
scope = scope.order(options[:order])
|
29
|
+
end
|
30
|
+
scope
|
31
|
+
end
|
14
32
|
end
|
15
33
|
end
|
@@ -4,7 +4,7 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
|
|
4
4
|
|
5
5
|
context "instance methods" do
|
6
6
|
setup do
|
7
|
-
@sam =
|
7
|
+
@sam = FactoryGirl.create(:sam)
|
8
8
|
end
|
9
9
|
|
10
10
|
should "be defined" do
|
@@ -16,10 +16,10 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
|
|
16
16
|
|
17
17
|
context "acts_as_followable" do
|
18
18
|
setup do
|
19
|
-
@sam =
|
20
|
-
@jon =
|
21
|
-
@oasis =
|
22
|
-
@metallica =
|
19
|
+
@sam = FactoryGirl.create(:sam)
|
20
|
+
@jon = FactoryGirl.create(:jon)
|
21
|
+
@oasis = FactoryGirl.create(:oasis)
|
22
|
+
@metallica = FactoryGirl.create(:metallica)
|
23
23
|
@sam.follow(@jon)
|
24
24
|
end
|
25
25
|
|
@@ -30,7 +30,7 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
|
|
30
30
|
end
|
31
31
|
|
32
32
|
should "return the proper number of multiple followers" do
|
33
|
-
@bob =
|
33
|
+
@bob = FactoryGirl.create(:bob)
|
34
34
|
@sam.follow(@bob)
|
35
35
|
assert_equal 0, @sam.followers_count
|
36
36
|
assert_equal 1, @jon.followers_count
|
@@ -45,7 +45,7 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
|
|
45
45
|
end
|
46
46
|
|
47
47
|
should "return users (multiple followers)" do
|
48
|
-
@bob =
|
48
|
+
@bob = FactoryGirl.create(:bob)
|
49
49
|
@sam.follow(@bob)
|
50
50
|
assert_equal [], @sam.followers
|
51
51
|
assert_equal [@sam], @jon.followers
|
@@ -53,7 +53,7 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
|
|
53
53
|
end
|
54
54
|
|
55
55
|
should "return users (multiple followers, complex)" do
|
56
|
-
@bob =
|
56
|
+
@bob = FactoryGirl.create(:bob)
|
57
57
|
@sam.follow(@bob)
|
58
58
|
@jon.follow(@bob)
|
59
59
|
assert_equal [], @sam.followers
|
@@ -62,7 +62,7 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
|
|
62
62
|
end
|
63
63
|
|
64
64
|
should "accept AR options" do
|
65
|
-
@bob =
|
65
|
+
@bob = FactoryGirl.create(:bob)
|
66
66
|
@bob.follow(@jon)
|
67
67
|
assert_equal 1, @jon.followers(:limit => 1).count
|
68
68
|
end
|
@@ -86,7 +86,7 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
|
|
86
86
|
|
87
87
|
context "get follow record" do
|
88
88
|
setup do
|
89
|
-
@bob =
|
89
|
+
@bob = FactoryGirl.create(:bob)
|
90
90
|
@follow = @bob.follow(@sam)
|
91
91
|
end
|
92
92
|
|
@@ -101,7 +101,7 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
|
|
101
101
|
|
102
102
|
context "blocks" do
|
103
103
|
setup do
|
104
|
-
@bob =
|
104
|
+
@bob = FactoryGirl.create(:bob)
|
105
105
|
@jon.block(@sam)
|
106
106
|
@jon.block(@bob)
|
107
107
|
end
|
@@ -4,7 +4,7 @@ class ActsAsFollowerTest < ActiveSupport::TestCase
|
|
4
4
|
|
5
5
|
context "instance methods" do
|
6
6
|
setup do
|
7
|
-
@sam =
|
7
|
+
@sam = FactoryGirl.create(:sam)
|
8
8
|
end
|
9
9
|
|
10
10
|
should "be defined" do
|
@@ -19,9 +19,9 @@ class ActsAsFollowerTest < ActiveSupport::TestCase
|
|
19
19
|
|
20
20
|
context "acts_as_follower" do
|
21
21
|
setup do
|
22
|
-
@sam =
|
23
|
-
@jon =
|
24
|
-
@oasis =
|
22
|
+
@sam = FactoryGirl.create(:sam)
|
23
|
+
@jon = FactoryGirl.create(:jon)
|
24
|
+
@oasis = FactoryGirl.create(:oasis)
|
25
25
|
@sam.follow(@jon)
|
26
26
|
@sam.follow(@oasis)
|
27
27
|
end
|
@@ -83,8 +83,8 @@ class ActsAsFollowerTest < ActiveSupport::TestCase
|
|
83
83
|
|
84
84
|
context "follows" do
|
85
85
|
setup do
|
86
|
-
@band_follow = Follow.
|
87
|
-
@user_follow = Follow.
|
86
|
+
@band_follow = Follow.where("follower_id = ? and follower_type = 'User' and followable_id = ? and followable_type = 'Band'", @sam.id, @oasis.id).first
|
87
|
+
@user_follow = Follow.where("follower_id = ? and follower_type = 'User' and followable_id = ? and followable_type = 'User'", @sam.id, @jon.id).first
|
88
88
|
end
|
89
89
|
|
90
90
|
context "follows_by_type" do
|
@@ -94,7 +94,7 @@ class ActsAsFollowerTest < ActiveSupport::TestCase
|
|
94
94
|
end
|
95
95
|
|
96
96
|
should "accept AR options" do
|
97
|
-
@metallica =
|
97
|
+
@metallica = FactoryGirl.create(:metallica)
|
98
98
|
@sam.follow(@metallica)
|
99
99
|
assert_equal 1, @sam.follows_by_type('Band', :limit => 1).count
|
100
100
|
end
|
@@ -102,7 +102,7 @@ class ActsAsFollowerTest < ActiveSupport::TestCase
|
|
102
102
|
|
103
103
|
context "following_by_type_count" do
|
104
104
|
should "return the count of the requested type" do
|
105
|
-
@metallica =
|
105
|
+
@metallica = FactoryGirl.create(:metallica)
|
106
106
|
@sam.follow(@metallica)
|
107
107
|
assert_equal 2, @sam.following_by_type_count('Band')
|
108
108
|
assert_equal 1, @sam.following_by_type_count('User')
|
@@ -146,7 +146,7 @@ class ActsAsFollowerTest < ActiveSupport::TestCase
|
|
146
146
|
end
|
147
147
|
|
148
148
|
should "accept AR options" do
|
149
|
-
@metallica =
|
149
|
+
@metallica = FactoryGirl.create(:metallica)
|
150
150
|
@sam.follow(@metallica)
|
151
151
|
assert_equal 1, @sam.following_by_type('Band', :limit => 1).to_a.size
|
152
152
|
end
|
@@ -159,7 +159,7 @@ class ActsAsFollowerTest < ActiveSupport::TestCase
|
|
159
159
|
end
|
160
160
|
|
161
161
|
should "call following_by_type_count" do
|
162
|
-
@metallica =
|
162
|
+
@metallica = FactoryGirl.create(:metallica)
|
163
163
|
@sam.follow(@metallica)
|
164
164
|
assert_equal 2, @sam.following_bands_count
|
165
165
|
assert_equal 1, @sam.following_users_count
|
@@ -7,9 +7,6 @@ Dummy::Application.configure do
|
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
# Log error messages when you accidentally call methods on nil.
|
11
|
-
config.whiny_nils = true
|
12
|
-
|
13
10
|
# Show full error reports and disable caching
|
14
11
|
config.consider_all_requests_local = true
|
15
12
|
|
data/test/factories/bands.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
2
|
-
b
|
3
|
-
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :oasis, :class => Band do |b|
|
3
|
+
b.name 'Oasis'
|
4
|
+
end
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
factory :metallica, :class => Band do |b|
|
7
|
+
b.name 'Metallica'
|
8
|
+
end
|
7
9
|
end
|
data/test/factories/users.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
|
2
|
-
u
|
3
|
-
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :jon, class: User do |u|
|
3
|
+
u.name 'Jon'
|
4
|
+
end
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
end
|
6
|
+
factory :sam, :class => User do |u|
|
7
|
+
u.name 'Sam'
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
factory :bob, :class => User do |u|
|
11
|
+
u.name 'Bob'
|
12
|
+
end
|
11
13
|
end
|
data/test/test_helper.rb
CHANGED
@@ -12,6 +12,7 @@ load(File.dirname(__FILE__) + '/schema.rb')
|
|
12
12
|
require File.dirname(__FILE__) + '/../lib/generators/templates/model.rb'
|
13
13
|
|
14
14
|
require 'shoulda'
|
15
|
+
require 'shoulda_create'
|
15
16
|
require 'factory_girl'
|
17
|
+
ActiveSupport::TestCase.extend(ShouldaCreate)
|
16
18
|
FactoryGirl.find_definitions
|
17
|
-
|
metadata
CHANGED
@@ -1,92 +1,109 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_follower
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 1
|
10
|
-
version: 0.1.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Tom Cocca
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-09-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: sqlite3
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: shoulda_create
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
33
38
|
type: :development
|
34
|
-
requirement: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: shoulda
|
37
39
|
prerelease: false
|
38
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
41
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: shoulda
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 3.5.0
|
47
54
|
type: :development
|
48
|
-
requirement: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: factory_girl
|
51
55
|
prerelease: false
|
52
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
57
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.5.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: factory_girl
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - '='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 4.2.0
|
61
70
|
type: :development
|
62
|
-
requirement: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: rails
|
65
71
|
prerelease: false
|
66
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - '='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 4.2.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rails
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
67
81
|
none: false
|
68
|
-
requirements:
|
82
|
+
requirements:
|
69
83
|
- - ~>
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
72
|
-
segments:
|
73
|
-
- 3
|
74
|
-
- 0
|
75
|
-
- 10
|
76
|
-
version: 3.0.10
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 4.0.0
|
77
86
|
type: :development
|
78
|
-
|
79
|
-
|
80
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 4.0.0
|
94
|
+
description: acts_as_follower is a Rubygem to allow any model to follow any other
|
95
|
+
model. This is accomplished through a double polymorphic relationship on the Follow
|
96
|
+
model. There is also built in support for blocking/un-blocking follow records. Main
|
97
|
+
uses would be for Users to follow other Users or for Users to follow Books, etc…
|
98
|
+
(Basically, to develop the type of follow system that GitHub has)
|
99
|
+
email:
|
81
100
|
- tom dot cocca at gmail dot com
|
82
101
|
executables: []
|
83
|
-
|
84
102
|
extensions: []
|
85
|
-
|
86
103
|
extra_rdoc_files: []
|
87
|
-
|
88
|
-
files:
|
104
|
+
files:
|
89
105
|
- .gitignore
|
106
|
+
- .travis.yml
|
90
107
|
- Gemfile
|
91
108
|
- MIT-LICENSE
|
92
109
|
- README.rdoc
|
@@ -129,41 +146,37 @@ files:
|
|
129
146
|
- test/follow_test.rb
|
130
147
|
- test/schema.rb
|
131
148
|
- test/test_helper.rb
|
132
|
-
has_rdoc: true
|
133
149
|
homepage: https://github.com/tcocca/acts_as_follower
|
134
150
|
licenses: []
|
135
|
-
|
136
151
|
post_install_message:
|
137
152
|
rdoc_options: []
|
138
|
-
|
139
|
-
require_paths:
|
153
|
+
require_paths:
|
140
154
|
- lib
|
141
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
142
156
|
none: false
|
143
|
-
requirements:
|
144
|
-
- -
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
|
147
|
-
segments:
|
157
|
+
requirements:
|
158
|
+
- - ! '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
segments:
|
148
162
|
- 0
|
149
|
-
|
150
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
hash: 786311995166656148
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
165
|
none: false
|
152
|
-
requirements:
|
153
|
-
- -
|
154
|
-
- !ruby/object:Gem::Version
|
155
|
-
|
156
|
-
segments:
|
166
|
+
requirements:
|
167
|
+
- - ! '>='
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
segments:
|
157
171
|
- 0
|
158
|
-
|
172
|
+
hash: 786311995166656148
|
159
173
|
requirements: []
|
160
|
-
|
161
174
|
rubyforge_project: acts_as_follower
|
162
|
-
rubygems_version: 1.
|
175
|
+
rubygems_version: 1.8.26
|
163
176
|
signing_key:
|
164
177
|
specification_version: 3
|
165
178
|
summary: A Rubygem to add Follow functionality for ActiveRecord models
|
166
|
-
test_files:
|
179
|
+
test_files:
|
167
180
|
- test/README
|
168
181
|
- test/acts_as_followable_test.rb
|
169
182
|
- test/acts_as_follower_test.rb
|