paperclip_s3du 0.0.1 → 0.0.2
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.
- data/.gitignore +1 -0
- data/lib/paperclip_s3du/railtie.rb +22 -0
- data/lib/paperclip_s3du.rb +1 -1
- data/paperclip_s3du.gemspec +2 -2
- metadata +3 -3
- data/lib/paperclip_s3du/application_controller.rb +0 -14
data/.gitignore
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Paperclip
|
2
|
+
module S3DU
|
3
|
+
class Railtie < Rails::Railtie
|
4
|
+
initializer "paperclip_s3du.action_controller" do
|
5
|
+
ActiveSupport.on_load(:action_controller) do
|
6
|
+
def self.paperclip_s3_direct_upload_for object, options = {}
|
7
|
+
only = options[:only] || [:create, :update]
|
8
|
+
|
9
|
+
before_filter :only => only do |controller|
|
10
|
+
param = options[:param] || :file
|
11
|
+
property = options[:property] || param
|
12
|
+
|
13
|
+
if params.has_key? param
|
14
|
+
params[object][property] = Paperclip::S3DU::S3DirectUpload.new params[param]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/paperclip_s3du.rb
CHANGED
data/paperclip_s3du.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'paperclip_s3du'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.date = '2013-03-
|
3
|
+
s.version = '0.0.2'
|
4
|
+
s.date = '2013-03-09'
|
5
5
|
s.summary = "Already-uploaded Paperclip"
|
6
6
|
s.description = "Paperclip support for already-uploaded-in-s3 files."
|
7
7
|
s.authors = ["Guilherme Vieira"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip_s3du
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: paperclip
|
@@ -36,7 +36,7 @@ files:
|
|
36
36
|
- .gitignore
|
37
37
|
- README.md
|
38
38
|
- lib/paperclip_s3du.rb
|
39
|
-
- lib/paperclip_s3du/
|
39
|
+
- lib/paperclip_s3du/railtie.rb
|
40
40
|
- lib/paperclip_s3du/s3_direct_upload.rb
|
41
41
|
- lib/paperclip_s3du/s3_direct_upload_adapter.rb
|
42
42
|
- lib/paperclip_s3du/s3du.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class ApplicationController < ActionController::Base
|
2
|
-
def self.paperclip_s3_direct_upload_for object, options = {}
|
3
|
-
only = options[:only] || [:create, :update]
|
4
|
-
|
5
|
-
before_filter :only => only do |controller|
|
6
|
-
param = options[:param] || :file
|
7
|
-
property = options[:property] || param
|
8
|
-
|
9
|
-
if params.has_key? param
|
10
|
-
params[object][property] = Paperclip::S3DU::S3DirectUpload.new params[param]
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|