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.
Files changed (114) hide show
  1. data/Gemfile +1 -1
  2. data/base/README.rdoc +2 -2
  3. data/base/app/assets/stylesheets/base.css.scss +1 -1
  4. data/base/app/controllers/activities_controller.rb +1 -2
  5. data/base/app/controllers/profiles_controller.rb +40 -8
  6. data/base/app/controllers/search_controller.rb +6 -49
  7. data/base/app/helpers/search_helper.rb +4 -34
  8. data/base/app/models/activity_object.rb +37 -4
  9. data/base/app/models/actor.rb +6 -0
  10. data/base/app/models/relation.rb +15 -0
  11. data/base/app/models/tie.rb +6 -0
  12. data/base/app/views/comments/create.js.erb +12 -7
  13. data/base/app/views/messages/_form.html.erb +1 -1
  14. data/base/app/views/posts/create.js.erb +8 -3
  15. data/base/app/views/search/_extended_search.html.erb +1 -1
  16. data/base/app/views/search/_extended_tab.html.erb +5 -0
  17. data/base/app/views/search/_form.html.erb +3 -3
  18. data/base/app/views/search/index.js.erb +3 -3
  19. data/base/config/routes.rb +6 -2
  20. data/base/lib/logos/groups/1.jpg +0 -0
  21. data/base/lib/logos/groups/10.jpg +0 -0
  22. data/base/lib/logos/groups/11.jpg +0 -0
  23. data/base/lib/logos/groups/12.jpg +0 -0
  24. data/base/lib/logos/groups/2.jpg +0 -0
  25. data/base/lib/logos/groups/3.jpg +0 -0
  26. data/base/lib/logos/groups/4.jpg +0 -0
  27. data/base/lib/logos/groups/5.jpg +0 -0
  28. data/base/lib/logos/groups/6.jpg +0 -0
  29. data/base/lib/logos/groups/7.jpg +0 -0
  30. data/base/lib/logos/groups/8.jpg +0 -0
  31. data/base/lib/logos/groups/9.jpg +0 -0
  32. data/base/lib/logos/partners/1.jpg +0 -0
  33. data/base/lib/logos/partners/1.png +0 -0
  34. data/base/lib/logos/partners/2.jpg +0 -0
  35. data/base/lib/logos/partners/2.png +0 -0
  36. data/base/lib/logos/users/1.jpg +0 -0
  37. data/base/lib/logos/users/10.jpg +0 -0
  38. data/base/lib/logos/users/11.jpg +0 -0
  39. data/base/lib/logos/users/12.jpg +0 -0
  40. data/base/lib/logos/users/2.jpg +0 -0
  41. data/base/lib/logos/users/3.jpg +0 -0
  42. data/base/lib/logos/users/4.jpg +0 -0
  43. data/base/lib/logos/users/5.jpg +0 -0
  44. data/base/lib/logos/users/6.jpg +0 -0
  45. data/base/lib/logos/users/7.jpg +0 -0
  46. data/base/lib/logos/users/8.jpg +0 -0
  47. data/base/lib/logos/users/9.jpg +0 -0
  48. data/base/lib/social_stream-base.rb +8 -0
  49. data/base/lib/social_stream/base/dependencies.rb +3 -1
  50. data/base/lib/social_stream/base/thinking-sphinx.rb +3 -1
  51. data/base/lib/social_stream/base/version.rb +1 -1
  52. data/base/lib/social_stream/controllers/helpers.rb +36 -30
  53. data/base/lib/social_stream/controllers/objects.rb +89 -1
  54. data/base/lib/social_stream/controllers/subjects.rb +3 -1
  55. data/base/lib/social_stream/models/object.rb +18 -0
  56. data/base/lib/social_stream/models/subject.rb +2 -0
  57. data/base/lib/social_stream/population/activity_object.rb +55 -0
  58. data/base/lib/social_stream/{populate.rb → population/power_law.rb} +3 -4
  59. data/base/lib/social_stream/population/timestamps.rb +12 -0
  60. data/base/lib/social_stream/search.rb +107 -0
  61. data/base/lib/tasks/db/populate.rake +13 -26
  62. data/base/social_stream-base.gemspec +3 -1
  63. data/base/spec/models/post_spec.rb +14 -0
  64. data/documents/app/controllers/documents_controller.rb +10 -34
  65. data/documents/app/controllers/pictures_controller.rb +6 -0
  66. data/documents/app/models/document.rb +2 -2
  67. data/documents/app/views/audios/index.html.erb +1 -1
  68. data/documents/app/views/common_documents/_headers.html.erb +20 -15
  69. data/documents/app/views/common_documents/_index.html.erb +5 -6
  70. data/documents/app/views/documents/index.html.erb +1 -1
  71. data/documents/app/views/documents/search.html.erb +3 -0
  72. data/documents/app/views/pictures/index.html.erb +1 -1
  73. data/documents/app/views/videos/index.html.erb +1 -1
  74. data/documents/config/routes.rb +2 -0
  75. data/documents/lib/samples/car.jpg +0 -0
  76. data/documents/lib/samples/house.jpg +0 -0
  77. data/documents/lib/samples/loremipsum.odt +0 -0
  78. data/documents/lib/samples/loremipsum.pdf +0 -0
  79. data/documents/lib/samples/siren.mp3 +0 -0
  80. data/documents/lib/samples/water.mp3 +0 -0
  81. data/documents/lib/social_stream/documents/version.rb +1 -1
  82. data/documents/lib/tasks/db/populate_documents.rake +6 -23
  83. data/documents/social_stream-documents.gemspec +1 -1
  84. data/events/app/assets/javascripts/social_stream-events.js +3 -0
  85. data/events/app/assets/javascripts/social_stream.event.js +5 -0
  86. data/events/app/controllers/events_controller.rb +1 -3
  87. data/events/app/models/event.rb +1 -1
  88. data/events/app/views/events/create.js.erb +1 -1
  89. data/events/app/views/events/index.html.erb +1 -1
  90. data/events/lib/social_stream/events/version.rb +1 -1
  91. data/events/social_stream-events.gemspec +1 -2
  92. data/lib/social_stream.rb +6 -6
  93. data/lib/social_stream/release/component.rb +29 -0
  94. data/lib/social_stream/release/component/version_file.rb +1 -1
  95. data/lib/social_stream/release/global.rb +65 -0
  96. data/lib/social_stream/release/global/version_file.rb +1 -1
  97. data/lib/social_stream/version.rb +1 -1
  98. data/linkser/lib/social_stream/linkser/version.rb +1 -1
  99. data/linkser/lib/tasks/db/populate_links.rake +4 -23
  100. data/linkser/social_stream-linkser.gemspec +2 -2
  101. data/presence/lib/social_stream/presence/version.rb +1 -1
  102. data/presence/social_stream-presence.gemspec +2 -2
  103. data/release.thor +69 -0
  104. data/social_stream.gemspec +6 -6
  105. data/spec/dummy/.gitignore +4 -1
  106. data/spec/dummy/app/assets/javascripts/application.js +5 -2
  107. data/spec/dummy/app/assets/stylesheets/application.css +6 -1
  108. data/spec/dummy/db/schema.rb +4 -2
  109. metadata +76 -40
  110. data/events/app/assets/javascripts/social_stream.events.tools.js.coffee +0 -50
  111. data/lib/social_stream/release.rb +0 -63
  112. data/lib/social_stream/release/component/release.rb +0 -29
  113. data/lib/social_stream/release/global/release.rb +0 -70
  114. data/social_stream.thor +0 -21
@@ -1 +1 @@
1
- <%=render(:partial => 'common_documents/index') %>
1
+ <%= render :partial => 'common_documents/index', :locals => { :documents => @videos } %>
@@ -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
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Documents
3
- VERSION = "0.14.0".freeze
3
+ VERSION = "0.14.1".freeze
4
4
  end
5
5
  end
@@ -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
- puts 'Documents population'
10
- docs_start = Time.now
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
- doc_files = Forgery::Extensions::Array.new(Dir.glob(File.join(Rails.root, 'lib', 'documents', "*")))
13
-
14
- 50.times do
15
- updated = Time.at(rand(Time.now.to_i))
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.0')
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')
@@ -1,4 +1,7 @@
1
+ //= require jquery.boxy
1
2
  //= require jquery.watermark
3
+ //= require fullcalendar
4
+ //= require scheduler
2
5
  //
3
6
  //= require social_stream-base
4
7
  //
@@ -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
@@ -64,7 +64,7 @@ class Event < ActiveRecord::Base
64
64
  def room_belongs_to_receiver
65
65
  return if room_id.blank?
66
66
 
67
- unless _contact.receiver.room_ids.include?(room_id)
67
+ unless owner.room_ids.include?(room_id)
68
68
  errors.add(:room_id, :invalid)
69
69
  end
70
70
  end
@@ -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.Events.tools.eventColor(<%= @event.room_id %>);
8
+ ev.color = SocialStream.Event.color(<%= @event.room_id %>);
9
9
 
10
10
  cal.fullCalendar('renderEvent', ev,
11
11
  true // make the event "stick"
@@ -78,7 +78,7 @@
78
78
  success: function(events) {
79
79
  callback(
80
80
  $.map(events, function(event) {
81
- event.color = SocialStream.Events.tools.eventColor(event.roomId);
81
+ event.color = SocialStream.Event.color(event.roomId);
82
82
  return event;
83
83
  }
84
84
  )
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Events
3
- VERSION = "0.12.0".freeze
3
+ VERSION = "0.12.1".freeze
4
4
  end
5
5
  end
@@ -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.0')
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__)
@@ -1,6 +1,6 @@
1
1
  module SocialStream
2
2
  module Release
3
- module Component
3
+ class Component
4
4
  class VersionFile < Global::VersionFile
5
5
  attr_reader :name
6
6
 
@@ -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
@@ -1,6 +1,6 @@
1
1
  module SocialStream
2
2
  module Release
3
- module Global
3
+ class Global
4
4
  # Manage component's version files
5
5
  #
6
6
  # This code is based on gem_release's version_file.rb
@@ -1,3 +1,3 @@
1
1
  module SocialStream
2
- VERSION = "0.26.0".freeze
2
+ VERSION = "0.26.1".freeze
3
3
  end
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Linkser
3
- VERSION = "0.11.0".freeze
3
+ VERSION = "0.11.1".freeze
4
4
  end
5
5
  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
- puts 'Links population'
10
- links_start = Time.now
11
-
12
- 50.times do
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.0')
16
- s.add_runtime_dependency('linkser', '~> 0.0.10')
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'
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Presence
3
- VERSION = "0.13.0"
3
+ VERSION = "0.13.1"
4
4
  end
5
5
  end
@@ -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.0')
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 "ruby-debug19"
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