Skip to content

Commit

Permalink
remove byebug and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolapagiaro committed Sep 20, 2023
1 parent 0d46f86 commit 647141c
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 54 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
/spec/reports/
/tmp/
IPinfo-*.gem

.byebug_history
3 changes: 0 additions & 3 deletions ipinfo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ Gem::Specification.new do |spec|
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_development_dependency 'faraday-em_http', '~> 1.0'
# spec.add_development_dependency 'faraday-em_synchrony', '~> 1.0'

spec.add_runtime_dependency 'json', '~> 2.1'
spec.add_runtime_dependency 'lru_redux', '~> 1.1'
spec.add_development_dependency 'byebug'

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
Expand Down
4 changes: 2 additions & 2 deletions lib/ipinfo/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def post(uri, body, timeout = 2)
attr_reader :token

def connection(adapter)
Faraday.new(url: "https://#{HOST}") do |f|
f.adapter(adapter)
Faraday.new(url: "https://#{HOST}") do |conn|
conn.adapter(adapter)
end
end

Expand Down
90 changes: 44 additions & 46 deletions test/ipinfo_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,52 +116,50 @@ def assert_ip4(resp)
assert_equal(resp.longitude, '-122.0775')
assert_equal(resp.postal, '94043')
assert_equal(resp.timezone, 'America/Los_Angeles')

# No more available without auth token
# assert_equal(
# resp.asn,
# {
# "asn": 'AS15169',
# "name": 'Google LLC',
# "domain": 'google.com',
# "route": '8.8.8.0/24',
# "type": 'hosting'
# }
# )
# assert_equal(
# resp.company,
# {
# "name": 'Google LLC',
# "domain": 'google.com',
# "type": 'hosting'
# }
# )
# assert_equal(
# resp.privacy,
# {
# "vpn": false,
# "proxy": false,
# "tor": false,
# "relay": false,
# "hosting": true,
# "service": ''
# }
# )
# assert_equal(
# resp.abuse,
# {
# "address": 'US, CA, Mountain View, ' \
# '1600 Amphitheatre Parkway, 94043',
# "country": 'US',
# "email": '[email protected]',
# "name": 'Abuse',
# "network": '8.8.8.0/24',
# "phone": '+1-650-253-0000'
# }
# )
# assert_equal(resp.domains[:ip], TEST_IPV4)
# refute_nil(resp.domains[:total])
# refute_nil(resp.domains[:domains])
assert_equal(
resp.asn,
{
"asn": 'AS15169',
"name": 'Google LLC',
"domain": 'google.com',
"route": '8.8.8.0/24',
"type": 'hosting'
}
)
assert_equal(
resp.company,
{
"name": 'Google LLC',
"domain": 'google.com',
"type": 'hosting'
}
)
assert_equal(
resp.privacy,
{
"vpn": false,
"proxy": false,
"tor": false,
"relay": false,
"hosting": true,
"service": ''
}
)
assert_equal(
resp.abuse,
{
"address": 'US, CA, Mountain View, ' \
'1600 Amphitheatre Parkway, 94043',
"country": 'US',
"email": '[email protected]',
"name": 'Abuse',
"network": '8.8.8.0/24',
"phone": '+1-650-253-0000'
}
)
assert_equal(resp.domains[:ip], TEST_IPV4)
refute_nil(resp.domains[:total])
refute_nil(resp.domains[:domains])
end

def test_lookup_ip4
Expand Down
1 change: 0 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'ipinfo'
require 'byebug'

require 'minitest/autorun'
require 'minitest/reporters'
Expand Down

0 comments on commit 647141c

Please sign in to comment.