shrine-transloadit 0.5.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +532 -329
- data/lib/shrine/plugins/transloadit.rb +169 -324
- data/shrine-transloadit.gemspec +5 -7
- metadata +17 -47
- data/lib/shrine/plugins/transloadit2.rb +0 -48
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shrine-transloadit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shrine
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: transloadit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,64 +66,36 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: minitest-hooks
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: dotenv
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
69
|
- !ruby/object:Gem::Dependency
|
98
70
|
name: aws-sdk-s3
|
99
71
|
requirement: !ruby/object:Gem::Requirement
|
100
72
|
requirements:
|
101
73
|
- - "~>"
|
102
74
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
75
|
+
version: '1.14'
|
104
76
|
type: :development
|
105
77
|
prerelease: false
|
106
78
|
version_requirements: !ruby/object:Gem::Requirement
|
107
79
|
requirements:
|
108
80
|
- - "~>"
|
109
81
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
82
|
+
version: '1.14'
|
111
83
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
84
|
+
name: shrine-url
|
113
85
|
requirement: !ruby/object:Gem::Requirement
|
114
86
|
requirements:
|
115
|
-
- - "
|
87
|
+
- - "~>"
|
116
88
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
89
|
+
version: '2.4'
|
118
90
|
type: :development
|
119
91
|
prerelease: false
|
120
92
|
version_requirements: !ruby/object:Gem::Requirement
|
121
93
|
requirements:
|
122
|
-
- - "
|
94
|
+
- - "~>"
|
123
95
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
96
|
+
version: '2.4'
|
125
97
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
98
|
+
name: dry-monitor
|
127
99
|
requirement: !ruby/object:Gem::Requirement
|
128
100
|
requirements:
|
129
101
|
- - ">="
|
@@ -136,7 +108,7 @@ dependencies:
|
|
136
108
|
- - ">="
|
137
109
|
- !ruby/object:Gem::Version
|
138
110
|
version: '0'
|
139
|
-
description:
|
111
|
+
description:
|
140
112
|
email:
|
141
113
|
- janko.marohnic@gmail.com
|
142
114
|
executables: []
|
@@ -146,13 +118,12 @@ files:
|
|
146
118
|
- LICENSE.txt
|
147
119
|
- README.md
|
148
120
|
- lib/shrine/plugins/transloadit.rb
|
149
|
-
- lib/shrine/plugins/transloadit2.rb
|
150
121
|
- shrine-transloadit.gemspec
|
151
122
|
homepage: https://github.com/shrinerb/shrine-transloadit
|
152
123
|
licenses:
|
153
124
|
- MIT
|
154
125
|
metadata: {}
|
155
|
-
post_install_message:
|
126
|
+
post_install_message:
|
156
127
|
rdoc_options: []
|
157
128
|
require_paths:
|
158
129
|
- lib
|
@@ -167,9 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
138
|
- !ruby/object:Gem::Version
|
168
139
|
version: '0'
|
169
140
|
requirements: []
|
170
|
-
|
171
|
-
|
172
|
-
signing_key:
|
141
|
+
rubygems_version: 3.2.15
|
142
|
+
signing_key:
|
173
143
|
specification_version: 4
|
174
144
|
summary: Provides Transloadit integration for Shrine.
|
175
145
|
test_files: []
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require "transloadit"
|
2
|
-
|
3
|
-
require "uri"
|
4
|
-
require "json"
|
5
|
-
require "openssl"
|
6
|
-
|
7
|
-
class Shrine
|
8
|
-
module Plugins
|
9
|
-
module Transloadit2
|
10
|
-
class Error < Shrine::Error; end
|
11
|
-
|
12
|
-
class ResponseError < Error
|
13
|
-
attr_reader :response
|
14
|
-
|
15
|
-
def initialize(response)
|
16
|
-
@response = response
|
17
|
-
super("#{response["error"]}: #{response["reason"] || response["message"]} (Assembly ID: #{response["assembly_id"]})")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# Accepts Transloadit credentials via `:auth_key` and `:auth_secret`.
|
22
|
-
#
|
23
|
-
# If :cache storage wasn't assigned, it will be assigned to a URL storage
|
24
|
-
# for direct uploads.
|
25
|
-
#
|
26
|
-
# If promoting was not yet overriden, it is set to automatically trigger
|
27
|
-
# Transloadit processing defined in `Shrine#transloadit_process`.
|
28
|
-
def self.configure(uploader, opts = {})
|
29
|
-
uploader.opts[:transloadit_auth_key] = opts.fetch(:auth_key, uploader.opts[:transloadit_auth_key])
|
30
|
-
uploader.opts[:transloadit_auth_secret] = opts.fetch(:auth_secret, uploader.opts[:transloadit_auth_secret])
|
31
|
-
|
32
|
-
raise Error, "The :auth_key is required for transloadit plugin" if uploader.opts[:transloadit_auth_key].nil?
|
33
|
-
raise Error, "The :auth_secret is required for transloadit plugin" if uploader.opts[:transloadit_auth_secret].nil?
|
34
|
-
|
35
|
-
uploader.opts[:backgrounding_promote] ||= proc { transloadit_process }
|
36
|
-
end
|
37
|
-
|
38
|
-
# Load the backgrounding plugin to override promoting, and load the
|
39
|
-
# versions plugin to automatically save steps.
|
40
|
-
def self.load_dependencies(uploader, opts = {})
|
41
|
-
uploader.plugin :backgrounding
|
42
|
-
uploader.plugin :versions
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
register_plugin(:transloadit2, Transloadit2)
|
47
|
-
end
|
48
|
-
end
|