Skip to content

Conversation

biochimia
Copy link

Git, curl, and other tools already offer support for loading credentials
from ~/.netrc, namely when interacting with GitHub. This uses the netrc
gem to play along. This is implemented as a fallback, in case a token is
not found in the gist-specific file.

Fixes #260.

@ConradIrwin
Copy link
Collaborator

@biochimia we've historically avoided adding gem dependencies because it makes gist hard to use as a standalone app. That said, it may not matter anymore. Do you know if this will still work with brew install gist?

@biochimia
Copy link
Author

I was just now looking how the json library is used from the vendor folder and exploring if something similar could be done for the netrc library.

I can also look at any issues that could come up with using homebrew. Do you have any pointers for how I would test that?

@biochimia
Copy link
Author

Okay, I figured out how to update homebrew's HEAD branch for gist and can confirm that my branch breaks the homebrew installed gist.

On the other hand, netrc doesn't have additional external dependencies and is also licensed under the MIT license. Would it be okay to bring it under the vendor folder?

@biochimia
Copy link
Author

I had another go at this, putting the netrc.rb library under vendor/, and skipping the gem dependency. I also updated the standalone script in build/gist, and tested installing from my branch with homebrew – I can confirm that that now works.

How do you feel about this approach?

@ConradIrwin
Copy link
Collaborator

Looks great, thank you! A few final things:

  1. Could you please copy the license from the heroku project into netrc.rb (as required by the license)
  2. Can you add some documentation to the README explaining how it works?

Happy to ship this, thanks for pushing it through :D

Git, curl, and other tools already offer support for loading credentials from ~/.netrc, namely when interacting with GitHub. This uses the netrc gem to play along. It's implemented as a fallback, in case a token is not found in the gist-specific file. To avoid adding gem dependencies, the netrc library is imported from https://github.com/heroku/netrc into the vendor folder. It is licensed under the MIT license, the same as this project, and it's copyright notice and license have been embedded in a comment with the code. The standalone script build/gist was regenerated and pulls in missing changes in addition to the netrc dependency. Fixes defunkt#260.
@ConradIrwin ConradIrwin merged commit 55fb758 into defunkt:master May 16, 2017
@biochimia
Copy link
Author

Hi, thanks for merging this! I wanted to come back and finish the documentation, but let it drag for too long. Apologies for that!

I've now submitted #262 with the doc updates. Feel free to offer comments on that one to finish this off.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants