audio_monster 1.2.1 → 1.2.2

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: 4381409b28c95625a20cf1c8268cfd848c702a51
4
- data.tar.gz: 01e78e0d037c96af6437526888ec645b33484a73
3
+ metadata.gz: e7c92ac960f1dbaa911fda7b6cff6dbba6cb9b63
4
+ data.tar.gz: b8d9f1080457429061f4017769c2dee0a0260292
5
5
  SHA512:
6
- metadata.gz: 74d9fee35c7054c62b1392c8930ef0657d3b0848baf91b83e4859d8548816b0beccaaf853e01527c5a4229780873d5a3aeea1271c30ec91a043cc6dab770437f
7
- data.tar.gz: 9bfb0af609185bc6ed874715f2c5c79882851143f98d7b6281e66a769a9b07ee13cc2d13c1c9f561b55c7deadac5c27f4fb501070a7cfbfbd8b95f098c72d2f0
6
+ metadata.gz: 24c76614b6af46ff2a4f4fede4c595ff5e1ad83ccacb7354b6cf02a6740fe3812367e1b667e673608f9e91bc5e8b1bde298c85cae78aaa010746e24fe0272813
7
+ data.tar.gz: 419a4ed5a09488dd3dcbde03ad600af44e95f21ca5cc5bfa1d9c29d723bb658f035fbc9679a2287a5534751c39d8d7cf7ae60f90c8207be5d236c34d7b47831b
@@ -276,7 +276,9 @@ module AudioMonster
276
276
  alias info_for_mp3 info_for_mpeg
277
277
 
278
278
  def content_type(path)
279
- mime_magic_content_type(path) || file_content_type(path)
279
+ ct = mime_magic_content_type(path)
280
+ ct = file_content_type(path) if (ct.nil? || ct.length == 0)
281
+ ct
280
282
  end
281
283
 
282
284
  def mime_magic_content_type(path)
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module AudioMonster
4
- VERSION = '1.2.1'
4
+ VERSION = '1.2.2'
5
5
  end
Binary file
data/test/monster_test.rb CHANGED
@@ -129,6 +129,13 @@ describe AudioMonster::Monster do
129
129
  File.extname(file.path).must_equal '.exten'
130
130
  end
131
131
 
132
+
133
+ it 'can get the format of a file with no extension' do
134
+ monster.file_content_type(in_file('an_mp3_no_ext')).must_equal 'audio/mpeg'
135
+ monster.content_type(in_file('an_mp3_no_ext')).must_equal 'audio/mpeg'
136
+ end
137
+
138
+
132
139
  describe 'test audio file info' do
133
140
  let(:audio_files) do
134
141
  {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audio_monster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kuklewicz
@@ -141,6 +141,7 @@ files:
141
141
  - lib/audio_monster/monster.rb
142
142
  - lib/audio_monster/version.rb
143
143
  - test/audio_monster_test.rb
144
+ - test/files/an_mp3_no_ext
144
145
  - test/files/test.flac
145
146
  - test/files/test.gif
146
147
  - test/files/test.jpg
@@ -182,6 +183,7 @@ specification_version: 4
182
183
  summary: audio_monster manipulates and transcodes audio
183
184
  test_files:
184
185
  - test/audio_monster_test.rb
186
+ - test/files/an_mp3_no_ext
185
187
  - test/files/test.flac
186
188
  - test/files/test.gif
187
189
  - test/files/test.jpg