hyrax-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1af71cc4821101302f9d3ea4e22d2e484a07175
4
- data.tar.gz: ab0cdbf961034b7d5e37d77f1fa50335d851c248
3
+ metadata.gz: 34ece920ad0628dac4dc89e5036fcc9fab4456b6
4
+ data.tar.gz: 15e14410451f633c4de5153969899f75fe98fa7e
5
5
  SHA512:
6
- metadata.gz: dc3adf07cc77a543574cb40c1a3e5133c0445517abfb34d3aabdb1870b9d5159a226309097f6de8e2374d8579530c6c2b6ab1e4b4006d1db910d17a539f19e5b
7
- data.tar.gz: 31ec954ee8b310d397bba9d47986c39bb511819feff9841b3cfced1a05d0725293d7df826414547758bd18aef49281b2311ebdefce7c9bbace81a00f6830ed78
6
+ metadata.gz: 5f953f2a34f1cfe253bc82bb1e01cbddcf5a8341118aadecca634b258cdfe6fdef3adf75f4a970b5388561938f47782789b17676408eadde8a81bf1f2cf2f3dc
7
+ data.tar.gz: fe90475f0891d184bd569891d7a60abbec0b3d29fa8a36e20f0083720af2febbcd7f6dcb224d5a885891f0cd41e8e2d4dd10afde1e8c64c7958588b532851c80
data/.rubocop.yml CHANGED
@@ -25,3 +25,7 @@ Metrics/BlockLength:
25
25
  RSpec/ExampleLength:
26
26
  Exclude:
27
27
  - 'spec/services/default_option_service_spec.rb'
28
+
29
+ Style/ClassVars:
30
+ Exclude:
31
+ - 'app/services/hyrax/active_encode/active_encode_derivative_service.rb'
data/README.md CHANGED
@@ -1,2 +1,29 @@
1
1
  # hyrax-active_encode
2
- Hyrax plugin to enable audiovisual derivative generation through active_encode
2
+ Hyrax plugin to enable audiovisual derivative generation through [active_encode](https://github.com/samvera-labs/active_encode).
3
+
4
+ ## Installation
5
+
6
+ Add this line to your application's Gemfile:
7
+
8
+ ```
9
+ gem 'hyrax-active_encode'
10
+ ```
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ ## Usage
17
+
18
+ To enable derivative generation through `active_encode` run the install generator which will modify the generated `FileSet` model:
19
+
20
+ $ rails g hyrax:active_encode:install
21
+
22
+ ## Configuration
23
+
24
+ By default, hyrax-active_encode will use ActiveEncode's FFmpeg adapter and default ffmpeg options which will generate derivatives matching the defaults in Hyrax.
25
+
26
+ `Hyrax::ActiveEncode::ActiveEncodeDerivativeService` can be passed an option service which should return the output options array that will be passed to Hydra-Derivatives and then to ActiveEncode. See (https://github.com/samvera-labs/hyrax-active_encode/blob/master/app/services/hyrax/active_encode/default_option_service.rb) for the default option service.
27
+
28
+ `Hyrax::ActiveEncode::ActiveEncodeDerivativeService` can also be passed the ActiveEncode encode class to be used. By default this will be `ActiveEncode::Base`.
29
+
@@ -4,9 +4,35 @@ require 'active_encode'
4
4
  module Hyrax
5
5
  module ActiveEncode
6
6
  class ActiveEncodeDerivativeService < Hyrax::DerivativeService
7
+ class << self
8
+ def default_encode_class=(klass)
9
+ @@default_encode_class = klass
10
+ end
11
+
12
+ def default_encode_class
13
+ @@default_encode_class ||= ::ActiveEncode::Base
14
+ end
15
+
16
+ def default_options_service_class=(klass)
17
+ @@default_options_service_class = klass
18
+ end
19
+
20
+ def default_options_service_class
21
+ @@default_options_service_class ||= Hyrax::ActiveEncode::DefaultOptionService
22
+ end
23
+
24
+ def default_local_streaming=(local_streaming)
25
+ @@default_local_streaming = local_streaming
26
+ end
27
+
28
+ def default_local_streaming
29
+ @@default_local_streaming ||= true
30
+ end
31
+ end
32
+
7
33
  attr_accessor :encode_class, :options_service_class
8
34
 
9
- def initialize(file_set, encode_class: ::ActiveEncode::Base, options_service_class: DefaultOptionService, local_streaming: true)
35
+ def initialize(file_set, encode_class: self.class.default_encode_class, options_service_class: self.class.default_options_service_class, local_streaming: self.class.default_local_streaming)
10
36
  super(file_set)
11
37
  @encode_class = encode_class
12
38
  @options_service_class = options_service_class
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
3
  module ActiveEncode
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyrax-active_encode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Colvard
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2018-10-01 00:00:00.000000000 Z
15
+ date: 2018-10-09 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: active_encode