social_stream-documents 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/documents.js.erb +1 -1
- data/lib/delayed_paperclip/social_stream-documents.rb +18 -0
- data/lib/paperclip/social_stream-documents.rb +48 -0
- data/lib/social_stream-documents.rb +1 -4
- data/lib/social_stream/documents/dependencies.rb +6 -0
- data/lib/social_stream/documents/engine.rb +24 -7
- data/lib/social_stream/documents/version.rb +1 -1
- data/social_stream-documents.gemspec +3 -5
- data/spec/dummy/config/initializers/devise.rb +1 -1
- metadata +26 -23
@@ -34,7 +34,7 @@ $(document).ready(function(){
|
|
34
34
|
var comments = $(this).children(".subactivity");
|
35
35
|
if (comments.size() > 5){
|
36
36
|
$(this).prepend("<div class='hide_show_comments'><a href='#' onclick='showAllDocumentComments(\""+
|
37
|
-
$(this).attr('id') +"\"); return false;'
|
37
|
+
$(this).attr('id') +"\"); return false;'>" + I18n.t('comment.view_all') + "(" +
|
38
38
|
comments.size() + ")</a></div><div class='space_comments'></div>");
|
39
39
|
comments.slice(0,comments.size()-5).hide();
|
40
40
|
//hide alto space_comments
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Monkey-patch https://github.com/jstorimer/delayed_paperclip/commit/3e0e3451147e96f378cda4695546d9633944cc5c
|
2
|
+
#
|
3
|
+
# Remove with delayed_paperclip > 2.4.5.1
|
4
|
+
require 'delayed_paperclip'
|
5
|
+
|
6
|
+
module DelayedPaperclip::Attachment::InstanceMethods
|
7
|
+
def post_process_styles_with_processing(*args)
|
8
|
+
post_process_styles_without_processing(*args)
|
9
|
+
|
10
|
+
# update_column is available in rails 3.1 instead we can do this to update the attribute without callbacks
|
11
|
+
|
12
|
+
#instance.update_column("#{name}_processing", false) if instance.respond_to?(:"#{name}_processing?")
|
13
|
+
if instance.respond_to?(:"#{name}_processing?")
|
14
|
+
instance.send("#{name}_processing=", false)
|
15
|
+
instance.class.update_all({ "#{name}_processing" => false }, instance.class.primary_key => instance.id)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# Monkey patch https://github.com/thoughtbot/paperclip/issues/293#issuecomment-2484541
|
2
|
+
#
|
3
|
+
# Remove with paperclip > 2.5.0
|
4
|
+
require 'paperclip'
|
5
|
+
|
6
|
+
module Paperclip::ClassMethods
|
7
|
+
def has_attached_file name, options = {}
|
8
|
+
include Paperclip::InstanceMethods
|
9
|
+
|
10
|
+
if attachment_definitions.nil?
|
11
|
+
if respond_to?(:class_attribute)
|
12
|
+
self.attachment_definitions = {}
|
13
|
+
else
|
14
|
+
write_inheritable_attribute(:attachment_definitions, {})
|
15
|
+
end
|
16
|
+
else
|
17
|
+
self.attachment_definitions = self.attachment_definitions.dup
|
18
|
+
end
|
19
|
+
|
20
|
+
attachment_definitions[name] = {:validations => []}.merge(options)
|
21
|
+
Paperclip.classes_with_attachments << self.name
|
22
|
+
Paperclip.check_for_url_clash(name,attachment_definitions[name][:url],self.name)
|
23
|
+
|
24
|
+
after_save :save_attached_files
|
25
|
+
before_destroy :prepare_for_destroy
|
26
|
+
after_destroy :destroy_attached_files
|
27
|
+
|
28
|
+
define_paperclip_callbacks :post_process, :"#{name}_post_process"
|
29
|
+
|
30
|
+
define_method name do |*args|
|
31
|
+
a = attachment_for(name)
|
32
|
+
(args.length > 0) ? a.to_s(args.first) : a
|
33
|
+
end
|
34
|
+
|
35
|
+
define_method "#{name}=" do |file|
|
36
|
+
attachment_for(name).assign(file)
|
37
|
+
end
|
38
|
+
|
39
|
+
define_method "#{name}?" do
|
40
|
+
attachment_for(name).file?
|
41
|
+
end
|
42
|
+
|
43
|
+
validates_each(name) do |record, attr, value|
|
44
|
+
attachment = record.attachment_for(name)
|
45
|
+
attachment.send(:flush_errors)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -1,5 +1,4 @@
|
|
1
|
-
require 'social_stream
|
2
|
-
require 'delayed_paperclip'
|
1
|
+
require 'social_stream/documents/dependencies'
|
3
2
|
|
4
3
|
module SocialStream
|
5
4
|
module ToolbarConfig
|
@@ -20,6 +19,4 @@ module SocialStream
|
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
23
|
-
#require 'paperclip_processors/ffmpeg'
|
24
|
-
require 'paperclip-ffmpeg'
|
25
22
|
require 'social_stream/documents/engine'
|
@@ -5,9 +5,7 @@ module SocialStream
|
|
5
5
|
initializer "social_stream-documents.register_mime_types" do
|
6
6
|
# Documents
|
7
7
|
Mime::Type.register "text/plain", :txt
|
8
|
-
Mime::Type.register "application/zip", :zip
|
9
8
|
Mime::Type.register "application/x-rar", :rar
|
10
|
-
Mime::Type.register "application/pdf", :pdf
|
11
9
|
Mime::Type.register "application/postscript", :ps, [ "application/ps" ]
|
12
10
|
Mime::Type.register "application/vnd.oasis.opendocument.text", :odt
|
13
11
|
Mime::Type.register "application/vnd.oasis.opendocument.presentation", :odp
|
@@ -17,19 +15,38 @@ module SocialStream
|
|
17
15
|
Mime::Type.register "application/vnd.ms-excel", :xls, [ "application/msexcel" ]
|
18
16
|
Mime::Type.register "application/rtf", :rtf
|
19
17
|
Mime::Type.register "application/vnd.scribus", :sla
|
18
|
+
# These are already defined in Rails 3.2
|
19
|
+
unless defined? Mime::ZIP
|
20
|
+
Mime::Type.register "application/zip", :zip
|
21
|
+
end
|
22
|
+
unless defined? Mime::PDF
|
23
|
+
Mime::Type.register "application/pdf", :pdf
|
24
|
+
end
|
20
25
|
|
21
26
|
# Picture
|
22
|
-
Mime::Type.register "image/jpeg", :jpeg, ["image/pjpeg","image/jpg"]
|
23
|
-
Mime::Type.register "image/gif", :gif
|
24
|
-
Mime::Type.register "image/png", :png, [ "image/x-png" ]
|
25
|
-
Mime::Type.register "image/bmp", :bmp
|
26
27
|
Mime::Type.register "image/x-xcf", :xcf
|
28
|
+
# These are already defined in Rails 3.2
|
29
|
+
unless defined? Mime::JPEG
|
30
|
+
Mime::Type.register "image/jpeg", :jpeg, ["image/pjpeg","image/jpg"]
|
31
|
+
end
|
32
|
+
unless defined? Mime::GIF
|
33
|
+
Mime::Type.register "image/gif", :gif
|
34
|
+
end
|
35
|
+
unless defined? Mime::PNG
|
36
|
+
Mime::Type.register "image/png", :png, [ "image/x-png" ]
|
37
|
+
end
|
38
|
+
unless defined? Mime::BMP
|
39
|
+
Mime::Type.register "image/bmp", :bmp
|
40
|
+
end
|
27
41
|
|
28
42
|
# Audio
|
29
43
|
Mime::Type.register "audio/x-wav", :wav, [ "audio/wav" ]
|
30
|
-
Mime::Type.register "audio/mpeg", :mpeg
|
31
44
|
Mime::Type.register "audio/x-vorbis+ogg", :ogg, [ "application/ogg" ]
|
32
45
|
Mime::Type.register "audio/webm", :webma
|
46
|
+
# These are already defined in Rails 3.2
|
47
|
+
unless defined? Mime::MPEG
|
48
|
+
Mime::Type.register "audio/mpeg", :mpeg
|
49
|
+
end
|
33
50
|
|
34
51
|
# Video
|
35
52
|
Mime::Type.register "video/x-flv", :flv
|
@@ -12,12 +12,10 @@ 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.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.14.0')
|
16
16
|
s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.7.0')
|
17
|
-
|
18
|
-
|
19
|
-
s.add_runtime_dependency('paperclip','2.3.11')
|
20
|
-
s.add_runtime_dependency('delayed_paperclip','0.7.2')
|
17
|
+
s.add_runtime_dependency('paperclip','= 2.4.5')
|
18
|
+
s.add_runtime_dependency('delayed_paperclip','2.4.5.1')
|
21
19
|
# Development Gem dependencies
|
22
20
|
s.add_development_dependency('sqlite3-ruby')
|
23
21
|
if RUBY_VERSION < '1.9'
|
@@ -160,7 +160,7 @@ Devise.setup do |config|
|
|
160
160
|
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
161
161
|
# up on your models and hooks.
|
162
162
|
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
163
|
-
config.omniauth :
|
163
|
+
config.omniauth :linkedin, "ekxfXU8nueVSMQ9fc5KJAryBkyztUlCBYMW3DoQPzbE79WhivvzhQloRNHCHgPeB", "WYiHFT-KKFgjd45W3-pEAficmXRHmN6_6DGwj1C_ZILJlSO1gBvv6VNYXU9tybGY"
|
164
164
|
|
165
165
|
config.omniauth :facebook, "129571360447856","eef39dce5e20e76f77495c59623bdb38"
|
166
166
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-documents
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,22 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-01-
|
13
|
+
date: 2012-01-26 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: social_stream-base
|
17
|
-
requirement: &
|
17
|
+
requirement: &88799830 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.14.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *88799830
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: paperclip-ffmpeg
|
28
|
-
requirement: &
|
28
|
+
requirement: &88799580 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,32 +33,32 @@ dependencies:
|
|
33
33
|
version: 0.7.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *88799580
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: paperclip
|
39
|
-
requirement: &
|
39
|
+
requirement: &88799350 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - =
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 2.
|
44
|
+
version: 2.4.5
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *88799350
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: delayed_paperclip
|
50
|
-
requirement: &
|
50
|
+
requirement: &88799120 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - =
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 2.4.5.1
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *88799120
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: sqlite3-ruby
|
61
|
-
requirement: &
|
61
|
+
requirement: &88798930 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *88798930
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rspec-rails
|
72
|
-
requirement: &
|
72
|
+
requirement: &88798650 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 2.6.0
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *88798650
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: factory_girl
|
83
|
-
requirement: &
|
83
|
+
requirement: &88798400 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: 1.3.2
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *88798400
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: forgery
|
94
|
-
requirement: &
|
94
|
+
requirement: &88798170 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ~>
|
@@ -99,10 +99,10 @@ dependencies:
|
|
99
99
|
version: 0.4.2
|
100
100
|
type: :development
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *88798170
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: capybara
|
105
|
-
requirement: &
|
105
|
+
requirement: &88797940 !ruby/object:Gem::Requirement
|
106
106
|
none: false
|
107
107
|
requirements:
|
108
108
|
- - ~>
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
version: 0.3.9
|
111
111
|
type: :development
|
112
112
|
prerelease: false
|
113
|
-
version_requirements: *
|
113
|
+
version_requirements: *88797940
|
114
114
|
description: ! 'Social Stream is a Ruby on Rails engine providing your application
|
115
115
|
with social networking features and activity streams.
|
116
116
|
|
@@ -230,8 +230,11 @@ files:
|
|
230
230
|
- db/migrate/20110922173707_add_file_processing_to_document.rb
|
231
231
|
- db/migrate/20111005112707_add_title_and_description_to_document.rb
|
232
232
|
- db/migrate/20120109155431_document_object_type.rb
|
233
|
+
- lib/delayed_paperclip/social_stream-documents.rb
|
233
234
|
- lib/generators/social_stream/documents/install_generator.rb
|
235
|
+
- lib/paperclip/social_stream-documents.rb
|
234
236
|
- lib/social_stream-documents.rb
|
237
|
+
- lib/social_stream/documents/dependencies.rb
|
235
238
|
- lib/social_stream/documents/engine.rb
|
236
239
|
- lib/social_stream/documents/version.rb
|
237
240
|
- lib/social_stream/migrations/documents.rb
|