Skip to content

Commit

Permalink
Removed rest-client, use net/http instead
Browse files Browse the repository at this point in the history
  • Loading branch information
rojosinalma committed Mar 1, 2018
1 parent 80ce3d5 commit 586ebdc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion geo_ip.gemspec
Expand Up @@ -16,7 +16,6 @@ Gem::Specification.new do |s|
s.test_files = Dir.glob('spec/**/*')
s.require_paths = ['lib']

s.add_dependency 'rest-client', '~> 1.6'
s.add_development_dependency 'rake', '< 11' # TODO: remove this lock again when RSpec gets upgraded and no longer uses the `last_commit` method
s.add_development_dependency 'rspec', '~> 2.5'
s.add_development_dependency 'webmock', '~> 2.3.2'
Expand Down
4 changes: 2 additions & 2 deletions lib/geo_ip.rb
@@ -1,6 +1,6 @@
require 'json'
require 'resolv'
require 'rest-client'
require 'net/http'

class GeoIp
class InvalidPrecissionError < ArgumentError; end
Expand Down Expand Up @@ -67,7 +67,7 @@ def lookup_url(ip, options = {})
def geolocation(ip, options = {})
location = nil
Timeout.timeout(fallback_timeout) do
parsed_response = JSON.parse RestClient::Request.execute(method: :get, url: lookup_url(ip, options), timeout: timeout)
parsed_response = JSON.parse Net::HTTP.get(URI(lookup_url(ip, options)))
location = convert_keys(parsed_response, options)
end

Expand Down

0 comments on commit 586ebdc

Please sign in to comment.