social_stream-documents 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 122b8599155e8c5a2839f73929d5c3561d2fc722
4
- data.tar.gz: 59a7f2110a4b2cd8e1bf1490d7f35c7bd6ac5e27
3
+ metadata.gz: b15ae90bffda5285fb9573d5d76e62ef6ba2441f
4
+ data.tar.gz: 892664124cff22b542dad9ab38875a68e7290c1c
5
5
  SHA512:
6
- metadata.gz: 41947050825288120acf25833c1b68c1a1f58a4183fc9f9c4f31d824df8e80fabb91f491034ecaf09d448a59f1fc41fdd857a4e004bc1b4fb2b275cd0c915f63
7
- data.tar.gz: b35de43746c5c2ac7f05ae96ad41620766e8f30bcbe24019a0792118c6c73420a0d74611b4a1c436c0829decd8f0abae74d6c7123e79dbf04b2b7e4afc451a5e
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 show
47
- respond_to do |format|
48
- format.html {render :action => :show}
49
- format.json {render :json => resource }
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
 
@@ -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 = nil)
66
- {:id => id,
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
 
@@ -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
- {:id => id,
20
- :title => title,
21
- :description => description,
22
- :author => author.name,
23
- :poster => file(:poster).to_s,
24
- :sources => [ { :type => Mime::WEBM.to_s, :src => file(:webm).to_s },
25
- { :type => Mime::MP4.to_s, :src => file(:mp4).to_s },
26
- { :type => Mime::FLV.to_s, :src => file(:flv).to_s }
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
 
@@ -5,7 +5,7 @@
5
5
  <%= t('audio.processing')%>
6
6
  </div>
7
7
  <% else %>
8
- <%= render partial: 'player',
8
+ <%= render partial: 'audios/player',
9
9
  object: audio,
10
10
  as: :audio %>
11
11
  <% end %>
@@ -4,7 +4,7 @@
4
4
  <%= t('video.processing')%>
5
5
  </div>
6
6
  <% else %>
7
- <%= render partial: 'player',
7
+ <%= render partial: 'videos/player',
8
8
  object: video,
9
9
  as: :video %>
10
10
  <% end %>
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Documents
3
- VERSION = "2.2.0".freeze
3
+ VERSION = "2.2.1".freeze
4
4
  end
5
5
  end
@@ -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.0')
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.0
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-08-01 00:00:00.000000000 Z
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.0
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.0
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: []