carrierwave-base64 1.5 → 1.6

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: d0fdcbb4886f4750738ce71e1d5e774db70382c7
4
- data.tar.gz: f4648e2991603ae8630e5d272f9aa96b780a511d
3
+ metadata.gz: bb68b59ec39a928ef7aeabd149732243c0ed243e
4
+ data.tar.gz: 8ac609c29884c41a84cd24a0272e9b26489c1be5
5
5
  SHA512:
6
- metadata.gz: 2b45b7dad0e513c547ccb80d4ef00a8d0839df8e2f817ac464abba078e186b3d7e546b87d273e71d52432e5b33e726e6d2bbb4d1a17d2089787c05e01845622e
7
- data.tar.gz: f847fff596536c65cf048659ab67fd77c4a99930bb4c9e30cf01d8b3789be291d7f11da05535b1132898de4bd6b23806edc00dfe52c2d09260a3fac1cf100d76
6
+ metadata.gz: 9614e1196276d13a6b1f9371681057b4672f2d6f2c21ce6c8d05bc101d08a5c88f46056b1a319fcbcb925bffabd5eaa77795185b1423b4bb0ccd8b1f8bcc48f5
7
+ data.tar.gz: 3e1cd06819917e46e223469b93532204fe4d8762a4d5a3ad41eabd3cc74d9bd6c3cbf463c32d134411e250d040dc5462d12209e4e2cf3706be46bb3e6f687e1b
@@ -23,7 +23,7 @@ module Carrierwave
23
23
  private
24
24
 
25
25
  def get_file_format(description)
26
- regex = /([a-z]+);base64\z/
26
+ regex = /([a-z0-9]+);base64\z/
27
27
  regex.match(description).try(:[], 1)
28
28
  end
29
29
  end
@@ -1,5 +1,5 @@
1
1
  module Carrierwave
2
2
  module Base64
3
- VERSION = "1.5"
3
+ VERSION = "1.6"
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@ RSpec.describe Carrierwave::Base64::Base64StringIO do
5
5
  let(:image_data) { "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABKdhH//2Q==" }
6
6
  subject { described_class.new image_data }
7
7
 
8
- it "determines the image format from the Dara URI scheme" do
8
+ it "determines the image format from the Data URI scheme" do
9
9
  expect(subject.file_format).to eql("jpg")
10
10
  end
11
11
 
@@ -18,7 +18,7 @@ RSpec.describe Carrierwave::Base64::Base64StringIO do
18
18
  let(:image_data) { "data:application/pdf;base64,/9j/4AAQSkZJRgABAQEASABKdhH//2Q==" }
19
19
  subject { described_class.new image_data }
20
20
 
21
- it "determines the image format from the Dara URI scheme" do
21
+ it "determines the image format from the Data URI scheme" do
22
22
  expect(subject.file_format).to eql("pdf")
23
23
  end
24
24
 
@@ -27,6 +27,19 @@ RSpec.describe Carrierwave::Base64::Base64StringIO do
27
27
  end
28
28
  end
29
29
 
30
+ context "correct mp3 data" do
31
+ let(:audio_data) { "data:audio/mp3;base64,/9j/4AAQSkZJRgABAQEASABKdhH//2Q==" }
32
+ subject { described_class.new audio_data }
33
+
34
+ it "determines the image format from the Data URI scheme" do
35
+ expect(subject.file_format).to eql("mp3")
36
+ end
37
+
38
+ it "should respond to :original_filename" do
39
+ expect(subject.original_filename).to eql("file.mp3")
40
+ end
41
+ end
42
+
30
43
  context "incorrect image data" do
31
44
  it "raises an ArgumentError if Data URI scheme format is missing" do
32
45
  expect do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-base64
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Lebedev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-11 00:00:00.000000000 Z
11
+ date: 2015-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave