social_stream 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/likes_controller.rb +2 -2
- data/app/controllers/users_controller.rb +4 -1
- data/app/models/activity.rb +26 -14
- data/app/models/tie.rb +7 -2
- data/app/models/tie_activity.rb +4 -0
- data/app/models/user.rb +4 -3
- data/app/views/groups/index.html.erb +1 -1
- data/app/views/layouts/application.html.erb +10 -5
- data/app/views/layouts/frontpage.html.erb +1 -1
- data/app/views/ties/_new.html.erb +1 -1
- data/app/views/users/_profile.html.erb +9 -1
- data/app/views/users/edit.html.erb +22 -15
- data/app/views/users/update.js.erb +20 -0
- data/bin/social_stream +57 -0
- data/lib/generators/social_stream/templates/migration.rb +46 -4
- data/lib/generators/social_stream/templates/public/javascripts/jquery.validate.js +1112 -0
- data/lib/generators/social_stream/templates/public/stylesheets/jquery-ui.css +570 -0
- data/lib/social_stream.rb +3 -2
- data/lib/social_stream/models/activity_object.rb +1 -1
- data/lib/social_stream/rails.rb +4 -4
- data/lib/social_stream/rails/engine.rb +2 -0
- data/lib/social_stream/rails/railtie.rb +2 -0
- data/lib/social_stream/version.rb +1 -1
- data/lib/tasks/db/populate.rake +7 -7
- data/spec/factories/activity.rb +2 -2
- data/spec/models/activity_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -6
- metadata +9 -7
- data/spec/controllers/.groups_controller_spec.rb.swp +0 -0
- data/spec/controllers/.users_controller_spec.rb.swp +0 -0
- data/spec/dummy/db/schema.rb +0 -116
data/lib/social_stream.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# Provides your Rails application with social network and activity stream support
|
2
2
|
module SocialStream
|
3
|
-
autoload :Ability,
|
4
|
-
autoload :
|
3
|
+
autoload :Ability, 'social_stream/ability'
|
4
|
+
autoload :Populate, 'social_stream/populate'
|
5
|
+
autoload :Seed, 'social_stream/seed'
|
5
6
|
|
6
7
|
module Models
|
7
8
|
autoload :Supertype, 'social_stream/models/supertype'
|
data/lib/social_stream/rails.rb
CHANGED
@@ -20,10 +20,10 @@ require 'paperclip/social_stream'
|
|
20
20
|
# Pagination
|
21
21
|
require 'will_paginate'
|
22
22
|
|
23
|
-
|
24
|
-
File.expand_path(__FILE__) =~
|
25
|
-
require('social_stream/rails/
|
26
|
-
require('social_stream/rails/
|
23
|
+
# FIXME: deprecate plugin
|
24
|
+
Gem.path.map{ |p| File.expand_path(__FILE__) =~ /^#{ p }/ }.compact.present? ?
|
25
|
+
require('social_stream/rails/engine') :
|
26
|
+
require('social_stream/rails/railtie')
|
27
27
|
|
28
28
|
module SocialStream
|
29
29
|
module Rails #:nodoc:
|
data/lib/tasks/db/populate.rake
CHANGED
@@ -27,18 +27,18 @@ namespace :db do
|
|
27
27
|
# = Users
|
28
28
|
|
29
29
|
# Create demo user if not present
|
30
|
-
if User.find_by_name('
|
31
|
-
User.create! :name => '
|
32
|
-
:email => '
|
33
|
-
:password => '
|
34
|
-
:password_confirmation => '
|
30
|
+
if User.find_by_name('demonstration').blank?
|
31
|
+
User.create! :name => 'demonstration',
|
32
|
+
:email => 'demonstration@social-stream.dit.upm.es',
|
33
|
+
:password => 'demonstration',
|
34
|
+
:password_confirmation => 'demonstration'
|
35
35
|
end
|
36
36
|
|
37
37
|
9.times do
|
38
38
|
User.create! :name => Forgery::Name.full_name,
|
39
39
|
:email => Forgery::Internet.email_address,
|
40
|
-
:password => '
|
41
|
-
:password_confirmation => '
|
40
|
+
:password => 'demonstration',
|
41
|
+
:password_confirmation => 'demonstration'
|
42
42
|
end
|
43
43
|
|
44
44
|
set_logos(User)
|
data/spec/factories/activity.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Factory.define :activity do |a|
|
2
|
-
a.association :tie
|
2
|
+
a.association :_tie, :factory => :tie
|
3
3
|
a.activity_verb { ActivityVerb["post"] }
|
4
4
|
end
|
5
5
|
|
6
6
|
Factory.define :like_activity, :parent => :activity do |a|
|
7
7
|
a.association :parent, :factory => :activity
|
8
8
|
a.activity_verb { ActivityVerb["like"] }
|
9
|
-
a.
|
9
|
+
a._tie { |tie| tie.association(:tie, :receiver => tie.parent.tie.receiver) }
|
10
10
|
end
|
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
3
3
|
module ActivityTestHelper
|
4
4
|
def create_activity_assigned_to(tie)
|
5
5
|
@tie = tie
|
6
|
-
@activity = Factory(:activity, :
|
6
|
+
@activity = Factory(:activity, :_tie => tie)
|
7
7
|
end
|
8
8
|
|
9
9
|
def create_ability_accessed_by(tie_type)
|
data/spec/spec_helper.rb
CHANGED
@@ -19,15 +19,9 @@ Capybara.default_selector = :css
|
|
19
19
|
# FIXME orm
|
20
20
|
ActiveRecord::Migration.verbose = false
|
21
21
|
|
22
|
-
# Base migration
|
23
|
-
#require 'lib/generators/social_stream/templates/migration'
|
24
|
-
#CreateSocialStream.up
|
25
|
-
|
26
22
|
# Run any available migration
|
27
23
|
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
|
28
24
|
|
29
|
-
#require File.expand_path("../dummy/db/seeds", __FILE__)
|
30
|
-
|
31
25
|
# Load support files
|
32
26
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
33
27
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Antonio Tapiador
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-12-10 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -334,6 +334,7 @@ files:
|
|
334
334
|
- app/models/relation.rb
|
335
335
|
- app/models/relation_permission.rb
|
336
336
|
- app/models/tie.rb
|
337
|
+
- app/models/tie_activity.rb
|
337
338
|
- app/models/user.rb
|
338
339
|
- app/views/activities/_activities.html.erb
|
339
340
|
- app/views/activities/_activity.html.erb
|
@@ -417,6 +418,8 @@ files:
|
|
417
418
|
- app/views/users/edit.html.erb
|
418
419
|
- app/views/users/index.html.erb
|
419
420
|
- app/views/users/show.html.erb
|
421
|
+
- app/views/users/update.js.erb
|
422
|
+
- bin/social_stream
|
420
423
|
- config/locales/en.yml
|
421
424
|
- config/routes.rb
|
422
425
|
- init.rb
|
@@ -550,6 +553,7 @@ files:
|
|
550
553
|
- lib/generators/social_stream/templates/public/javascripts/jquery-ui.min.js
|
551
554
|
- lib/generators/social_stream/templates/public/javascripts/jquery.boxy.js
|
552
555
|
- lib/generators/social_stream/templates/public/javascripts/jquery.livequery.js
|
556
|
+
- lib/generators/social_stream/templates/public/javascripts/jquery.validate.js
|
553
557
|
- lib/generators/social_stream/templates/public/javascripts/menu.js
|
554
558
|
- lib/generators/social_stream/templates/public/javascripts/ui.dropdownchecklist.js
|
555
559
|
- lib/generators/social_stream/templates/public/stylesheets/activities.css
|
@@ -562,6 +566,7 @@ files:
|
|
562
566
|
- lib/generators/social_stream/templates/public/stylesheets/header.css
|
563
567
|
- lib/generators/social_stream/templates/public/stylesheets/home.css
|
564
568
|
- lib/generators/social_stream/templates/public/stylesheets/index.css
|
569
|
+
- lib/generators/social_stream/templates/public/stylesheets/jquery-ui.css
|
565
570
|
- lib/generators/social_stream/templates/public/stylesheets/menu.css
|
566
571
|
- lib/generators/social_stream/templates/public/stylesheets/message.css
|
567
572
|
- lib/generators/social_stream/templates/public/stylesheets/middle.css
|
@@ -599,8 +604,6 @@ files:
|
|
599
604
|
- lib/social_stream/version.rb
|
600
605
|
- lib/tasks/db/populate.rake
|
601
606
|
- social_stream.gemspec
|
602
|
-
- spec/controllers/.groups_controller_spec.rb.swp
|
603
|
-
- spec/controllers/.users_controller_spec.rb.swp
|
604
607
|
- spec/controllers/frontpage_controller_spec.rb
|
605
608
|
- spec/controllers/groups_controller_spec.rb
|
606
609
|
- spec/controllers/home_controller_spec.rb
|
@@ -627,7 +630,6 @@ files:
|
|
627
630
|
- spec/dummy/config/routes.rb
|
628
631
|
- spec/dummy/db/.gitignore
|
629
632
|
- spec/dummy/db/migrate/.gitkeep
|
630
|
-
- spec/dummy/db/schema.rb
|
631
633
|
- spec/dummy/db/seeds.rb
|
632
634
|
- spec/dummy/db/seeds/social_stream.yml
|
633
635
|
- spec/dummy/log/.gitignore
|
Binary file
|
Binary file
|
data/spec/dummy/db/schema.rb
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead of editing this file,
|
2
|
-
# please use the migrations feature of Active Record to incrementally modify your database, and
|
3
|
-
# then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
|
6
|
-
# to create the application database on another system, you should be using db:schema:load, not running
|
7
|
-
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
8
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
9
|
-
#
|
10
|
-
# It's strongly recommended to check this file into your version control system.
|
11
|
-
|
12
|
-
ActiveRecord::Schema.define(:version => 0) do
|
13
|
-
|
14
|
-
create_table "activities", :force => true do |t|
|
15
|
-
t.integer "activity_verb_id"
|
16
|
-
t.datetime "created_at"
|
17
|
-
t.datetime "updated_at"
|
18
|
-
t.integer "parent_id"
|
19
|
-
t.integer "tie_id"
|
20
|
-
end
|
21
|
-
|
22
|
-
add_index "activities", ["activity_verb_id"], :name => "fk_activity_verb"
|
23
|
-
add_index "activities", ["tie_id"], :name => "fk_activities_tie"
|
24
|
-
|
25
|
-
create_table "activity_object_activities", :force => true do |t|
|
26
|
-
t.integer "activity_id"
|
27
|
-
t.integer "activity_object_id"
|
28
|
-
t.datetime "created_at"
|
29
|
-
t.datetime "updated_at"
|
30
|
-
t.string "type", :limit => 45
|
31
|
-
end
|
32
|
-
|
33
|
-
add_index "activity_object_activities", ["activity_id"], :name => "fk_activity_object_activities_1"
|
34
|
-
add_index "activity_object_activities", ["activity_object_id"], :name => "fk_activity_object_activities_2"
|
35
|
-
|
36
|
-
create_table "activity_objects", :force => true do |t|
|
37
|
-
t.datetime "created_at"
|
38
|
-
t.datetime "updated_at"
|
39
|
-
t.string "object_type", :limit => 45
|
40
|
-
end
|
41
|
-
|
42
|
-
create_table "activity_verbs", :force => true do |t|
|
43
|
-
t.string "name", :limit => 45
|
44
|
-
t.datetime "created_at"
|
45
|
-
t.datetime "updated_at"
|
46
|
-
end
|
47
|
-
|
48
|
-
create_table "actors", :force => true do |t|
|
49
|
-
t.string "name", :limit => 45
|
50
|
-
t.string "email", :default => "", :null => false
|
51
|
-
t.string "permalink", :limit => 45
|
52
|
-
t.datetime "created_at"
|
53
|
-
t.datetime "updated_at"
|
54
|
-
t.integer "activity_object_id"
|
55
|
-
end
|
56
|
-
|
57
|
-
add_index "actors", ["activity_object_id"], :name => "fk_actors_activity_object"
|
58
|
-
add_index "actors", ["email"], :name => "index_actors_on_email"
|
59
|
-
add_index "actors", ["permalink"], :name => "index_actors_on_permalink", :unique => true
|
60
|
-
|
61
|
-
create_table "permissions", :force => true do |t|
|
62
|
-
t.string "action"
|
63
|
-
t.string "object"
|
64
|
-
t.string "parameter"
|
65
|
-
t.datetime "created_at"
|
66
|
-
t.datetime "updated_at"
|
67
|
-
end
|
68
|
-
|
69
|
-
create_table "relation_permissions", :force => true do |t|
|
70
|
-
t.integer "relation_id"
|
71
|
-
t.integer "permission_id"
|
72
|
-
t.datetime "created_at"
|
73
|
-
t.datetime "updated_at"
|
74
|
-
t.integer "relation_id"
|
75
|
-
end
|
76
|
-
|
77
|
-
add_index "relation_permissions", ["relation_id"], :name => "fk_relation_permissions_relation"
|
78
|
-
add_index "relation_permissions", ["permission_id"], :name => "fk_relation_permissions_permission"
|
79
|
-
|
80
|
-
create_table "relations", :force => true do |t|
|
81
|
-
t.string "name", :limit => 45
|
82
|
-
t.datetime "created_at"
|
83
|
-
t.datetime "updated_at"
|
84
|
-
t.string "mode"
|
85
|
-
t.string "ancestry"
|
86
|
-
end
|
87
|
-
|
88
|
-
add_index "relations", ["ancestry"]
|
89
|
-
|
90
|
-
create_table "tags", :force => true do |t|
|
91
|
-
t.string "name", :limit => 45
|
92
|
-
t.datetime "created_at"
|
93
|
-
t.datetime "updated_at"
|
94
|
-
end
|
95
|
-
|
96
|
-
create_table "tags_activity_objects", :force => true do |t|
|
97
|
-
t.integer "tag_id"
|
98
|
-
t.integer "activity_object_id"
|
99
|
-
end
|
100
|
-
|
101
|
-
add_index "tags_activity_objects", ["activity_object_id"], :name => "fk_tags_activity_objects_2"
|
102
|
-
add_index "tags_activity_objects", ["tag_id"], :name => "fk_tags_activity_objects_1"
|
103
|
-
|
104
|
-
create_table "ties", :force => true do |t|
|
105
|
-
t.integer "sender_id"
|
106
|
-
t.integer "receiver_id"
|
107
|
-
t.integer "relation_id"
|
108
|
-
t.datetime "created_at"
|
109
|
-
t.datetime "updated_at"
|
110
|
-
end
|
111
|
-
|
112
|
-
add_index "ties", ["receiver_id"], :name => "fk_tie_receiver"
|
113
|
-
add_index "ties", ["relation_id"], :name => "fk_tie_relation"
|
114
|
-
add_index "ties", ["sender_id"], :name => "fk_tie_sender"
|
115
|
-
|
116
|
-
end
|