social_stream-documents 2.2.0 → 2.2.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.
- checksums.yaml +4 -4
- data/app/controllers/documents_controller.rb +26 -16
- data/app/models/document.rb +4 -3
- data/app/models/video.rb +11 -9
- data/app/views/audios/_audio_show.html.erb +1 -1
- data/app/views/videos/_video_show.html.erb +1 -1
- data/lib/social_stream/documents/version.rb +1 -1
- data/social_stream-documents.gemspec +2 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b15ae90bffda5285fb9573d5d76e62ef6ba2441f
|
4
|
+
data.tar.gz: 892664124cff22b542dad9ab38875a68e7290c1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b28c05002fca0ec4902fb63aa3dd66aa542264ecc339e4769e2c82c57e47f812a9c05bbdffc664fd09a7c87b662c0fd0d68dab8d01ba6edf4eb13467fe5cbe6
|
7
|
+
data.tar.gz: c96144ed8b81b713e8309f850d001106263160e42abe0215eefae47434420fccba554ca2c14f318e40f8db53e03ba8deac011e003b9b5dc91d43613c3a54f3c0
|
@@ -11,13 +11,30 @@ class DocumentsController < ApplicationController
|
|
11
11
|
render collection if request.xhr?
|
12
12
|
}
|
13
13
|
|
14
|
-
format.json { render :json => collection }
|
14
|
+
format.json { render :json => collection.to_json(helper: self) }
|
15
15
|
end
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
|
+
def show
|
19
|
+
respond_to do |format|
|
20
|
+
format.html {render :action => :show}
|
21
|
+
format.json {render :json => resource.to_json(helper: self) }
|
22
|
+
format.any {
|
23
|
+
path = resource.file.path(params[:style] || params[:format])
|
24
|
+
|
25
|
+
head(:not_found) and return unless File.exist?(path)
|
26
|
+
|
27
|
+
send_file path,
|
28
|
+
:filename => resource.file_file_name,
|
29
|
+
:disposition => "inline",
|
30
|
+
:type => request.format
|
31
|
+
}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
18
35
|
def create
|
19
36
|
super do |format|
|
20
|
-
format.json { render :json => resource }
|
37
|
+
format.json { render :json => resource.to_json(helper: self) }
|
21
38
|
format.js
|
22
39
|
format.all {
|
23
40
|
if resource.new_record?
|
@@ -43,20 +60,13 @@ class DocumentsController < ApplicationController
|
|
43
60
|
end
|
44
61
|
end
|
45
62
|
|
46
|
-
def
|
47
|
-
|
48
|
-
format.html {
|
49
|
-
|
50
|
-
format.any {
|
51
|
-
path = resource.file.path(params[:style] || params[:format])
|
52
|
-
|
53
|
-
head(:not_found) and return unless File.exist?(path)
|
54
|
-
|
55
|
-
send_file path,
|
56
|
-
:filename => resource.file_file_name,
|
57
|
-
:disposition => "inline",
|
58
|
-
:type => request.format
|
63
|
+
def destroy
|
64
|
+
super do |format|
|
65
|
+
format.html {
|
66
|
+
redirect_to :home
|
59
67
|
}
|
68
|
+
|
69
|
+
format.js
|
60
70
|
end
|
61
71
|
end
|
62
72
|
|
data/app/models/document.rb
CHANGED
@@ -62,12 +62,13 @@ class Document < ActiveRecord::Base
|
|
62
62
|
end
|
63
63
|
|
64
64
|
# JSON, generic version for most documents
|
65
|
-
def as_json(options
|
66
|
-
{
|
65
|
+
def as_json(options)
|
66
|
+
{
|
67
|
+
:id => id,
|
67
68
|
:title => title,
|
68
69
|
:description => description,
|
69
70
|
:author => author.name,
|
70
|
-
:src => file.to_s
|
71
|
+
:src => URI.join(options[:helper].root_url, file.url).to_s
|
71
72
|
}
|
72
73
|
end
|
73
74
|
|
data/app/models/video.rb
CHANGED
@@ -16,15 +16,17 @@ class Video < Document
|
|
16
16
|
|
17
17
|
# JSON, special edition for video files
|
18
18
|
def as_json(options = nil)
|
19
|
-
{
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
{
|
20
|
+
:id => id,
|
21
|
+
:title => title,
|
22
|
+
:description => description,
|
23
|
+
:author => author.name,
|
24
|
+
:poster => URI.join(options[:helper].root_url, file.url(:poster)).to_s,
|
25
|
+
:sources => [
|
26
|
+
{ type: Mime::WEBM.to_s, src: URI.join(options[:helper].root_url, file.url(:webm)).to_s },
|
27
|
+
{ type: Mime::MP4.to_s, src: URI.join(options[:helper].root_url, file.url(:mp4)).to_s },
|
28
|
+
{ type: Mime::FLV.to_s, src: URI.join(options[:helper].root_url, file.url(:flv)).to_s }
|
29
|
+
]
|
28
30
|
}
|
29
31
|
end
|
30
32
|
|
@@ -10,9 +10,10 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = "social-stream@dit.upm.es"
|
11
11
|
s.homepage = "http://github.com/ging/social_stream-documents"
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
|
+
s.license = 'MIT'
|
13
14
|
|
14
15
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 2.2.
|
16
|
+
s.add_runtime_dependency('social_stream-base', '~> 2.2.2')
|
16
17
|
|
17
18
|
s.add_runtime_dependency('paperclip','~> 3.5.1')
|
18
19
|
s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.11.0')
|
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: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Víctor Sánchez Belmar
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: social_stream-base
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 2.2.
|
20
|
+
version: 2.2.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 2.2.
|
27
|
+
version: 2.2.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: paperclip
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -229,7 +229,8 @@ files:
|
|
229
229
|
- vendor/assets/stylesheets/pbar-ani.gif
|
230
230
|
- vendor/assets/swf/Jplayer.swf
|
231
231
|
homepage: http://github.com/ging/social_stream-documents
|
232
|
-
licenses:
|
232
|
+
licenses:
|
233
|
+
- MIT
|
233
234
|
metadata: {}
|
234
235
|
post_install_message:
|
235
236
|
rdoc_options: []
|