carrierwave-audio 1.0.5 → 1.0.6
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/carrierwave/audio.rb +4 -4
- data/lib/carrierwave/audio/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc52f0f740d2c0e991b05cd320ae11ecd943c989
|
4
|
+
data.tar.gz: efa91bef6f74e088b95f56cef3f9651e46cf521c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcf72a9e54478c4b81a16efd96695324191c14df2b9ad0127d579cbb054b98a815347137ebfa421900cb987ad107e9462d99b3873b33a6d9cfe0bb6a1b5de4c0
|
7
|
+
data.tar.gz: a60c7674dd03e62b1c1894bbc5a7e9b533c21e775ba949111918661ae7015328f7b14398e44dee963276ca52c2d29d44510ebe86e03e2f2b52e690143c26ea22
|
data/lib/carrierwave/audio.rb
CHANGED
@@ -21,7 +21,7 @@ module CarrierWave
|
|
21
21
|
audio_filename = Processor.convert(current_path, options)
|
22
22
|
extension = File.extname(audio_filename).gsub(/\./, '')
|
23
23
|
File.rename audio_filename, current_path
|
24
|
-
|
24
|
+
self.file.instance_variable_set(:@content_type, content_type_for_extension(extension))
|
25
25
|
end
|
26
26
|
|
27
27
|
def watermark options={}
|
@@ -30,15 +30,15 @@ module CarrierWave
|
|
30
30
|
audio_filename = Processor.watermark(current_path, options)
|
31
31
|
extension = File.extname(audio_filename).gsub(/\./, '')
|
32
32
|
File.rename audio_filename, current_path
|
33
|
-
|
33
|
+
self.file.instance_variable_set(:@content_type, content_type_for_extension(extension))
|
34
34
|
end
|
35
35
|
|
36
36
|
private
|
37
37
|
|
38
|
-
def
|
38
|
+
def content_type_for_extension extension
|
39
39
|
case extension.to_sym
|
40
40
|
when :mp3
|
41
|
-
|
41
|
+
"audio/mpeg3"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|