diff --git a/Gemfile b/Gemfile index 6393bb2..823b945 100644 --- a/Gemfile +++ b/Gemfile @@ -5,5 +5,14 @@ source 'https://rubygems.org' gemspec group :development, :test do + gem 'bundler', '~> 2.0' + gem 'faraday', '>= 1.0' gem 'multipart-parser' + gem 'rake', '~> 13.0' + gem 'rspec', '~> 3.0' + gem 'rubocop', '~> 1.21.0' + gem 'rubocop-packaging', '~> 0.5.0' + gem 'rubocop-performance', '~> 1.0' + gem 'rubocop-rspec', '~> 2.0' + gem 'simplecov', '~> 0.21.0' end diff --git a/faraday-multipart.gemspec b/faraday-multipart.gemspec index 2620aca..10c6e7f 100644 --- a/faraday-multipart.gemspec +++ b/faraday-multipart.gemspec @@ -31,16 +31,5 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 2.6', '< 4' - spec.add_runtime_dependency 'faraday', '~> 2.0' - spec.add_runtime_dependency 'multipart-post', '>= 1.2', '< 3' - - spec.add_development_dependency 'bundler', '~> 2.0' - spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rspec', '~> 3.0' - spec.add_development_dependency 'simplecov', '~> 0.21.0' - - spec.add_development_dependency 'rubocop', '~> 1.21.0' - spec.add_development_dependency 'rubocop-packaging', '~> 0.5.0' - spec.add_development_dependency 'rubocop-performance', '~> 1.0' - spec.add_development_dependency 'rubocop-rspec', '~> 2.0' + spec.add_dependency 'multipart-post', '>= 1.2', '< 3' end diff --git a/lib/faraday/multipart.rb b/lib/faraday/multipart.rb index 0f9eb3c..3bd5022 100644 --- a/lib/faraday/multipart.rb +++ b/lib/faraday/multipart.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'faraday' require_relative 'multipart/file_part' require_relative 'multipart/param_part' require_relative 'multipart/middleware' @@ -11,4 +10,9 @@ module Faraday module Multipart Faraday::Request.register_middleware(multipart: Faraday::Multipart::Middleware) end + + # Aliases for Faraday v1 + FilePart = Multipart::FilePart + Parts = Multipart::Parts + CompositeReadIO = Multipart::CompositeReadIO end diff --git a/lib/faraday/multipart/version.rb b/lib/faraday/multipart/version.rb index 81d1a00..2af082f 100644 --- a/lib/faraday/multipart/version.rb +++ b/lib/faraday/multipart/version.rb @@ -2,6 +2,6 @@ module Faraday module Multipart - VERSION = '1.0.0' + VERSION = '1.0.1' end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b46185c..793ab65 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'faraday' +require 'json' require_relative '../lib/faraday/multipart' Dir['./spec/support/**/*.rb'].sort.each { |f| require f }