-
Notifications
You must be signed in to change notification settings - Fork 5
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
changes as requested. #3
base: master
Are you sure you want to change the base?
Conversation
http.use_ssl = true | ||
request = Net::HTTP::Get.new(uri.request_uri) | ||
response = http.request(request) | ||
keys = JSON.parse(response.body)['keys'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is duplicated. I think that it's better to create a private function like this:
def make_get_request(url)
uri = URI(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
JSON.parse(response.body)
end
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore this line please. We always put empty line before and after a block.
uri = URI.parse(config_uri) | ||
http = Net::HTTP.new(uri.host, uri.port) | ||
http.use_ssl = true | ||
request = Net::HTTP::Get.new(uri.request_uri) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you can pass uri
directly: request = Net::HTTP::Get.new(uri)
Please let me know if you need additional changes. Thx.