active_encode 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -3
- data/Gemfile +2 -2
- data/active_encode.gemspec +3 -2
- data/lib/active_encode/base.rb +2 -0
- data/lib/active_encode/core.rb +1 -0
- data/lib/active_encode/engine_adapter.rb +1 -1
- data/lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb +1 -1
- data/lib/active_encode/engine_adapters/matterhorn_adapter.rb +1 -1
- data/lib/active_encode/engine_adapters/zencoder_adapter.rb +2 -2
- data/lib/active_encode/version.rb +1 -1
- data/spec/units/core_spec.rb +9 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4cc9a23af554f70fe254b6c08dd9422e0799c5e
|
4
|
+
data.tar.gz: 7c4ba992d65bd57c36767cbcd386b35a645a0b8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07f0ac6c7f1f0bd3a794ca21ae31ecacd311dbd2cba15b6e878706fe6c7a11b4c481fd538391d8564b28f4de37bc5d4ff91dd14125f64b642f2b4e166b721d9d
|
7
|
+
data.tar.gz: 5fd817093bab2eb625ac4098f256fb4597ac316b8d747fb003e64f7aeafc6faa2f79d74c50c5692bcb611339dc9d605b646286bd3c8bb6fbbe465d9124b850dd
|
data/.rubocop.yml
CHANGED
@@ -29,9 +29,6 @@ Metrics/CyclomaticComplexity:
|
|
29
29
|
Exclude:
|
30
30
|
- 'lib/active_encode/engine_adapters/*'
|
31
31
|
|
32
|
-
Style/FileName:
|
33
|
-
Exclude:
|
34
|
-
|
35
32
|
Style/IndentationConsistency:
|
36
33
|
EnforcedStyle: rails
|
37
34
|
|
@@ -43,6 +40,10 @@ Style/CollectionMethods:
|
|
43
40
|
detect: 'find'
|
44
41
|
find_all: 'select'
|
45
42
|
|
43
|
+
Style/FileName: # https://github.com/bbatsov/rubocop/issues/2973
|
44
|
+
Exclude:
|
45
|
+
- 'Gemfile'
|
46
|
+
|
46
47
|
Style/WordArray:
|
47
48
|
Enabled: false
|
48
49
|
|
data/Gemfile
CHANGED
@@ -3,10 +3,10 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in hydra-transcoder.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
gem 'aws-sdk'
|
6
7
|
gem 'byebug'
|
7
8
|
gem 'rubocop', require: false
|
8
9
|
gem 'rubocop-rspec', require: false
|
9
10
|
gem 'rubyhorn', git: "https://github.com/avalonmediasystem/rubyhorn.git"
|
10
|
-
gem 'zencoder'
|
11
11
|
gem 'shingoncoder'
|
12
|
-
gem '
|
12
|
+
gem 'zencoder'
|
data/active_encode.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'active_encode/version'
|
@@ -8,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
8
9
|
spec.version = ActiveEncode::VERSION
|
9
10
|
spec.authors = ["Michael Klein, Chris Colvard"]
|
10
11
|
spec.email = ["mbklein@gmail.com, chris.colvard@gmail.com"]
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
12
|
+
spec.summary = 'Declare encode job classes that can be run by a variety of encoding services'
|
13
|
+
spec.description = 'This gem serves as the basis for the interface between a Ruby (Rails) application and a provider of transcoding services such as Opencast Matterhorn, Zencoder, and Amazon Elastic Transcoder.'
|
13
14
|
spec.homepage = ""
|
14
15
|
spec.license = "MIT"
|
15
16
|
|
data/lib/active_encode/base.rb
CHANGED
data/lib/active_encode/core.rb
CHANGED
@@ -38,7 +38,7 @@ module ActiveEncode
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
ENGINE_ADAPTER_METHODS = [
|
41
|
+
ENGINE_ADAPTER_METHODS = %i[create find list cancel purge remove_output].freeze
|
42
42
|
|
43
43
|
def engine_adapter?(object)
|
44
44
|
ENGINE_ADAPTER_METHODS.all? { |meth| object.respond_to?(meth) }
|
@@ -127,7 +127,7 @@ module ActiveEncode
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def convert_tech_metadata(props)
|
130
|
-
return {} if props.
|
130
|
+
return {} if props.blank?
|
131
131
|
metadata_fields = {
|
132
132
|
file_size: { key: :file_size, method: :itself },
|
133
133
|
duration_millis: { key: :duration, method: :to_s },
|
@@ -291,7 +291,7 @@ module ActiveEncode
|
|
291
291
|
|
292
292
|
class MatterhornRtmpUrl
|
293
293
|
class_attribute :members
|
294
|
-
self.members = [
|
294
|
+
self.members = %i[application prefix media_id stream_id filename extension]
|
295
295
|
attr_accessor(*members)
|
296
296
|
REGEX = %r{^
|
297
297
|
/(?<application>.+) # application (avalon)
|
@@ -103,8 +103,8 @@ module ActiveEncode
|
|
103
103
|
def convert_errors(job_details)
|
104
104
|
errors = []
|
105
105
|
input_error = job_details.body["job"]["input_media_file"]["error_message"]
|
106
|
-
errors << input_error
|
107
|
-
job_details.body["job"]["output_media_files"].each { |o| errors << o["error_message"]
|
106
|
+
errors << input_error if input_error.present?
|
107
|
+
job_details.body["job"]["output_media_files"].each { |o| errors << o["error_message"] if o["error_message"].present? }
|
108
108
|
errors
|
109
109
|
end
|
110
110
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_encode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Klein, Chris Colvard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -169,6 +169,7 @@ files:
|
|
169
169
|
- spec/integration/zencoder_adapter_spec.rb
|
170
170
|
- spec/spec_helper.rb
|
171
171
|
- spec/units/callbacks_spec.rb
|
172
|
+
- spec/units/core_spec.rb
|
172
173
|
- spec/units/engine_adapter_spec.rb
|
173
174
|
- spec/units/status_spec.rb
|
174
175
|
homepage: ''
|
@@ -236,5 +237,6 @@ test_files:
|
|
236
237
|
- spec/integration/zencoder_adapter_spec.rb
|
237
238
|
- spec/spec_helper.rb
|
238
239
|
- spec/units/callbacks_spec.rb
|
240
|
+
- spec/units/core_spec.rb
|
239
241
|
- spec/units/engine_adapter_spec.rb
|
240
242
|
- spec/units/status_spec.rb
|