rbenv / rbenv-each

rbenv plugin to Run a command across all installed rubies.
Creative Commons Zero v1.0 Universal
91 stars 18 forks source link

better command support? #14

Closed chino closed 9 years ago

chino commented 9 years ago

It would be nice to simply eval whatever is left on the command line.

For instance I'd love to do:

rbenv each -v gem list \| grep "a b"

With proper quoting support so that the grep in the example above works appropriately.

mislav commented 9 years ago

No, we're not going to do anything tricky like that. If you find yourself needing to do some shell functions/piping across rbenv versions, you could simply:

for v in `rbenv versions --bare`; do RBENV_VERSION=$v gem list | grep "a b"; done
chino commented 9 years ago

Yea, I just basically took that and change it to call eval "$@" and it seems to work great...

Would be cool if rbenv-each supported it.

mislav commented 9 years ago

I want to refrain from doing eval internally since that is not how I want people to use rbenv-each.

However you can always execute bash interpreter with any script that you want:

rbenv each bash -c 'gem list | grep "a b"'
chino commented 9 years ago

Hm, your right. I forget off top of my head and I'm on road right now but does rbenv support aliases? It could be a simple handy alias.

On Wed, Jan 21, 2015, 6:20 PM Mislav Marohnić notifications@github.com wrote:

I want to refrain from doing eval internally since that is not how I want people to use rbenv-each.

However you can always execute bash interpreter with any script that you want:

rbenv each bash -c 'gem list | grep "a b"'

— Reply to this email directly or view it on GitHub https://github.com/chriseppstein/rbenv-each/issues/14#issuecomment-70942399 .

mislav commented 9 years ago

rbenv doesn't support aliases but your shell does ;)

alias rbenv-each-eval='rbenv each bash -c'
chino commented 9 years ago

I agree. However I do like git aliases even though they could just be shell aliases :)

On Wed, Jan 21, 2015, 7:10 PM Mislav Marohnić notifications@github.com wrote:

rbenv doesn't support aliases but your shell does ;)

alias rbenv-each-eval='rbenv each bash -c'

— Reply to this email directly or view it on GitHub https://github.com/chriseppstein/rbenv-each/issues/14#issuecomment-70948218 .