diff --git a/lib/zerobounce/configuration.rb b/lib/zerobounce/configuration.rb index efc5a17..8a75e12 100644 --- a/lib/zerobounce/configuration.rb +++ b/lib/zerobounce/configuration.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'faraday' -require 'faraday_middleware' require 'zerobounce/middleware/raise_error' module Zerobounce @@ -48,7 +47,7 @@ def initialize builder.response(:json, content_type: /\bjson$/, parser_options: { symbolize_names: true }) builder.response(:logger) { |l| l.filter(/(api_?key=)(\w+)/, '\1[REMOVED]') } if ENV['ZEROBOUNCE_API_DEBUG'] builder.use(Zerobounce::Middleware::RaiseError) - builder.adapter(Faraday.default_adapter) + builder.adapter(:net_http) end end end diff --git a/spec/zerobounce/configuration_spec.rb b/spec/zerobounce/configuration_spec.rb index e44b48a..018e96d 100644 --- a/spec/zerobounce/configuration_spec.rb +++ b/spec/zerobounce/configuration_spec.rb @@ -34,9 +34,9 @@ expect(builder).to have_received(:use).with(Zerobounce::Middleware::RaiseError) end - it 'uses Faraday default adapter' do + it 'uses net_http adapter' do described_class.new.middleware.call(builder) - expect(builder).to have_received(:adapter).with(Faraday.default_adapter) + expect(builder).to have_received(:adapter).with(:net_http) end end end diff --git a/zerobounce.gemspec b/zerobounce.gemspec index ad784b3..bc284e9 100644 --- a/zerobounce.gemspec +++ b/zerobounce.gemspec @@ -14,18 +14,18 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.description = 'A Ruby client for Zerobounce.net.' spec.homepage = 'https://github.com/afrase/zerobounce' spec.license = 'MIT' + spec.required_ruby_version = '>= 2.5.0' - spec.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(test|spec|features)/}) - end + spec.files = Dir.glob('{lib,exe}/**/*', File::FNM_DOTMATCH).reject do |f| + File.directory?(f) || f.match(%r{^(test|spec|features)/}) + end + %w[README.md LICENSE.txt CHANGELOG.md].select { |f| File.exist?(f) } spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] spec.metadata['yard.run'] = 'yri' # use "yard" to build full HTML docs. - spec.add_dependency 'faraday', '>= 0.14', '< 2.0' - spec.add_dependency 'faraday_middleware', '>= 0.12', '< 2.0' + spec.add_dependency 'faraday', '>= 0.14', '< 3.0' spec.add_development_dependency 'bundler', '~> 1.16' spec.add_development_dependency 'pry', '~> 0.13.0'