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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3fd587fb2650c73746c8554db4ccb5fbd86517c6cce72b152777cb6f5f012ce
4
- data.tar.gz: ad801ed1363f0e1ff315a781982c3d92f470de92b4272e37b6a82082eff9691b
3
+ metadata.gz: 3af16036cb1f1a6f3ae6ffce52db973a32c09c76287cde31036bed14b9989d3f
4
+ data.tar.gz: 62500de72742bb64cae9f3839124892f33463044c554f245b256868262c64e5d
5
5
  SHA512:
6
- metadata.gz: 1d8c6b0256d1ff5dfb11fd3ddd2f3b8a0cd4c3c2f1e936b06449ad97e42b40a3cbfb53b3d7426b6db007a5df1682b160de4e7913a5412b66db43450547fae409
7
- data.tar.gz: ea9520561c344f379293eb601b5db03a25c02c9a32741e6a049b2eb022a7f0daf130f5e3d9bb8625302ff7c08bd82784926df2a834b3e2387f7c26055d31a650
6
+ metadata.gz: f7e8b717582744821f8bd91437ced8f9fe7e794c6c9821e613a3b1c4eb4f33f5e4774b15428a74ddf8e1080143a9444b958776e7c8c156c2004bb97767e84e60
7
+ data.tar.gz: aad329e8d107294400e2ea177cd6d7ef4e40751b6bf57fa4987782705d4c9f30ba0f013df1e24e73f96af27ec98a90189f4207f1fbc6eec79726012bc7a19bad
data/.rubocop.yml CHANGED
@@ -5,3 +5,12 @@ Metrics/BlockLength:
5
5
  Exclude:
6
6
  - "spec/**/*"
7
7
  - "*.gemspec"
8
+
9
+ Style/FrozenStringLiteralComment:
10
+ Enabled: false
11
+
12
+ Style/SafeNavigation:
13
+ Enabled: false
14
+
15
+ Lint/SendWithMixinArgument:
16
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,10 +1,10 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.2.10
5
- - 2.3.8
6
- - 2.4.5
7
- - 2.5.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
@@ -1,5 +1,9 @@
1
1
  # carrierwave-base64 changelog
2
2
 
3
+ ## 2.9.0
4
+
5
+ - Mimemagic gem is replaced with Marcel (#87, @oakbow)
6
+
3
7
  ## 2.8.0
4
8
 
5
9
  - Mime Type is now detected from file contents, falling back to the type, specified by the user. (#73, @justisb)
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
 
@@ -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', '>= 0.8.0'
22
+ spec.add_dependency 'carrierwave', '>= 2.2.1'
23
23
  spec.add_dependency 'mime-types', '~> 3.0'
24
- spec.add_dependency 'mimemagic', '~> 0.3.2'
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 'mimemagic'
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 = MimeMagic.by_magic(bytes)
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
@@ -8,8 +8,7 @@ module Carrierwave
8
8
  end
9
9
 
10
10
  ActiveSupport.on_load :mongoid do
11
- Mongoid::Document::ClassMethods.send :include,
12
- Carrierwave::Base64::Adapter
11
+ Mongoid::Document::ClassMethods.include Carrierwave::Base64::Adapter
13
12
  end
14
13
  end
15
14
  end
@@ -1,5 +1,5 @@
1
1
  module Carrierwave
2
2
  module Base64
3
- VERSION = '2.8.1'.freeze
3
+ VERSION = '2.9.0'.freeze
4
4
  end
5
5
  end
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.8.1
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: 2020-04-15 00:00:00.000000000 Z
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: 0.8.0
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: 0.8.0
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: mimemagic
42
+ name: marcel
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.3.2
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.3.2
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.2
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: