Skip to content
Permalink
Browse files

Replace mime-types dependency with mini_mime (#789)

  • Loading branch information...
bborn authored and TheRoyalTnetennba committed May 13, 2019
1 parent dc13fa6 commit c1a26e0e37d40dc9b7e4dd858a9a6daed1bc603d
Showing with 4 additions and 4 deletions.
  1. +1 −1 google-api-client.gemspec
  2. +3 −3 lib/google/apis/core/upload.rb
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'representable', '~> 3.0'
spec.add_runtime_dependency 'retriable', '>= 2.0', '< 4.0'
spec.add_runtime_dependency 'addressable', '~> 2.5', '>= 2.5.1'
spec.add_runtime_dependency 'mime-types', '~> 3.0'
spec.add_runtime_dependency 'mini_mime', '~> 1.0'
spec.add_runtime_dependency 'signet', '~> 0.10'
spec.add_runtime_dependency 'googleauth', '>= 0.5', '< 0.10.0'
spec.add_runtime_dependency 'httpclient', '>= 2.8.1', '< 3.0'
@@ -18,7 +18,7 @@
require 'google/apis/errors'
require 'addressable/uri'
require 'tempfile'
require 'mime-types'
require 'mini_mime'

module Google
module Apis
@@ -55,8 +55,8 @@ def prepare!
elsif self.upload_source.is_a?(String)
self.upload_io = File.new(upload_source, 'r')
if self.upload_content_type.nil?
type = MIME::Types.of(upload_source)
self.upload_content_type = type.first.content_type unless type.nil? || type.empty?
type = MiniMime.lookup_by_filename(upload_source)
self.upload_content_type = type && type.content_type
end
@close_io_on_finish = true
else

0 comments on commit c1a26e0

Please sign in to comment.
You can’t perform that action at this time.