Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bumped ruby version to 3 and faraday version to 2 #44

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.2
3.2.2
10 changes: 9 additions & 1 deletion ipinfo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion test/ipinfo_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def assert_ip4(resp)
resp.abuse,
{
"address": 'US, CA, Mountain View, ' \
'1600 Amphitheatre Parkway, 94043',
'1600 Amphitheatre Parkway, 94043',
"country": 'US',
"email": '[email protected]',
"name": 'Abuse',
Expand Down
15 changes: 13 additions & 2 deletions test/lib/adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
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'

# No updates since 2021, the method `dependecy` from the class Faraday::Adapter has been removed
# https://github.com/lostisland/faraday/blob/main/UPGRADING.md#the-dependency-method-in-middlewares-has-been-removed
# require 'faraday/em_http'
# require 'faraday/em_synchrony'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just rm?

UmanShahzad marked this conversation as resolved.
Show resolved Hide resolved

class IPinfo::AdapterTest < Minitest::Test
def test_default
adapter = IPinfo::Adapter.new
Expand All @@ -17,8 +28,8 @@ 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,
# em_synchrony: Faraday::Adapter::EMSynchrony,
# em_http: Faraday::Adapter::EMHttp,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just rm?

UmanShahzad marked this conversation as resolved.
Show resolved Hide resolved
excon: Faraday::Adapter::Excon,
httpclient: Faraday::Adapter::HTTPClient
}.freeze
Expand Down