social_stream 0.26.0 → 0.26.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/base/README.rdoc +2 -2
- data/base/app/assets/stylesheets/base.css.scss +1 -1
- data/base/app/controllers/activities_controller.rb +1 -2
- data/base/app/controllers/profiles_controller.rb +40 -8
- data/base/app/controllers/search_controller.rb +6 -49
- data/base/app/helpers/search_helper.rb +4 -34
- data/base/app/models/activity_object.rb +37 -4
- data/base/app/models/actor.rb +6 -0
- data/base/app/models/relation.rb +15 -0
- data/base/app/models/tie.rb +6 -0
- data/base/app/views/comments/create.js.erb +12 -7
- data/base/app/views/messages/_form.html.erb +1 -1
- data/base/app/views/posts/create.js.erb +8 -3
- data/base/app/views/search/_extended_search.html.erb +1 -1
- data/base/app/views/search/_extended_tab.html.erb +5 -0
- data/base/app/views/search/_form.html.erb +3 -3
- data/base/app/views/search/index.js.erb +3 -3
- data/base/config/routes.rb +6 -2
- data/base/lib/logos/groups/1.jpg +0 -0
- data/base/lib/logos/groups/10.jpg +0 -0
- data/base/lib/logos/groups/11.jpg +0 -0
- data/base/lib/logos/groups/12.jpg +0 -0
- data/base/lib/logos/groups/2.jpg +0 -0
- data/base/lib/logos/groups/3.jpg +0 -0
- data/base/lib/logos/groups/4.jpg +0 -0
- data/base/lib/logos/groups/5.jpg +0 -0
- data/base/lib/logos/groups/6.jpg +0 -0
- data/base/lib/logos/groups/7.jpg +0 -0
- data/base/lib/logos/groups/8.jpg +0 -0
- data/base/lib/logos/groups/9.jpg +0 -0
- data/base/lib/logos/partners/1.jpg +0 -0
- data/base/lib/logos/partners/1.png +0 -0
- data/base/lib/logos/partners/2.jpg +0 -0
- data/base/lib/logos/partners/2.png +0 -0
- data/base/lib/logos/users/1.jpg +0 -0
- data/base/lib/logos/users/10.jpg +0 -0
- data/base/lib/logos/users/11.jpg +0 -0
- data/base/lib/logos/users/12.jpg +0 -0
- data/base/lib/logos/users/2.jpg +0 -0
- data/base/lib/logos/users/3.jpg +0 -0
- data/base/lib/logos/users/4.jpg +0 -0
- data/base/lib/logos/users/5.jpg +0 -0
- data/base/lib/logos/users/6.jpg +0 -0
- data/base/lib/logos/users/7.jpg +0 -0
- data/base/lib/logos/users/8.jpg +0 -0
- data/base/lib/logos/users/9.jpg +0 -0
- data/base/lib/social_stream-base.rb +8 -0
- data/base/lib/social_stream/base/dependencies.rb +3 -1
- data/base/lib/social_stream/base/thinking-sphinx.rb +3 -1
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/lib/social_stream/controllers/helpers.rb +36 -30
- data/base/lib/social_stream/controllers/objects.rb +89 -1
- data/base/lib/social_stream/controllers/subjects.rb +3 -1
- data/base/lib/social_stream/models/object.rb +18 -0
- data/base/lib/social_stream/models/subject.rb +2 -0
- data/base/lib/social_stream/population/activity_object.rb +55 -0
- data/base/lib/social_stream/{populate.rb → population/power_law.rb} +3 -4
- data/base/lib/social_stream/population/timestamps.rb +12 -0
- data/base/lib/social_stream/search.rb +107 -0
- data/base/lib/tasks/db/populate.rake +13 -26
- data/base/social_stream-base.gemspec +3 -1
- data/base/spec/models/post_spec.rb +14 -0
- data/documents/app/controllers/documents_controller.rb +10 -34
- data/documents/app/controllers/pictures_controller.rb +6 -0
- data/documents/app/models/document.rb +2 -2
- data/documents/app/views/audios/index.html.erb +1 -1
- data/documents/app/views/common_documents/_headers.html.erb +20 -15
- data/documents/app/views/common_documents/_index.html.erb +5 -6
- data/documents/app/views/documents/index.html.erb +1 -1
- data/documents/app/views/documents/search.html.erb +3 -0
- data/documents/app/views/pictures/index.html.erb +1 -1
- data/documents/app/views/videos/index.html.erb +1 -1
- data/documents/config/routes.rb +2 -0
- data/documents/lib/samples/car.jpg +0 -0
- data/documents/lib/samples/house.jpg +0 -0
- data/documents/lib/samples/loremipsum.odt +0 -0
- data/documents/lib/samples/loremipsum.pdf +0 -0
- data/documents/lib/samples/siren.mp3 +0 -0
- data/documents/lib/samples/water.mp3 +0 -0
- data/documents/lib/social_stream/documents/version.rb +1 -1
- data/documents/lib/tasks/db/populate_documents.rake +6 -23
- data/documents/social_stream-documents.gemspec +1 -1
- data/events/app/assets/javascripts/social_stream-events.js +3 -0
- data/events/app/assets/javascripts/social_stream.event.js +5 -0
- data/events/app/controllers/events_controller.rb +1 -3
- data/events/app/models/event.rb +1 -1
- data/events/app/views/events/create.js.erb +1 -1
- data/events/app/views/events/index.html.erb +1 -1
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +1 -2
- data/lib/social_stream.rb +6 -6
- data/lib/social_stream/release/component.rb +29 -0
- data/lib/social_stream/release/component/version_file.rb +1 -1
- data/lib/social_stream/release/global.rb +65 -0
- data/lib/social_stream/release/global/version_file.rb +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/linkser/lib/social_stream/linkser/version.rb +1 -1
- data/linkser/lib/tasks/db/populate_links.rake +4 -23
- data/linkser/social_stream-linkser.gemspec +2 -2
- data/presence/lib/social_stream/presence/version.rb +1 -1
- data/presence/social_stream-presence.gemspec +2 -2
- data/release.thor +69 -0
- data/social_stream.gemspec +6 -6
- data/spec/dummy/.gitignore +4 -1
- data/spec/dummy/app/assets/javascripts/application.js +5 -2
- data/spec/dummy/app/assets/stylesheets/application.css +6 -1
- data/spec/dummy/db/schema.rb +4 -2
- metadata +76 -40
- data/events/app/assets/javascripts/social_stream.events.tools.js.coffee +0 -50
- data/lib/social_stream/release.rb +0 -63
- data/lib/social_stream/release/component/release.rb +0 -29
- data/lib/social_stream/release/global/release.rb +0 -70
- data/social_stream.thor +0 -21
@@ -1 +1 @@
|
|
1
|
-
<%=render
|
1
|
+
<%= render :partial => 'common_documents/index', :locals => { :documents => @videos } %>
|
data/documents/config/routes.rb
CHANGED
@@ -4,6 +4,7 @@ Rails.application.routes.draw do
|
|
4
4
|
resources :videos
|
5
5
|
|
6
6
|
resources :documents do
|
7
|
+
get "search", :on => :collection
|
7
8
|
get "download", :on => :member
|
8
9
|
end
|
9
10
|
|
@@ -15,6 +16,7 @@ Rails.application.routes.draw do
|
|
15
16
|
resources :videos
|
16
17
|
|
17
18
|
resources :documents do
|
19
|
+
get "search", :on => :collection
|
18
20
|
get "download", :on => :member
|
19
21
|
end
|
20
22
|
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -6,31 +6,14 @@ namespace :db do
|
|
6
6
|
|
7
7
|
desc "Add documents to populate data"
|
8
8
|
task :create_documents => :read_environment do
|
9
|
-
|
10
|
-
|
9
|
+
SS_DOCS_PATH=Gem::Specification.find_by_name('social_stream-documents').full_gem_path
|
10
|
+
doc_files = Forgery::Extensions::Array.new(Dir.glob(File.join(SS_DOCS_PATH, 'lib', 'samples', "*")))
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
author = Actor.all[rand(Actor.all.size)]
|
17
|
-
owner = author
|
18
|
-
user_author = ( author.subject_type == "User" ? author : author.user_author )
|
19
|
-
|
20
|
-
d = Document.create! :file => File.open(doc_files.random, "r"),
|
21
|
-
:title => Forgery::LoremIpsum.words(1+rand(4),:random => true),
|
22
|
-
:created_at => Time.at(rand(updated.to_i)),
|
23
|
-
:updated_at => updated,
|
24
|
-
:author_id => author.id,
|
25
|
-
:owner_id => owner.id,
|
26
|
-
:user_author_id => user_author.id,
|
27
|
-
:relation_ids => [Relation::Public.instance.id]
|
28
|
-
d.save!
|
12
|
+
SocialStream::Population::ActivityObject.new Document do |d|
|
13
|
+
d.file = File.open(doc_files.random, "r")
|
14
|
+
d.title = Forgery::LoremIpsum.words(rand(4), :random => true)
|
15
|
+
d.description = Forgery::LoremIpsum.sentences(rand(4), :random => true)
|
29
16
|
end
|
30
|
-
|
31
|
-
docs_end = Time.now
|
32
|
-
puts ' -> ' + (docs_end - docs_start).round(4).to_s + 's'
|
33
17
|
end
|
34
18
|
end
|
35
19
|
end
|
36
|
-
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
|
14
14
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.20.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.20.1')
|
16
16
|
s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.7.0')
|
17
17
|
s.add_runtime_dependency('paperclip','= 2.4.5')
|
18
18
|
s.add_runtime_dependency('delayed_paperclip','2.4.5.1')
|
@@ -11,6 +11,10 @@ SocialStream.Event = (function(SS, $, undefined) {
|
|
11
11
|
$.each(indexCallbacks, function(i, callback){ callback(); });
|
12
12
|
}
|
13
13
|
|
14
|
+
var color = function(){
|
15
|
+
SocialStream.Events.current.eventColor;
|
16
|
+
}
|
17
|
+
|
14
18
|
var fixDates = function(){
|
15
19
|
$(".event").each(function(){
|
16
20
|
dateString = $(this).find("time").attr("datetime");
|
@@ -44,6 +48,7 @@ SocialStream.Event = (function(SS, $, undefined) {
|
|
44
48
|
|
45
49
|
return {
|
46
50
|
addIndexCallback: addIndexCallback,
|
51
|
+
color: color,
|
47
52
|
index: index
|
48
53
|
}
|
49
54
|
|
@@ -1,8 +1,6 @@
|
|
1
1
|
class EventsController < ApplicationController
|
2
2
|
include SocialStream::Controllers::Objects
|
3
3
|
|
4
|
-
belongs_to_subjects :optional => true
|
5
|
-
|
6
4
|
before_filter :profile_subject!, :only => :index
|
7
5
|
|
8
6
|
def index
|
@@ -31,7 +29,7 @@ class EventsController < ApplicationController
|
|
31
29
|
|
32
30
|
def collection
|
33
31
|
@activities =
|
34
|
-
profile_subject.wall(:profile,
|
32
|
+
(profile_subject || current_subject).wall(:profile,
|
35
33
|
:for => current_subject,
|
36
34
|
:object_type => :Event)
|
37
35
|
end
|
data/events/app/models/event.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
jQuery.each(<%= raw Array.wrap(@event.to_json).to_json %>,
|
7
7
|
function(index, ev) {
|
8
|
-
ev.color = SocialStream.
|
8
|
+
ev.color = SocialStream.Event.color(<%= @event.room_id %>);
|
9
9
|
|
10
10
|
cal.fullCalendar('renderEvent', ev,
|
11
11
|
true // make the event "stick"
|
@@ -12,9 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
|
14
14
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.20.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.20.1')
|
16
16
|
s.add_runtime_dependency('rails-scheduler', '~> 0.0.8')
|
17
|
-
s.add_runtime_dependency('coffee-rails', '>= 3.1.0')
|
18
17
|
|
19
18
|
# Development Gem dependencies
|
20
19
|
s.add_development_dependency('sqlite3-ruby')
|
data/lib/social_stream.rb
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
require 'social_stream-base'
|
2
|
-
require 'social_stream-documents'
|
3
|
-
require 'social_stream-events'
|
4
|
-
require 'social_stream-linkser'
|
5
|
-
require 'social_stream-presence'
|
6
|
-
|
7
1
|
module SocialStream
|
2
|
+
Components = %w{ base documents events linkser presence }
|
3
|
+
|
8
4
|
class Engine < ::Rails::Engine #:nodoc:
|
9
5
|
config.app_generators.base 'social_stream:base'
|
10
6
|
config.app_generators.documents 'social_stream:documents'
|
@@ -13,3 +9,7 @@ module SocialStream
|
|
13
9
|
config.app_generators.chat 'social_stream:presence'
|
14
10
|
end
|
15
11
|
end
|
12
|
+
|
13
|
+
SocialStream::Components.each do |component|
|
14
|
+
require "social_stream-#{ component }" # require "social_stream-base"
|
15
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require File.expand_path('../global', __FILE__)
|
2
|
+
|
3
|
+
module SocialStream
|
4
|
+
module Release
|
5
|
+
class Component < Global
|
6
|
+
attr_reader :name
|
7
|
+
|
8
|
+
def initialize(name, options = {})
|
9
|
+
@name, @options = name, options
|
10
|
+
end
|
11
|
+
|
12
|
+
protected
|
13
|
+
|
14
|
+
def version_file
|
15
|
+
@version_file ||= VersionFile.new(@name, @options[:version])
|
16
|
+
end
|
17
|
+
|
18
|
+
def gemspec
|
19
|
+
"#{ name }/social_stream-#{ name }.gemspec"
|
20
|
+
end
|
21
|
+
|
22
|
+
def rake_release_command
|
23
|
+
"cd #{ @name } && rake release"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
require File.expand_path('../component/version_file', __FILE__)
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require File.expand_path('../dependency_update', __FILE__)
|
2
|
+
require File.expand_path('../global/version_file', __FILE__)
|
3
|
+
|
4
|
+
module SocialStream
|
5
|
+
module Release
|
6
|
+
class Global
|
7
|
+
include Thor::Actions
|
8
|
+
|
9
|
+
DEPENDENCY_REGEXP = /dependency.*social_stream-(\w*)/
|
10
|
+
|
11
|
+
attr_reader :name, :version
|
12
|
+
|
13
|
+
def initialize(target = nil, options = {})
|
14
|
+
@target, @options = target, options
|
15
|
+
end
|
16
|
+
|
17
|
+
def bump
|
18
|
+
bump_version
|
19
|
+
|
20
|
+
update_dependencies
|
21
|
+
end
|
22
|
+
|
23
|
+
def publish
|
24
|
+
if @options[:test]
|
25
|
+
puts rake_release_command
|
26
|
+
else
|
27
|
+
system(rake_release_command) || raise(RuntimeError.new)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def dependencies
|
32
|
+
@dependencies ||=
|
33
|
+
File.read(gemspec).scan(DEPENDENCY_REGEXP).flatten
|
34
|
+
end
|
35
|
+
|
36
|
+
def commit_files
|
37
|
+
"#{ @version_file.filename } #{ gemspec }"
|
38
|
+
end
|
39
|
+
|
40
|
+
protected
|
41
|
+
|
42
|
+
def bump_version
|
43
|
+
@version = version_file.bump!
|
44
|
+
end
|
45
|
+
|
46
|
+
def version_file
|
47
|
+
@version_file ||= VersionFile.new(@target)
|
48
|
+
end
|
49
|
+
|
50
|
+
def update_dependencies
|
51
|
+
dependencies.each do |d|
|
52
|
+
DependencyUpdate.new.invoke(:update, [ gemspec, d, Component::VersionFile.new(d).old_number ])
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def gemspec
|
57
|
+
"social_stream.gemspec"
|
58
|
+
end
|
59
|
+
|
60
|
+
def rake_release_command
|
61
|
+
"rake release"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -6,30 +6,11 @@ namespace :db do
|
|
6
6
|
|
7
7
|
desc "Add links to populate data"
|
8
8
|
task :create_links => :read_environment do
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
updated = Time.at(rand(Time.now.to_i))
|
14
|
-
author = Actor.all[rand(Actor.all.size)]
|
15
|
-
owner = author
|
16
|
-
user_author = ( author.subject_type == "User" ? author : author.user_author )
|
17
|
-
|
18
|
-
d = Link.create! :title => Forgery::LoremIpsum.words(1+rand(4),:random => true),
|
19
|
-
:description => Forgery::LoremIpsum.sentences(1+rand(4), :random => true),
|
20
|
-
:url => "http://#{ Forgery::Internet.domain_name }",
|
21
|
-
:created_at => Time.at(rand(updated.to_i)),
|
22
|
-
:updated_at => updated,
|
23
|
-
:author_id => author.id,
|
24
|
-
:owner_id => owner.id,
|
25
|
-
:user_author_id => user_author.id,
|
26
|
-
:_relation_ids => [Relation::Public.instance.id]
|
27
|
-
d.save!
|
9
|
+
SocialStream::Population::ActivityObject.new Link do |l|
|
10
|
+
l.title = Forgery::LoremIpsum.words(1+rand(4),:random => true)
|
11
|
+
l.description = Forgery::LoremIpsum.sentences(1+rand(4), :random => true)
|
12
|
+
l.url = "http://#{ Forgery::Internet.domain_name }"
|
28
13
|
end
|
29
|
-
|
30
|
-
links_end = Time.now
|
31
|
-
puts ' -> ' + (links_end - links_start).round(4).to_s + 's'
|
32
14
|
end
|
33
15
|
end
|
34
16
|
end
|
35
|
-
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
|
14
14
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.20.
|
16
|
-
s.add_runtime_dependency('linkser', '~> 0.0.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.20.1')
|
16
|
+
s.add_runtime_dependency('linkser', '~> 0.0.12')
|
17
17
|
# Development Gem dependencies
|
18
18
|
s.add_development_dependency('sqlite3-ruby')
|
19
19
|
if RUBY_VERSION < '1.9'
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
21
|
# Gem dependencies
|
22
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.20.
|
22
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.20.1')
|
23
23
|
|
24
24
|
s.add_runtime_dependency "xmpp4r"
|
25
25
|
|
@@ -27,6 +27,6 @@ Gem::Specification.new do |s|
|
|
27
27
|
|
28
28
|
s.add_runtime_dependency "net-sftp"
|
29
29
|
|
30
|
-
s.add_development_dependency "
|
30
|
+
s.add_development_dependency "debugger"
|
31
31
|
|
32
32
|
end
|
data/release.thor
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
require File.expand_path("../lib/social_stream/release/component", __FILE__)
|
2
|
+
|
3
|
+
# SocialStream release tasks
|
4
|
+
class Release < Thor
|
5
|
+
|
6
|
+
default_task :bump_and_publish
|
7
|
+
|
8
|
+
method_option :test => false,
|
9
|
+
:desc => "Do nothing",
|
10
|
+
:aliases => "-t"
|
11
|
+
|
12
|
+
desc "bump_and_publish", "Bump gem versions and release them"
|
13
|
+
def bump_and_publish(*args)
|
14
|
+
bump *args
|
15
|
+
publish *args
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "bump", "Bump gem versions and set SocialStream's dependencies"
|
19
|
+
def bump(*args)
|
20
|
+
# First of all, update gems
|
21
|
+
system "bundle"
|
22
|
+
|
23
|
+
parse_args(args)
|
24
|
+
|
25
|
+
all.each(&:bump)
|
26
|
+
|
27
|
+
system("git commit #{ all.map(&:commit_files).join(" ") } -m #{ @global.version }") ||
|
28
|
+
raise(RuntimeError.new)
|
29
|
+
end
|
30
|
+
|
31
|
+
desc "publish", "push SocialStream's gems to rubygems and create git tags"
|
32
|
+
def publish(*args)
|
33
|
+
parse_args(args)
|
34
|
+
|
35
|
+
all.each(&:publish)
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def parse_args(args)
|
41
|
+
if args.empty?
|
42
|
+
args = global_dependencies
|
43
|
+
end
|
44
|
+
|
45
|
+
@components = []
|
46
|
+
|
47
|
+
args.each do |a|
|
48
|
+
name, version = a.split(":")
|
49
|
+
|
50
|
+
if global_dependencies.include?(name)
|
51
|
+
@components << ::SocialStream::Release::Component.new(name, options.merge(:version => version))
|
52
|
+
else
|
53
|
+
@target = name
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
@global = ::SocialStream::Release::Global.new(@target, options)
|
58
|
+
end
|
59
|
+
|
60
|
+
def global_dependencies
|
61
|
+
@global_dependencies ||=
|
62
|
+
::SocialStream::Release::Global.new.dependencies
|
63
|
+
end
|
64
|
+
|
65
|
+
def all
|
66
|
+
@all ||=
|
67
|
+
@components + [@global]
|
68
|
+
end
|
69
|
+
end
|