carrierwave-base64 2.3.0 → 2.3.1
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/README.md +2 -3
- data/lib/carrierwave/base64/adapter.rb +2 -2
- data/lib/carrierwave/base64/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ba9627c59b10b98da78db790ba30abe072d1b13
|
4
|
+
data.tar.gz: 2cb5b80c78da40fa90cfecdb3fd855d094a16d27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd2198278a4f3594bbf9a3b33acebce05eb732f07bbab8a661e5cbc2a6d4c38474d49da6359c03c055ab11503cff3ec065fb29a400bbe238cc5c952aa7ed4f43
|
7
|
+
data.tar.gz: 2a1e980f0980a861e59a05ef72820c2c9ae12c892fc205af58fb2c5737c5ab452fd727dec7e791edc26642a5b85409057e2a258284711f8c8db3242f3c29c1e6
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/carrierwave-base64)
|
4
4
|
[](https://travis-ci.org/lebedev-yury/carrierwave-base64)
|
5
|
+
[](https://codeclimate.com/github/lebedev-yury/carrierwave-base64)
|
5
6
|
|
6
7
|
Upload files encoded as base64 to carrierwave.
|
7
8
|
|
@@ -35,14 +36,12 @@ Now you can also upload files by passing an encoded base64 string to the attribu
|
|
35
36
|
|
36
37
|
## Setting the file name
|
37
38
|
|
38
|
-
To set the file name for the uploaded files, use the `:file_name` option:
|
39
|
+
To set the file name for the uploaded files, use the `:file_name` option (without extention):
|
39
40
|
|
40
41
|
```ruby
|
41
42
|
mount_base64_uploader :image, ImageUploader, file_name: 'userpic'
|
42
43
|
```
|
43
44
|
|
44
|
-
This value will be used, when naming stored files. Extention will be taked from the base64 content-type spec.
|
45
|
-
|
46
45
|
## Data format
|
47
46
|
|
48
47
|
The string with the encoded data, should be prefixed with Data URI scheme format:
|
@@ -7,8 +7,8 @@ module Carrierwave
|
|
7
7
|
define_method "#{attribute}=" do |data|
|
8
8
|
send "#{attribute}_will_change!" if data.present?
|
9
9
|
|
10
|
-
super(data) unless data.is_a?(String) &&
|
11
|
-
|
10
|
+
return super(data) unless data.is_a?(String) &&
|
11
|
+
data.strip.start_with?('data')
|
12
12
|
|
13
13
|
super(Carrierwave::Base64::Base64StringIO.new(
|
14
14
|
data.strip, options[:file_name] || 'file'
|
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: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yury Lebedev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|