acts_as_follower 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -0
- data/Gemfile +4 -0
- data/MIT-LICENSE +44 -0
- data/README.rdoc +208 -0
- data/Rakefile +39 -0
- data/acts_as_follower.gemspec +25 -0
- data/init.rb +1 -0
- data/lib/acts_as_follower.rb +11 -0
- data/lib/acts_as_follower/followable.rb +102 -0
- data/lib/acts_as_follower/follower.rb +100 -0
- data/lib/acts_as_follower/follower_lib.rb +15 -0
- data/lib/acts_as_follower/railtie.rb +15 -0
- data/lib/acts_as_follower/version.rb +3 -0
- data/lib/generators/USAGE +5 -0
- data/lib/generators/acts_as_follower_generator.rb +30 -0
- data/lib/generators/templates/migration.rb +17 -0
- data/lib/generators/templates/model.rb +21 -0
- data/test/README +24 -0
- data/test/acts_as_followable_test.rb +241 -0
- data/test/acts_as_follower_test.rb +209 -0
- data/test/dummy30/Gemfile +1 -0
- data/test/dummy30/Rakefile +7 -0
- data/test/dummy30/app/models/band.rb +4 -0
- data/test/dummy30/app/models/user.rb +5 -0
- data/test/dummy30/config.ru +4 -0
- data/test/dummy30/config/application.rb +42 -0
- data/test/dummy30/config/boot.rb +10 -0
- data/test/dummy30/config/database.yml +7 -0
- data/test/dummy30/config/environment.rb +5 -0
- data/test/dummy30/config/environments/development.rb +19 -0
- data/test/dummy30/config/environments/test.rb +23 -0
- data/test/dummy30/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy30/config/initializers/inflections.rb +10 -0
- data/test/dummy30/config/initializers/secret_token.rb +7 -0
- data/test/dummy30/config/initializers/session_store.rb +8 -0
- data/test/dummy30/config/locales/en.yml +5 -0
- data/test/dummy30/config/routes.rb +2 -0
- data/test/factories/bands.rb +7 -0
- data/test/factories/users.rb +11 -0
- data/test/follow_test.rb +10 -0
- data/test/schema.rb +21 -0
- data/test/test_helper.rb +17 -0
- metadata +190 -0
data/test/schema.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
ActiveRecord::Schema.define :version => 0 do
|
2
|
+
|
3
|
+
create_table :follows, :force => true do |t|
|
4
|
+
t.integer "followable_id", :null => false
|
5
|
+
t.string "followable_type", :null => false
|
6
|
+
t.integer "follower_id", :null => false
|
7
|
+
t.string "follower_type", :null => false
|
8
|
+
t.boolean "blocked", :default => false, :null => false
|
9
|
+
t.datetime "created_at"
|
10
|
+
t.datetime "updated_at"
|
11
|
+
end
|
12
|
+
|
13
|
+
create_table :users, :force => true do |t|
|
14
|
+
t.column :name, :string
|
15
|
+
end
|
16
|
+
|
17
|
+
create_table :bands, :force => true do |t|
|
18
|
+
t.column :name, :string
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Configure Rails Envinronment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy30/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + '/debug.log')
|
8
|
+
ActiveRecord::Migration.verbose = false
|
9
|
+
|
10
|
+
load(File.dirname(__FILE__) + '/schema.rb')
|
11
|
+
|
12
|
+
require File.dirname(__FILE__) + '/../lib/generators/templates/model.rb'
|
13
|
+
|
14
|
+
require 'shoulda'
|
15
|
+
require 'factory_girl'
|
16
|
+
FactoryGirl.find_definitions
|
17
|
+
|
metadata
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: acts_as_follower
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Tom Cocca
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-09-21 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: sqlite3
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
requirement: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: shoulda
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :development
|
48
|
+
requirement: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: factory_girl
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :development
|
62
|
+
requirement: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rails
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ~>
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 19
|
72
|
+
segments:
|
73
|
+
- 3
|
74
|
+
- 0
|
75
|
+
- 10
|
76
|
+
version: 3.0.10
|
77
|
+
type: :development
|
78
|
+
requirement: *id004
|
79
|
+
description: "acts_as_follower is a Rubygem to allow any model to follow any other model. This is accomplished through a double polymorphic relationship on the Follow model. There is also built in support for blocking/un-blocking follow records. Main uses would be for Users to follow other Users or for Users to follow Books, etc\xE2\x80\xA6 (Basically, to develop the type of follow system that GitHub has)"
|
80
|
+
email:
|
81
|
+
- tom dot cocca at gmail dot com
|
82
|
+
executables: []
|
83
|
+
|
84
|
+
extensions: []
|
85
|
+
|
86
|
+
extra_rdoc_files: []
|
87
|
+
|
88
|
+
files:
|
89
|
+
- .gitignore
|
90
|
+
- Gemfile
|
91
|
+
- MIT-LICENSE
|
92
|
+
- README.rdoc
|
93
|
+
- Rakefile
|
94
|
+
- acts_as_follower.gemspec
|
95
|
+
- init.rb
|
96
|
+
- lib/acts_as_follower.rb
|
97
|
+
- lib/acts_as_follower/followable.rb
|
98
|
+
- lib/acts_as_follower/follower.rb
|
99
|
+
- lib/acts_as_follower/follower_lib.rb
|
100
|
+
- lib/acts_as_follower/railtie.rb
|
101
|
+
- lib/acts_as_follower/version.rb
|
102
|
+
- lib/generators/USAGE
|
103
|
+
- lib/generators/acts_as_follower_generator.rb
|
104
|
+
- lib/generators/templates/migration.rb
|
105
|
+
- lib/generators/templates/model.rb
|
106
|
+
- test/README
|
107
|
+
- test/acts_as_followable_test.rb
|
108
|
+
- test/acts_as_follower_test.rb
|
109
|
+
- test/dummy30/Gemfile
|
110
|
+
- test/dummy30/Rakefile
|
111
|
+
- test/dummy30/app/models/band.rb
|
112
|
+
- test/dummy30/app/models/user.rb
|
113
|
+
- test/dummy30/config.ru
|
114
|
+
- test/dummy30/config/application.rb
|
115
|
+
- test/dummy30/config/boot.rb
|
116
|
+
- test/dummy30/config/database.yml
|
117
|
+
- test/dummy30/config/environment.rb
|
118
|
+
- test/dummy30/config/environments/development.rb
|
119
|
+
- test/dummy30/config/environments/test.rb
|
120
|
+
- test/dummy30/config/initializers/backtrace_silencers.rb
|
121
|
+
- test/dummy30/config/initializers/inflections.rb
|
122
|
+
- test/dummy30/config/initializers/secret_token.rb
|
123
|
+
- test/dummy30/config/initializers/session_store.rb
|
124
|
+
- test/dummy30/config/locales/en.yml
|
125
|
+
- test/dummy30/config/routes.rb
|
126
|
+
- test/factories/bands.rb
|
127
|
+
- test/factories/users.rb
|
128
|
+
- test/follow_test.rb
|
129
|
+
- test/schema.rb
|
130
|
+
- test/test_helper.rb
|
131
|
+
has_rdoc: true
|
132
|
+
homepage: https://github.com/tcocca/acts_as_follower
|
133
|
+
licenses: []
|
134
|
+
|
135
|
+
post_install_message:
|
136
|
+
rdoc_options: []
|
137
|
+
|
138
|
+
require_paths:
|
139
|
+
- lib
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
none: false
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
hash: 3
|
146
|
+
segments:
|
147
|
+
- 0
|
148
|
+
version: "0"
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
hash: 3
|
155
|
+
segments:
|
156
|
+
- 0
|
157
|
+
version: "0"
|
158
|
+
requirements: []
|
159
|
+
|
160
|
+
rubyforge_project: acts_as_follower
|
161
|
+
rubygems_version: 1.6.2
|
162
|
+
signing_key:
|
163
|
+
specification_version: 3
|
164
|
+
summary: A Rubygem to add Follow functionality for ActiveRecord models
|
165
|
+
test_files:
|
166
|
+
- test/README
|
167
|
+
- test/acts_as_followable_test.rb
|
168
|
+
- test/acts_as_follower_test.rb
|
169
|
+
- test/dummy30/Gemfile
|
170
|
+
- test/dummy30/Rakefile
|
171
|
+
- test/dummy30/app/models/band.rb
|
172
|
+
- test/dummy30/app/models/user.rb
|
173
|
+
- test/dummy30/config.ru
|
174
|
+
- test/dummy30/config/application.rb
|
175
|
+
- test/dummy30/config/boot.rb
|
176
|
+
- test/dummy30/config/database.yml
|
177
|
+
- test/dummy30/config/environment.rb
|
178
|
+
- test/dummy30/config/environments/development.rb
|
179
|
+
- test/dummy30/config/environments/test.rb
|
180
|
+
- test/dummy30/config/initializers/backtrace_silencers.rb
|
181
|
+
- test/dummy30/config/initializers/inflections.rb
|
182
|
+
- test/dummy30/config/initializers/secret_token.rb
|
183
|
+
- test/dummy30/config/initializers/session_store.rb
|
184
|
+
- test/dummy30/config/locales/en.yml
|
185
|
+
- test/dummy30/config/routes.rb
|
186
|
+
- test/factories/bands.rb
|
187
|
+
- test/factories/users.rb
|
188
|
+
- test/follow_test.rb
|
189
|
+
- test/schema.rb
|
190
|
+
- test/test_helper.rb
|