Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

update gemspec #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.5
2.6.6
18 changes: 9 additions & 9 deletions faraday_adapter_socks.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "faraday", "~> 0.9"
spec.add_dependency 'faraday', ['>= 0.7.4', '< 2.0']
spec.add_dependency "socksify", "~> 1.7"

spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 11.2"
spec.add_development_dependency "rspec", "~> 3.5"
spec.add_development_dependency 'pry', '~> 0.10'
spec.add_development_dependency 'pry-byebug', '~> 3.4'
spec.add_development_dependency 'pry-doc', '~> 0.9'
spec.add_development_dependency 'pry-theme', '~> 1.1'
end
spec.add_development_dependency "bundler", "~> 2.1"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.9"
spec.add_development_dependency 'pry', '~> 0.12'
spec.add_development_dependency 'pry-byebug', '~> 3.8'
spec.add_development_dependency 'pry-doc', '~> 1.0'
spec.add_development_dependency 'pry-theme', '~> 1.3'
end
4 changes: 2 additions & 2 deletions lib/faraday/adapter/net_http_socks.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module Faraday
class Adapter < Middleware
class Adapter

register_middleware net_http_socks: :NetHttpSocks

class NetHttpSocks < Faraday::Adapter::NetHttp

SOCKS_SCHEMES = ['socks', 'socks4', 'socks5']
SOCKS_SCHEMES = ['socks', 'socks4', 'socks5', 'socks5h']

def net_http_connection(env)
proxy = env[:request][:proxy]
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday_adapter_socks/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module FaradayAdapterSocks
VERSION = "0.1.1"
VERSION = "0.2.0"
end
6 changes: 3 additions & 3 deletions spec/faraday/adapter/net_http_socks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
describe 'setup' do
it 'should have 3 SOCKS_SCHEMES' do
schemes = Faraday::Adapter::NetHttpSocks::SOCKS_SCHEMES
expect(schemes.size).to eq(3)
expect(schemes).to eq(['socks', 'socks4', 'socks5'])
expect(schemes.size).to eq(4)
expect(schemes).to eq(['socks', 'socks4', 'socks5', 'socks5h'])
end
end

Expand Down Expand Up @@ -81,4 +81,4 @@
it_behaves_like 'adapter is instance of Faraday::Adapter::NetHttp'
end
end
end
end