diff --git a/.github/workflows/unittest.yaml b/.github/workflows/unittest.yaml index 6208acc..e028e70 100644 --- a/.github/workflows/unittest.yaml +++ b/.github/workflows/unittest.yaml @@ -12,13 +12,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['3.1', '3.0', '2.7', '2.6'] + ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.6'] steps: - uses: actions/checkout@v3 + - name: Install apt dependencies + run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev # needed by faraday-patron gem - name: Set up Ruby ${{ matrix.ruby-version }} - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 + uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} diff --git a/.ruby-version b/.ruby-version index 37c2961..be94e6f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.2 +3.2.2 diff --git a/ipinfo.gemspec b/ipinfo.gemspec index 5d92d88..d38fc3c 100644 --- a/ipinfo.gemspec +++ b/ipinfo.gemspec @@ -16,7 +16,15 @@ Gem::Specification.new do |spec| spec.description = ' This is a ruby wrapper for http://ipinfo.io. ' spec.homepage = 'https://ipinfo.io' - spec.add_runtime_dependency 'faraday', '~> 1.0' + spec.add_runtime_dependency 'faraday', '~> 2.0' + # add development dependency to test against faraday adapters that are been moved out the gem + spec.add_development_dependency 'async-http-faraday' + spec.add_development_dependency 'faraday-net_http_persistent', '~> 2.0' + spec.add_development_dependency 'faraday-typhoeus', '~> 1.0' + spec.add_development_dependency 'faraday-patron', '~> 2.0' + spec.add_development_dependency 'faraday-httpclient', '~> 2.0' + spec.add_development_dependency 'faraday-excon', '~> 2.1' + spec.add_runtime_dependency 'json', '~> 2.1' spec.add_runtime_dependency 'lru_redux', '~> 1.1' diff --git a/lib/ipinfo/adapter.rb b/lib/ipinfo/adapter.rb index 5046ae0..2580bf7 100644 --- a/lib/ipinfo/adapter.rb +++ b/lib/ipinfo/adapter.rb @@ -42,7 +42,7 @@ def connection(adapter) def default_headers headers = { - 'User-Agent' => 'IPinfoClient/Ruby/2.0.0', + 'User-Agent' => 'IPinfoClient/Ruby/2.1.0', 'Accept' => 'application/json' } headers['Authorization'] = "Bearer #{CGI.escape(token)}" if token diff --git a/lib/ipinfo/version.rb b/lib/ipinfo/version.rb index e2ca3e0..1d7cd02 100644 --- a/lib/ipinfo/version.rb +++ b/lib/ipinfo/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module IPinfo - VERSION = '2.0.0' + VERSION = '2.1.0' end diff --git a/test/ipinfo_test.rb b/test/ipinfo_test.rb index 4a47a19..ebebb93 100644 --- a/test/ipinfo_test.rb +++ b/test/ipinfo_test.rb @@ -149,7 +149,7 @@ def assert_ip4(resp) resp.abuse, { "address": 'US, CA, Mountain View, ' \ - '1600 Amphitheatre Parkway, 94043', + '1600 Amphitheatre Parkway, 94043', "country": 'US', "email": 'network-abuse@google.com', "name": 'Abuse', diff --git a/test/lib/adapter_test.rb b/test/lib/adapter_test.rb index c36e026..6e3ea5f 100644 --- a/test/lib/adapter_test.rb +++ b/test/lib/adapter_test.rb @@ -3,6 +3,12 @@ require 'test_helper' require_relative '../../lib/ipinfo/adapter' +require 'faraday/net_http_persistent' +require 'faraday/typhoeus' +require 'faraday/patron' +require 'faraday/httpclient' +require 'faraday/excon' + class IPinfo::AdapterTest < Minitest::Test def test_default adapter = IPinfo::Adapter.new @@ -17,8 +23,6 @@ def test_default net_http_persistent: Faraday::Adapter::NetHttpPersistent, typhoeus: Faraday::Adapter::Typhoeus, patron: Faraday::Adapter::Patron, - em_synchrony: Faraday::Adapter::EMSynchrony, - em_http: Faraday::Adapter::EMHttp, excon: Faraday::Adapter::Excon, httpclient: Faraday::Adapter::HTTPClient }.freeze