party_boy 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/lib/party_boy.rb CHANGED
@@ -126,6 +126,10 @@ module Party
126
126
  end
127
127
  end
128
128
 
129
+ def network(type = nil)
130
+ [following(type), followers(type)].flatten.uniq
131
+ end
132
+
129
133
  def extended_network(type = nil)
130
134
  following.collect{|f| f.methods.include?('following') && f.following(type) || []}.flatten.uniq
131
135
  end
data/party_boy.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{party_boy}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mike Nelson"]
12
- s.date = %q{2010-01-29}
12
+ s.date = %q{2010-01-30}
13
13
  s.description = %q{Models relationships between AR models. Allows you to follow, friend, and block other AR's. Consists of two mixins: acts_as_followable and acts_as_friend. These options allow an AR to inherit either a twitter-like follower system or a facebook-like friend system.}
14
14
  s.email = %q{mdnelson30@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -111,14 +111,16 @@ describe "party_boy -- follower" do
111
111
  a.follow(c)
112
112
  c.follow(d)
113
113
  e.follow(c)
114
+ e.follow(a)
114
115
 
115
- a.followers.empty?.should be_true
116
+ a.followers.empty?.should be_false
116
117
  a.following.size.should eql(2)
117
118
  a.following.sort{|m,n| m.id <=> n.id}.should eql([b,c])
118
119
 
119
120
  c.followers.size.should eql(3)
120
121
  c.followers.sort{|m,n| m.id <=> n.id}.should eql([a,b,e])
121
-
122
+
123
+ a.network.sort{|m,n| m.id <=> n.id}.should eql([b,c,e])
122
124
  a.extended_network.include?(d).should be_true
123
125
  a.extended_network.include?(e).should be_false
124
126
  end
data/spec/spec_helper.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
 
4
- require 'party_boy'
5
4
  require 'rubygems'
6
5
  require 'spec'
7
6
  require 'spec/autorun'
8
7
  require 'active_record'
8
+ require 'party_boy'
9
9
  require "#{File.dirname(__FILE__)}/../generators/party_boy/templates/model"
10
10
  require 'models/follower_class'
11
11
  require 'models/friend_class'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: party_boy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nelson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-29 00:00:00 -05:00
12
+ date: 2010-01-30 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency