eivid 1.0.11 → 1.1.3
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44d8733cec02c2d822a758903661c03b348ec6797a8cdcb817ffa4790094aeb1
|
4
|
+
data.tar.gz: b1c1b3ac06bb695ce76b72db220e18b74db69960f4ce0131d4f00289e3fc5e34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a83022e2807549aeaee50017ece932101a8d973a9a4e878b702afb762b5939a45f72479f30f6300cb38e89223f69bb2fc51a7619bc3662f7ea98c3ef6504b980
|
7
|
+
data.tar.gz: 141aa446b58902cb6c4106b3489abeaad47ac68d492651b112fa9e3463fc38082201d174b38b6161ec8e0807b8b09e51be0c5f71eb9fbfe1aefa7920c4d0f3cb
|
@@ -14,27 +14,21 @@ module Eivid::Concerns::VideoValidations
|
|
14
14
|
|
15
15
|
def validate_video_file_presence
|
16
16
|
unless params["video_file"]
|
17
|
-
|
18
|
-
"you forgot to add a required 'video_file' to your request"
|
19
|
-
)
|
17
|
+
raise_controller_error "you forgot to add a required 'video_file' to your request"
|
20
18
|
end
|
21
19
|
end
|
22
20
|
|
23
21
|
def validate_video_file_format
|
24
22
|
mime = params["video_file"]&.original_filename&.split('.')&.last&.downcase
|
25
23
|
unless Eivid::VideoMimeDump::DATA.include?(mime)
|
26
|
-
|
27
|
-
"the 'video_file' you tried to upload, is of an invalid mime type"
|
28
|
-
)
|
24
|
+
raise_controller_error "the 'video_file' you tried to upload, is of an invalid mime type"
|
29
25
|
end
|
30
26
|
end
|
31
27
|
|
32
28
|
def validate_video_file_size
|
33
29
|
megabytes = params["video_file"].tempfile.size / 1.0.megabyte
|
34
30
|
unless MAX_MB_VIDEO >= megabytes
|
35
|
-
|
36
|
-
"the 'video_file' size (#{megabytes.round(2)} mb) you tried to upload exceeds the maximum file size (#{MAX_MB_VIDEO} mb)"
|
37
|
-
)
|
31
|
+
raise_controller_error "the 'video_file' size (#{megabytes.round(2)} mb) you tried to upload exceeds the maximum file size (#{MAX_MB_VIDEO} mb)"
|
38
32
|
end
|
39
33
|
end
|
40
34
|
|
@@ -3,7 +3,7 @@ module Eivid::Concerns::MainApp::Owner
|
|
3
3
|
included do
|
4
4
|
|
5
5
|
has_one :video_owner, class_name: 'Eivid::Owner', foreign_key: 'external_id'
|
6
|
-
has_many :videos, class_name: 'Eivid::Video',
|
6
|
+
has_many :videos, class_name: 'Eivid::Video', foreign_key: 'owner_id'
|
7
7
|
|
8
8
|
include Eivid::Concerns::MainApp::VideoConcerns
|
9
9
|
|
data/lib/eivid/engine.rb
CHANGED
@@ -7,27 +7,23 @@ module Eivid
|
|
7
7
|
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
mattr_accessor :owner_model, :infer_external_owner_id, :notify_front_enabled, :notify_method_on_upload,
|
11
|
+
:notify_method_on_video_available, :notify_method_on_versions_available
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
# sets how to extract the owner_id in controller actions
|
19
|
-
self.infer_external_owner_id = "params['external_owner_id'].to_i"
|
20
|
-
|
21
|
-
# sets front end notifiers
|
22
|
-
self.notify_front_enabled = false
|
23
|
-
self.notify_method_on_upload = nil
|
24
|
-
self.notify_method_on_video_available = nil
|
25
|
-
self.notify_method_on_versions_available = nil
|
13
|
+
#sets video owner in the main app
|
14
|
+
self.owner_model = nil
|
15
|
+
|
16
|
+
# sets how to extract the owner_id in controller actions
|
17
|
+
self.infer_external_owner_id = "params['external_owner_id'].to_i"
|
26
18
|
|
27
|
-
|
28
|
-
|
29
|
-
|
19
|
+
# sets front end notifiers
|
20
|
+
self.notify_front_enabled = false
|
21
|
+
self.notify_method_on_upload = nil
|
22
|
+
self.notify_method_on_video_available = nil
|
23
|
+
self.notify_method_on_versions_available = nil
|
30
24
|
|
25
|
+
def self.set_mattr_accessors(&block)
|
26
|
+
yield self
|
31
27
|
end
|
32
28
|
|
33
29
|
end
|
data/lib/eivid/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eivid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurriaan Schrofer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '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: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httparty
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
|
-
rubygems_version: 3.
|
146
|
+
rubygems_version: 3.0.9
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: Eivid because we can.
|