hydra-derivatives 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6cb23951238b5918e0ea720629b80abbbf7c36f9
4
- data.tar.gz: c518b9251a6869b1f76dc6095fcaa818f447e959
3
+ metadata.gz: 7e62821ad5807bc96b9df2c9e2fda733081bb06a
4
+ data.tar.gz: c3d04f3be7dbb1241f6c51043fbca299370a255b
5
5
  SHA512:
6
- metadata.gz: fcc714f73eeda9db4e5c9d8bc3cfd62675d7f8af210abca8876d68ca9315479ff751624ac2c78c65b3314f08e1e5c369cff4c9edae21ec1c51fc20fb82ff977b
7
- data.tar.gz: 08f350ea7eb44750e37e19c1e3082badc71c01258541f3fe5533887b4718517cad0f8591f538ce54959ed543d9991509fdafbeb0d819fe2738fc6b3e092aec5b
6
+ metadata.gz: 01e2f3cfdc4a190d122219cbf16f455f50a98fa1b7eab0598350aecdd58ac3bcaa53e07d5d7b0af0845788aabd91d9025e34aa9c35c17020165f0f69c6dc6adc
7
+ data.tar.gz: 7004d501623dc2667189951292421b436d8c441b5e8373f7d393a951a793ae226a1f0f721ec8b234373044c4d8900724f1bc3012924ac14d894e14d8c0abf5af
data/History.md ADDED
@@ -0,0 +1,19 @@
1
+ ## 0.0.4 (2013-07-25)
2
+ - Handle invalid mime-type on the datastream [Justin Coyne]
3
+
4
+ ## 0.0.3 (2013-07-25)
5
+ - Added LibreOffice support [Justin Coyne]
6
+ - Updating README [Matt Zumwalt]
7
+ - explicitly testing support for using makes_derivatives with callback methods
8
+ [Matt Zumwalt]
9
+ - support both block syntax and callbacks [Matt Zumwalt]
10
+ - Break out the config [Justin Coyne]
11
+ - sample implementation of block syntax [Matt Zumwalt]
12
+
13
+ ## 0.0.2 (2013-07-24)
14
+ - Video and PDF support [Justin Coyne]
15
+ - API Change
16
+ - Video and audio processor accepts ':datastream' as an argument [Justin Coyne]
17
+
18
+ ## 0.0.1 (2013-07-23)
19
+ - initial release
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -14,8 +14,9 @@ module Hydra
14
14
 
15
15
  def to_tempfile &block
16
16
  return unless has_content?
17
- list_of_extensions = MIME::Types[mimeType].first.extensions
18
- extension = ".#{list_of_extensions.first}" if list_of_extensions
17
+ type = MIME::Types[mimeType].first
18
+ logger.warn "Unable to find a registered mime type for #{mimeType.inspect} on #{pid}" unless type
19
+ extension = type ? ".#{type.extensions.first}" : ''
19
20
 
20
21
  f = Tempfile.new(["#{pid}-#{dsVersionID}", extension])
21
22
  f.binmode
@@ -82,6 +82,18 @@ describe "Transcoder" do
82
82
  end
83
83
  end
84
84
 
85
+ describe "when the source datastrem has an unknown mime_type" do
86
+ let(:attachment) { File.open(File.expand_path('../../fixtures/piano_note.wav', __FILE__))}
87
+ let(:file) { GenericFile.new(mime_type: 'audio/wav').tap { |t| t.content.content = attachment; t.content.mimeType = 'audio/vnd.wav'; t.save } }
88
+
89
+ it "should transcode" do
90
+ expect(logger).to receive(:warn).with("Unable to find a registered mime type for \"audio/vnd.wav\" on #{file.pid}").twice
91
+ file.create_derivatives
92
+ file.datastreams['content_mp3'].should have_content
93
+ file.datastreams['content_mp3'].mimeType.should == 'audio/mpeg'
94
+ end
95
+ end
96
+
85
97
  describe "with an attached video", unless: ENV['TRAVIS'] == 'true' do
86
98
  let(:attachment) { File.open(File.expand_path('../../fixtures/countdown.avi', __FILE__))}
87
99
  let(:file) { GenericFile.new(mime_type: 'video/avi').tap { |t| t.content.content = attachment; t.save } }
@@ -108,6 +120,7 @@ describe "Transcoder" do
108
120
  end
109
121
  end
110
122
 
123
+
111
124
  describe "with an attached Powerpoint", unless: ENV['TRAVIS'] == 'true' do
112
125
  let(:attachment) { File.open(File.expand_path('../../fixtures/FlashPix.ppt', __FILE__))}
113
126
  let(:file) { GenericFile.new(mime_type: 'application/vnd.ms-powerpoint').tap { |t| t.content.content = attachment; t.save } }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-derivatives
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -126,6 +126,7 @@ files:
126
126
  - .travis.yml
127
127
  - CONTRIBUTING.md
128
128
  - Gemfile
129
+ - History.md
129
130
  - LICENSE.txt
130
131
  - README.md
131
132
  - Rakefile