redis-friendships 0.1 → 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/features/redis_friendships_named.feature +3 -3
- data/features/redis_friendships_standard.feature +4 -4
- data/features/redis_friendships_user_injection.feature +2 -2
- data/lib/generators/redis_friendships/USAGE +1 -1
- data/lib/generators/redis_friendships/templates/friendship.rb +1 -1
- data/lib/generators/redis_friendships/templates/user.rb +2 -2
- data/lib/generators/redis_friendships/templates/user_injection_code.rb +2 -2
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -41,7 +41,7 @@ It will also make that user a following to the other_user_
|
|
41
41
|
other_user.followings.include? user
|
42
42
|
|
43
43
|
To unfollow someone (or have someone unfollowed, just edit it to your hearts desire)
|
44
|
-
user.
|
44
|
+
user.unfollow!(other_user)
|
45
45
|
This will remove it from user's SET. There are no limits to what you can do.
|
46
46
|
Will also remove the user as a following from other_user
|
47
47
|
other_user.followings.include?(user) == false
|
@@ -15,7 +15,7 @@ Feature: Redis Friendships Generator With Named Models
|
|
15
15
|
And I should see "Red.sadd("fellowship:#{username}:followings", followed_username)" in file "app/models/fellowship.rb"
|
16
16
|
And I should see "Red.sadd("fellowship:#{followed_username}:followings", username)" in file "app/models/fellowship.rb"
|
17
17
|
|
18
|
-
And I should see "def self.
|
18
|
+
And I should see "def self.unfollow!(username, followed_username)" in file "app/models/fellowship.rb"
|
19
19
|
And I should see "Red.srem("fellowship:#{username}:followings", followed_username)" in file "app/models/fellowship.rb"
|
20
20
|
And I should see "Red.srem("fellowship:#{followed_username}:followings", username)" in file "app/models/fellowship.rb"
|
21
21
|
|
@@ -46,8 +46,8 @@ Feature: Redis Friendships Generator With Named Models
|
|
46
46
|
And I should see "Fellowship.follow!(self.username, user.username)" in file "app/models/hobbit.rb"
|
47
47
|
And I should see "true" in file "app/models/hobbit.rb"
|
48
48
|
|
49
|
-
And I should see "def
|
50
|
-
And I should see "Fellowship.
|
49
|
+
And I should see "def unfollow!(user)" in file "app/models/hobbit.rb"
|
50
|
+
And I should see "Fellowship.unfollow!(self.username, user.username)" in file "app/models/hobbit.rb"
|
51
51
|
|
52
52
|
And I should see "def followers" in file "app/models/hobbit.rb"
|
53
53
|
And I should see "followers = Fellowship.followers_for(self.username)" in file "app/models/hobbit.rb"
|
@@ -14,7 +14,7 @@ Feature: Redis Friendship Generator
|
|
14
14
|
And I should see "R.sadd("friendship:#{username}:followings", followed_username)" in file "app/models/friendship.rb"
|
15
15
|
And I should see "R.sadd("friendship:#{followed_username}:followings", username)" in file "app/models/friendship.rb"
|
16
16
|
|
17
|
-
And I should see "def self.
|
17
|
+
And I should see "def self.unfollow!(username, followed_username)" in file "app/models/friendship.rb"
|
18
18
|
And I should see "R.srem("friendship:#{username}:followings", followed_username)" in file "app/models/friendship.rb"
|
19
19
|
And I should see "R.srem("friendship:#{followed_username}:followings", username)" in file "app/models/friendship.rb"
|
20
20
|
|
@@ -22,7 +22,7 @@ Feature: Redis Friendship Generator
|
|
22
22
|
And I should see "R.sismember("friendship:#{username}:followings", followed_username)" in file "app/models/friendship.rb"
|
23
23
|
|
24
24
|
And I should see "def self.followed_by?(user, following_user)" in file "app/models/friendship.rb"
|
25
|
-
And I should see "
|
25
|
+
And I should see "R.sismember("friendship:#{username}:followers", following_username)" in file "app/models/friendship.rb"
|
26
26
|
|
27
27
|
And I should see "def self.followings_for(username)" in file "app/models/friendship.rb"
|
28
28
|
And I should see "R.smembers("friendship:#{username}:followings")" in file "app/models/friendship.rb"
|
@@ -45,8 +45,8 @@ Feature: Redis Friendship Generator
|
|
45
45
|
And I should see "Friendship.follow!(self.username, user.username)" in file "app/models/user.rb"
|
46
46
|
And I should see "true" in file "app/models/user.rb"
|
47
47
|
|
48
|
-
And I should see "def
|
49
|
-
And I should see "Friendship.
|
48
|
+
And I should see "def unfollow!(user)" in file "app/models/user.rb"
|
49
|
+
And I should see "Friendship.unfollow!(self.username, user.username)" in file "app/models/user.rb"
|
50
50
|
|
51
51
|
And I should see "def followers" in file "app/models/user.rb"
|
52
52
|
And I should see "followers = Friendship.followers_for(self.username)" in file "app/models/user.rb"
|
@@ -23,8 +23,8 @@ Feature: Redis Messages Generator With Existing User Model
|
|
23
23
|
And I should see "Fellowship.follow!(self.username, user.username)" in file "app/models/hobbit.rb"
|
24
24
|
And I should see "true" in file "app/models/hobbit.rb"
|
25
25
|
|
26
|
-
And I should see "def
|
27
|
-
And I should see "Fellowship.
|
26
|
+
And I should see "def unfollow!(user)" in file "app/models/hobbit.rb"
|
27
|
+
And I should see "Fellowship.unfollow!(self.username, user.username)" in file "app/models/hobbit.rb"
|
28
28
|
|
29
29
|
And I should see "def followers" in file "app/models/hobbit.rb"
|
30
30
|
And I should see "followers = Fellowship.followers_for(self.username)" in file "app/models/hobbit.rb"
|
@@ -43,7 +43,7 @@ It will also make that user a following to the other_user_
|
|
43
43
|
other_user.followings.include? user
|
44
44
|
|
45
45
|
To unfollow someone (or have someone unfollowed, just edit it to your hearts desire)
|
46
|
-
user.
|
46
|
+
user.unfollow!(other_user)
|
47
47
|
This will remove it from user's SET. There are no limits to what you can do.
|
48
48
|
Will also remove the user as a following from other_user
|
49
49
|
other_user.followings.include?(user) == false
|
@@ -5,7 +5,7 @@ class <%= friendship_class_name %>
|
|
5
5
|
<%=redis_constant_name%>.sadd("<%=friendship_singular_name%>:#{followed_username}:followings", username)
|
6
6
|
end
|
7
7
|
|
8
|
-
def self.
|
8
|
+
def self.unfollow!(username, followed_username)
|
9
9
|
<%=redis_constant_name%>.srem("<%=friendship_singular_name%>:#{username}:followings", followed_username)
|
10
10
|
<%=redis_constant_name%>.srem("<%=friendship_singular_name%>:#{followed_username}:followings", username)
|
11
11
|
end
|
@@ -14,8 +14,8 @@ class <%= user_class_name %> < ActiveRecord::Base
|
|
14
14
|
true
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
|
17
|
+
def unfollow!(user)
|
18
|
+
<%=friendship_class_name%>.unfollow!(self.username, user.username)
|
19
19
|
end
|
20
20
|
|
21
21
|
|