audio_monster 1.2.1 → 1.2.2
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 +4 -4
- data/lib/audio_monster/monster.rb +3 -1
- data/lib/audio_monster/version.rb +1 -1
- data/test/files/an_mp3_no_ext +0 -0
- data/test/monster_test.rb +7 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7c92ac960f1dbaa911fda7b6cff6dbba6cb9b63
|
4
|
+
data.tar.gz: b8d9f1080457429061f4017769c2dee0a0260292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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)
|
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.
|
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
|