hydra-derivatives 1.1.0 → 1.2.0

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: 14f09b6670a1ef6add67ed44818c17c7cf8c36b1
4
- data.tar.gz: 408048906e8ab82bccb72a05c9849826cc09c742
3
+ metadata.gz: fc081eda663412c44512d4b336226d4c88c08662
4
+ data.tar.gz: 415d09b21e47399744d0a0b36fe9a0bab8459f8d
5
5
  SHA512:
6
- metadata.gz: 0d97b2c7b9cff0b1e09f0394feef16e136808cb840b50ff48bb40b6ed8e24903862a88e99b5f054f24fb80a4789a0bce5251cb02c3f942010311ab7ba24f32c9
7
- data.tar.gz: 4afab72548ce8ba1524b9d957cd08574d1a543a6a0741ebc9e2ade3dc6675d731b7f7286d479d6b9920ed157e7a0bfc38d8a68e9a51f7cab6d403c378e679cd4
6
+ metadata.gz: 3e413c0dfa5b730da9e0baf62cc52093ad495f5da10baf19da2ece4bcdad2c35c910cd8888b5254b6045bcad491d198246a638c23aec59a3786c27fe4469acba
7
+ data.tar.gz: 89b012cb0cd07053335c9f70b464d7a3cf8cac855e27afcafddbb41c7868e7a98e2f37d618ae24fa1e70066fcaef81e09488d0fdb12a887f4099f68378bd92af
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -91,10 +91,16 @@ module Hydra
91
91
  when :video
92
92
  Hydra::Derivatives::Video::Processor
93
93
  else
94
- "Hydra::Derivatives::#{processor.to_s.classify}".constantize
94
+ constantize_processor(processor.to_s)
95
95
  end
96
96
  end
97
97
 
98
+ def constantize_processor(processor)
99
+ "Hydra::Derivatives::#{processor.classify}".constantize
100
+ rescue NameError
101
+ processor.classify.constantize
102
+ end
103
+
98
104
  def transform_datastream(file_name, transform_directives, opts={})
99
105
  transform_file(file_name, transform_directives, opts={})
100
106
  end
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ describe Hydra::Derivatives do
4
+
5
+ before(:all) do
6
+ class CustomFile < ActiveFedora::Base
7
+ include Hydra::Derivatives
8
+ end
9
+ class CustomProcessor < Hydra::Derivatives::Processor
10
+ end
11
+ end
12
+
13
+ after(:all) do
14
+ Object.send(:remove_const, :CustomFile)
15
+ Object.send(:remove_const, :CustomProcessor)
16
+ end
17
+
18
+ context "when using an included processor" do
19
+ subject { CustomFile.new.processor_class(:image) }
20
+ it { is_expected.to eql Hydra::Derivatives::Image }
21
+ end
22
+
23
+ context "when using the video processor" do
24
+ subject { CustomFile.new.processor_class(:video) }
25
+ it { is_expected.to eql Hydra::Derivatives::Video::Processor }
26
+ end
27
+
28
+ context "when using the video processor" do
29
+ subject { CustomFile.new.processor_class("CustomProcessor") }
30
+ it { is_expected.to eql CustomProcessor }
31
+ end
32
+
33
+ context "when using a fake processor" do
34
+ it "raises an error" do
35
+ expect( lambda{ CustomFile.new.processor_class("BogusProcessor") }).to raise_error(NameError)
36
+ end
37
+ end
38
+
39
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-derivatives
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-27 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -210,6 +210,7 @@ files:
210
210
  - spec/lib/hydra/derivatives/extract_metadata_spec.rb
211
211
  - spec/spec_helper.rb
212
212
  - spec/units/config_spec.rb
213
+ - spec/units/derivatives_spec.rb
213
214
  - spec/units/extract_spec.rb
214
215
  - spec/units/image_spec.rb
215
216
  - spec/units/jpeg2k_spec.rb
@@ -237,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
238
  version: '0'
238
239
  requirements: []
239
240
  rubyforge_project:
240
- rubygems_version: 2.4.6
241
+ rubygems_version: 2.5.1
241
242
  signing_key:
242
243
  specification_version: 4
243
244
  summary: Derivative generation plugin for hydra
@@ -259,6 +260,7 @@ test_files:
259
260
  - spec/lib/hydra/derivatives/extract_metadata_spec.rb
260
261
  - spec/spec_helper.rb
261
262
  - spec/units/config_spec.rb
263
+ - spec/units/derivatives_spec.rb
262
264
  - spec/units/extract_spec.rb
263
265
  - spec/units/image_spec.rb
264
266
  - spec/units/jpeg2k_spec.rb
@@ -266,3 +268,4 @@ test_files:
266
268
  - spec/units/shell_based_processor_spec.rb
267
269
  - spec/units/transcoding_spec.rb
268
270
  - spec/units/video_spec.rb
271
+ has_rdoc: