social_connections 0.0.1

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/test/schema.rb ADDED
@@ -0,0 +1,25 @@
1
+ ActiveRecord::Schema.define(:version => 0) do
2
+ create_table :social_connections, :force => true do |t|
3
+ t.integer :source_id
4
+ t.string :source_type
5
+ t.integer :target_id
6
+ t.string :target_type
7
+ end
8
+ create_table :social_activities, :force => true do |t|
9
+ t.integer :owner_id
10
+ t.string :owner_type
11
+ t.integer :subject_id
12
+ t.string :subject_type
13
+ t.integer :target_id
14
+ t.string :target_type
15
+ t.string :verb
16
+ t.text :options_as_json
17
+ t.boolean :unseen, :default => true
18
+ end
19
+
20
+ # the 'connectables' table is for the tests
21
+ create_table :connectables, :force => true do |t|
22
+ t.string :name
23
+ t.string :email
24
+ end
25
+ end
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+
3
+ class SocialConnectionTest < ActiveSupport::TestCase
4
+ load_schema
5
+
6
+ test "SocialConnection can be instantiated" do
7
+ assert_kind_of SocialConnection, SocialConnection.new
8
+ end
9
+ end
10
+
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class SocialConnectionsTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ test "the truth" do
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,47 @@
1
+
2
+ ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '/../../../..'
3
+
4
+ require 'rubygems'
5
+ require 'test/unit'
6
+ require 'active_support'
7
+ require 'active_support/core_ext'
8
+ require 'active_record'
9
+ require 'action_mailer'
10
+
11
+ require File.dirname(__FILE__) + '/../init'
12
+
13
+ class Connectable < ActiveRecord::Base
14
+ acts_as_connectable :verbs => [ :likes, :recommends, :comments ]
15
+ def to_s
16
+ "Connectable '#{self.name}'"
17
+ end
18
+ end
19
+
20
+ def load_schema
21
+ config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
22
+ ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
23
+
24
+ db_adapter = ENV['DB']
25
+
26
+ # no db passed, try one of these fine config-free DBs before bombing.
27
+ db_adapter ||=
28
+ begin
29
+ require 'rubygems'
30
+ require 'sqlite'
31
+ 'sqlite'
32
+ rescue MissingSourceFile
33
+ begin
34
+ require 'sqlite3'
35
+ 'sqlite3'
36
+ rescue MissingSourceFile
37
+ end
38
+ end
39
+
40
+ if db_adapter.nil?
41
+ raise "No DB Adapter selected. Pass the DB= option to pick one, or install Sqlite or Sqlite3."
42
+ end
43
+
44
+ ActiveRecord::Base.establish_connection(config[db_adapter])
45
+ load(File.dirname(__FILE__) + "/schema.rb")
46
+ end
47
+
data/uninstall.rb ADDED
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: social_connections
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Chris
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-06-24 00:00:00 +02:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: The idea is to provide pluggable social connections, activities and a method to digest those activities (e.g. in daily emails).
18
+ email:
19
+ - christian.oloff+gem@gmail.com
20
+ executables: []
21
+
22
+ extensions: []
23
+
24
+ extra_rdoc_files: []
25
+
26
+ files:
27
+ - .gitignore
28
+ - Gemfile
29
+ - MIT-LICENSE
30
+ - README
31
+ - Rakefile
32
+ - db/keep-this-dir.txt
33
+ - db/social_connections_plugin.sqlite3
34
+ - init.rb
35
+ - install.rb
36
+ - lib/app/mailers/digest_mailer.rb
37
+ - lib/app/models/social_activity.rb
38
+ - lib/app/models/social_connection.rb
39
+ - lib/app/views/digest_mailer/digest.html.erb
40
+ - lib/db/migrate/20110516181115_create_social_connections.rb
41
+ - lib/social_connections.rb
42
+ - lib/social_connections/acts_as_connectable.rb
43
+ - lib/social_connections/social_aggregator.rb
44
+ - lib/social_connections/version.rb
45
+ - lib/tasks/social_connections.rake
46
+ - social_connections.gemspec
47
+ - spec/activities_aggregator_spec.rb
48
+ - spec/social_activities_spec.rb
49
+ - test/activities_test.rb
50
+ - test/acts_as_connectable_test.rb
51
+ - test/database.yml
52
+ - test/debug.log
53
+ - test/schema.rb
54
+ - test/social_connection_test.rb
55
+ - test/social_connections_test.rb
56
+ - test/test_helper.rb
57
+ - uninstall.rb
58
+ has_rdoc: true
59
+ homepage: https://sites.google.com/site/socialconnections7/
60
+ licenses: []
61
+
62
+ post_install_message:
63
+ rdoc_options: []
64
+
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ requirements: []
80
+
81
+ rubyforge_project: social_connections
82
+ rubygems_version: 1.6.1
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Social connections for ActiveRecord.
86
+ test_files:
87
+ - spec/activities_aggregator_spec.rb
88
+ - spec/social_activities_spec.rb
89
+ - test/activities_test.rb
90
+ - test/acts_as_connectable_test.rb
91
+ - test/database.yml
92
+ - test/debug.log
93
+ - test/schema.rb
94
+ - test/social_connection_test.rb
95
+ - test/social_connections_test.rb
96
+ - test/test_helper.rb