-
Notifications
You must be signed in to change notification settings - Fork 54
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
add #download_artifact method to Mixlib::Install API #243
Conversation
e10003c
to
58a98b7
Compare
file = File.join(directory, File.basename(artifact.url)) | ||
|
||
uri = URI.parse(artifact.url) | ||
Net::HTTP.start(uri.host) do |http| |
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.
Won't this have issues with proxies since we are calling Net::HTTP rather than OpenURI?
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.
URI.parse
does the things.
README.md
Outdated
Download a specific artifact to a configurable location. All platform options (platform, platform_version, architecture) are required in order to filter a single artifact. | ||
```ruby | ||
# detect platform and download to "/tmp" | ||
Mixlib::Install.new(product_name: "chefdk", channel: :stable).detect_platform.download_artifact("/tmp") |
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.
In the event the example is cargo culted; Dir.tmpdir
is a better non-platform specific path rather than "/tmp"
.
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 see what you mean now. I'll update this
Signed-off-by: Patrick Wright <patrick@chef.io>
58a98b7
to
94d2112
Compare
Signed-off-by: Patrick Wright patrick@chef.io