social_connections 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +57 -0
- data/lib/social_connections/acts_as_connectable.rb +4 -0
- data/lib/social_connections/version.rb +1 -1
- metadata +2 -2
- data/README.markdown +0 -19
data/README
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
= SocialConnections
|
2
|
+
|
3
|
+
Enables
|
4
|
+
|
5
|
+
* Social connections between people and things: list of friends, things you like, stuff you recommend.
|
6
|
+
* Activities on those things which are recorded for later processing
|
7
|
+
* Digest mechanism to digest those activities, e.g. for daily digest emails.
|
8
|
+
|
9
|
+
This gem is work in progress and my playground, and currently my playground, don't use it!
|
10
|
+
|
11
|
+
|
12
|
+
== Setup
|
13
|
+
|
14
|
+
Install as a gem
|
15
|
+
|
16
|
+
gem install social_connections
|
17
|
+
|
18
|
+
or reference in your Gemfile
|
19
|
+
|
20
|
+
gem 'social_connections'
|
21
|
+
|
22
|
+
and run
|
23
|
+
|
24
|
+
bundle install
|
25
|
+
|
26
|
+
|
27
|
+
Next, you need to add the migration. This works currently by executing
|
28
|
+
|
29
|
+
rake db:migrate:social_connections
|
30
|
+
|
31
|
+
which adds the required tables.
|
32
|
+
|
33
|
+
Now, every model that is supposed to act as a connectable thing (so that friends can connect
|
34
|
+
other friend or users can like books), add to all those models
|
35
|
+
|
36
|
+
acts_as_connectable :verbs => [ :likes, :recommends, :comments ]
|
37
|
+
|
38
|
+
where the verbs specify what you want to allow those connectables to do to other connectables.
|
39
|
+
See the example below, that may make it clearer.
|
40
|
+
|
41
|
+
== Example
|
42
|
+
|
43
|
+
TODO: Example goes here.
|
44
|
+
|
45
|
+
|
46
|
+
== How to run the Tests (in the gem itself, not in your Rails app)
|
47
|
+
|
48
|
+
Run test in ./test:
|
49
|
+
|
50
|
+
rake
|
51
|
+
|
52
|
+
Run specs in ./spec:
|
53
|
+
|
54
|
+
rspec spec
|
55
|
+
|
56
|
+
|
57
|
+
Copyright (c) 2011 Chris Oloff, released under the MIT license
|
@@ -5,6 +5,10 @@ module SocialConnections
|
|
5
5
|
end
|
6
6
|
|
7
7
|
module ClassMethods
|
8
|
+
# Enables an ActiveRecord model to act as a connectable.
|
9
|
+
# Recognized options:
|
10
|
+
# * :verbs - specify a list of constants recognized as verbs.
|
11
|
+
# If none given, :likes is the only default verb.
|
8
12
|
def acts_as_connectable(options = {})
|
9
13
|
cattr_accessor :acts_as_connectable_options
|
10
14
|
send :acts_as_connectable_options=, options
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: social_connections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Chris
|
@@ -28,7 +28,7 @@ files:
|
|
28
28
|
- .yardopts
|
29
29
|
- Gemfile
|
30
30
|
- MIT-LICENSE
|
31
|
-
- README
|
31
|
+
- README
|
32
32
|
- Rakefile
|
33
33
|
- db/keep-this-dir.txt
|
34
34
|
- init.rb
|
data/README.markdown
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# @markup markdown
|
2
|
-
# @title Social Connections and Activity Feeds for Rails Applications
|
3
|
-
|
4
|
-
# Social Connections #
|
5
|
-
|
6
|
-
Is this proper markdown? Dunno whats going on.
|
7
|
-
|
8
|
-
Can we
|
9
|
-
|
10
|
-
* have
|
11
|
-
* a list here?
|
12
|
-
|
13
|
-
And is the following some example code?
|
14
|
-
|
15
|
-
rake db:migrate:social_connections
|
16
|
-
rails generate blablabla
|
17
|
-
|
18
|
-
Still playing around with this...
|
19
|
-
|