Conversation
To capture standard error output
$ gel add pry will add pry to the end of Gemfile.
|
Awesome!
Hmm.. I think so: it seems like the aim is to have a single command that gets you into a state where you can start using the gem. (Because our From a quick peek, it looks like Bundler actually does an in-memory resolve of the new-Gemfile-to-be, and verifies that it will be able to be resolved -- so if you try to add something impossible, it'll fail while leaving your Gemfile unchanged. If you're up for a bigger adventure, I think we might have the internal APIs to do that now (I'm thinking of #57 & #58 in particular). If that looks too hard, though, we might be able to cheat by running the lock command, then undoing our Gemfile change if it fails. |
|
Thanks for the advice and Happy Friday! I could not figure out the internal APIs to do in-memory resolving. Should we do something similar to how Is commit 3826571 the right direction for cheating 😅? |
Implement
gel addcommand (Context).This command will let people add a gem to their
Gemfile. Similar to bundle add that adds gem to theGemfileand runbundle install.Also introduced a
capture_stderrmethod totest_helperto get the error message.Todos
Tests
bin/setup && bin/rake