Skip to content

Commit

Permalink
Add support for Faraday v1 (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
iMacTia authored Jan 6, 2022
1 parent db04ec8 commit 9a95cce
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 1 addition & 12 deletions faraday-multipart.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion lib/faraday/multipart.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'faraday'
require_relative 'multipart/file_part'
require_relative 'multipart/param_part'
require_relative 'multipart/middleware'
Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/faraday/multipart/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Faraday
module Multipart
VERSION = '1.0.0'
VERSION = '1.0.1'
end
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down

0 comments on commit 9a95cce

Please sign in to comment.