<stevenharman>
I tried searching the #bundler logs, but couldn't find an answer. So: binstubs for a Gem... yes/no? And if yes, do you add those to Git?
<stevenharman>
i.e., I maintain a few Gems. Is it OK to generate binstubs for things like rspec, rake, etc.? into the `bin/` directory those Gems' source trees?
<stevenharman>
"Projects that are themselves gems should use a directory other than bin/, via a command like bundle install --binstubs exec. If you check in bin/rspec to your gem repo, installing your gem will break the rspec command."
<stevenharman>
but wouldn't that only be the case if the Gem's .gemspec listed `bin/rspec` as an executable?
<postmodern>
stevenharman, bundler currently chooses to overwrite the contents of bin/
<postmodern>
stevenharman, even when the executables are local
<stevenharman>
I'm not sure I follow. Perhaps an example would be good?
<postmodern>
stevenharman, i reported this bug, but indirect has reasons not to change the behavior, although wouldn't specify them
<postmodern>
stevenharman, ah your question, it's generally ok to use bin/
<postmodern>
stevenharman, but you probably shouldn't commit them
<stevenharman>
OK.
<postmodern>
stevenharman, otherwise they'd be packaged into the .gem
<stevenharman>
But wouldn't they only be packaged if the .gemspec lists them as executables?
<postmodern>
stevenharman, be-aware that bundler can overwrite any existing bin/ scripts
<postmodern>
stevenharman, correct, they have to be in gemspec.files and gemspec.executables
<stevenharman>
OK, so here's really simple example:
<stevenharman>
Maybe I'm not understanding what the .gemspec's "executables" list is for. I would assume that ONLY the files in that list would be packaged into the .gem's bindir.
<stevenharman>
Doh, I just built a .gem, and then unpacked it. Sure enough, those files are there. Hmm...
<postmodern>
stevenharman, they still shouldn't even be in the .gem
<postmodern>
yeah had to double check as well
<postmodern>
might try testing `gem install` vs. `gem unpack` just to be sure
<stevenharman>
Yeah, I seem to have a poor understanding of what all of the parts of the gemspec are for.
<stevenharman>
I verified that the installed gem also has the files.
<stevenharman>
I was thinking (wishfully, it turns out) that only those files listed as executables would be packaged in the bindir, so I'd be fine. Guess the real answer is to either NOT check those file in, or to make sure they're not in the "files" list.
<stevenharman>
thanks for the help, postmodern.
<postmodern>
stevenharman, word, also watch out for projects that have their own bin/executables, bundler will overwrite those by accident
<stevenharman>
I need to remove the binstubs from there... doing that in a minute.
<stevenharman>
So that gem has it's own execuable: bin/git-tracker
<stevenharman>
are you saying that `bundle install --binstubs` w/in that projects working tree would overwrite the legit bin/git-tracker with a binstub for git-tracker?
<postmodern>
stevenharman, yep just double-checked
<stevenharman>
Yikes. That is surprising.
<stevenharman>
Thanks for the heads up.
<stevenharman>
I suppose by dumb luck, I've never seen that as I almost always `bundle binstubs FOO BAR ZAA`
<stevenharman>
to explicitly generate binstubs for the stuff I use.
<postmodern>
hopefully in the future, we could just specify an env variable to activate bundler
postmodern has quit [Quit: Leaving]
havenwood has joined #bundler
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
robbyoconnor has joined #bundler
woollyams has quit [Ping timeout: 252 seconds]
odigity has joined #bundler
<odigity>
Can anyone explain this? "Your Ruby version is 2.1.1, but your Gemfile specified 2.1.1"