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

add #download_artifact method to Mixlib::Install API #243

Merged
merged 1 commit into from
Oct 11, 2017

Conversation

wrightp
Copy link

@wrightp wrightp commented Sep 26, 2017

Signed-off-by: Patrick Wright patrick@chef.io

@wrightp wrightp requested a review from a team September 26, 2017 18:43
@wrightp wrightp changed the title refactor download logic from CLI to core API add #download_artifact method to Mixlib::Install API Sep 27, 2017
file = File.join(directory, File.basename(artifact.url))

uri = URI.parse(artifact.url)
Net::HTTP.start(uri.host) do |http|
Copy link
Contributor

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?

Copy link
Author

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")
Copy link
Contributor

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".

Copy link
Author

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>
@wrightp wrightp merged commit 187e3ab into master Oct 11, 2017
@tas50 tas50 added Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number. and removed Expeditor: Bump Minor Version labels Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants