carrierwave-base64 2.8.1 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -0
- data/.travis.yml +8 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -2
- data/carrierwave-base64.gemspec +2 -2
- data/lib/carrierwave/base64/base64_string_io.rb +2 -3
- data/lib/carrierwave/base64/railtie.rb +1 -2
- data/lib/carrierwave/base64/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3af16036cb1f1a6f3ae6ffce52db973a32c09c76287cde31036bed14b9989d3f
|
4
|
+
data.tar.gz: 62500de72742bb64cae9f3839124892f33463044c554f245b256868262c64e5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7e8b717582744821f8bd91437ced8f9fe7e794c6c9821e613a3b1c4eb4f33f5e4774b15428a74ddf8e1080143a9444b958776e7c8c156c2004bb97767e84e60
|
7
|
+
data.tar.gz: aad329e8d107294400e2ea177cd6d7ef4e40751b6bf57fa4987782705d4c9f30ba0f013df1e24e73f96af27ec98a90189f4207f1fbc6eec79726012bc7a19bad
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
3
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
- 2.
|
4
|
+
- 2.4.9
|
5
|
+
- 2.5.7
|
6
|
+
- 2.6.5
|
7
|
+
- 2.7.0
|
8
8
|
- ruby-head
|
9
9
|
- jruby-head
|
10
10
|
|
@@ -18,6 +18,10 @@ gemfile:
|
|
18
18
|
|
19
19
|
sudo: false
|
20
20
|
|
21
|
+
before_install:
|
22
|
+
- gem update --system
|
23
|
+
- gem update bundler
|
24
|
+
|
21
25
|
script:
|
22
26
|
- bundle exec rspec
|
23
27
|
- bundle exec rubocop
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/carrierwave-base64.svg)](http://badge.fury.io/rb/carrierwave-base64)
|
4
4
|
[![Build Status](https://travis-ci.org/y9v/carrierwave-base64.svg?branch=master)](https://travis-ci.org/y9v/carrierwave-base64)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/y9v/carrierwave-base64/badges/gpa.svg)](https://codeclimate.com/github/y9v/carrierwave-base64)
|
6
|
-
[![Inch CI](https://inch-ci.org/github/y9v/carrierwave-base64.svg?branch=master)](https://inch-ci.org/github/y9v/carrierwave-base64)
|
7
6
|
|
8
7
|
Upload files encoded as base64 to carrierwave.
|
9
8
|
|
@@ -33,7 +32,7 @@ Mount the uploader to your model:
|
|
33
32
|
mount_base64_uploader :image, ImageUploader
|
34
33
|
```
|
35
34
|
|
36
|
-
Now you can also upload files by passing an encoded base64 string to the attribute.
|
35
|
+
Now you can also upload files by passing an encoded base64 string to the attribute. This also works for normal file uploads from file fields inside an HTML form, so you can safely replace `mount_uploader` with `mount_base64_uploader` to support both file input and base64 encoded input
|
37
36
|
|
38
37
|
## Upload file extension
|
39
38
|
|
data/carrierwave-base64.gemspec
CHANGED
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.add_dependency 'carrierwave', '>=
|
22
|
+
spec.add_dependency 'carrierwave', '>= 2.2.1'
|
23
23
|
spec.add_dependency 'mime-types', '~> 3.0'
|
24
|
-
spec.add_dependency '
|
24
|
+
spec.add_dependency 'marcel', '~> 1.0.0'
|
25
25
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
27
27
|
spec.add_development_dependency 'carrierwave-mongoid'
|
@@ -1,5 +1,4 @@
|
|
1
|
-
require '
|
2
|
-
require 'mimemagic/overlay'
|
1
|
+
require 'marcel'
|
3
2
|
|
4
3
|
module Carrierwave
|
5
4
|
module Base64
|
@@ -48,7 +47,7 @@ module Carrierwave
|
|
48
47
|
|
49
48
|
# Determine content type from input, with provided type as fallback
|
50
49
|
def get_file_extension(description, bytes)
|
51
|
-
detected_type =
|
50
|
+
detected_type = Marcel::Magic.by_magic(bytes)
|
52
51
|
content_type = (detected_type && detected_type.type) ||
|
53
52
|
description.split(';base64').first
|
54
53
|
mime_type = MIME::Types[content_type].last
|
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.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yury Lebedev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mime-types
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: marcel
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 1.0.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 1.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -247,7 +247,7 @@ homepage: https://github.com/lebedev-yury/carrierwave-base64
|
|
247
247
|
licenses:
|
248
248
|
- MIT
|
249
249
|
metadata: {}
|
250
|
-
post_install_message:
|
250
|
+
post_install_message:
|
251
251
|
rdoc_options: []
|
252
252
|
require_paths:
|
253
253
|
- lib
|
@@ -262,8 +262,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
262
|
- !ruby/object:Gem::Version
|
263
263
|
version: '0'
|
264
264
|
requirements: []
|
265
|
-
rubygems_version: 3.1.
|
266
|
-
signing_key:
|
265
|
+
rubygems_version: 3.1.4
|
266
|
+
signing_key:
|
267
267
|
specification_version: 4
|
268
268
|
summary: Upload images encoded as base64 to carrierwave.
|
269
269
|
test_files:
|