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 a chruby-exec bin script #24

Closed
postmodern opened this issue Dec 2, 2012 · 6 comments
Closed

add a chruby-exec bin script #24

postmodern opened this issue Dec 2, 2012 · 6 comments
Assignees

Comments

@postmodern
Copy link
Owner

Add a chruby-exec bin script that would select the desired ruby, then run another command under it.

chruby-exec jruby --1.9 -- command

This would be useful for people needing to run Ruby scripts via cron jobs.

@ghost ghost assigned postmodern Dec 2, 2012
@robin850
Copy link

robin850 commented Dec 2, 2012

Hi,

Just giving a 👍 for this !

@postmodern
Copy link
Owner Author

Now that I think about it, chruby-exec would just be syntactic sugar for:

bash -lc "chruby 1.9.3 && command --options"

@postmodern
Copy link
Owner Author

@robin850 @havenwood I hacked up a prototype for chruby-exec. It seems to work on bash and zsh.

@marius
Copy link

marius commented Dec 4, 2012

I would use the version without the sugar. Just to keep it clear and simple :)

@postmodern
Copy link
Owner Author

OK, I'm going to close this as YAGNI. Without chruby-exec, we force the developer/admin to explicitly choose the shell to run the command under (never assume /bin/sh -> /bin/bash). It also forces the developer/admin to explicitly write two commands chruby X.Y.Z && command, where as chruby-exec RUBY -- COMMAND expects a -- deliminator between the ruby version and the command; which I expect to be a common stumbling block.

@postmodern
Copy link
Owner Author

This has been released in 0.3.0.

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

No branches or pull requests

3 participants