Skip to content

Instantly share code, notes, and snippets.

@segiddins
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save segiddins/6aa5799e1844907e7d6c to your computer and use it in GitHub Desktop.
Save segiddins/6aa5799e1844907e7d6c to your computer and use it in GitHub Desktop.
Run a shell command in each rbenv version installed
#!/usr/bin/ruby
versions = `rbenv versions --bare`.split("\n").map(&:strip)
warn "rbenv not installed" && exit(1) unless $?.success?
versions.each do |v|
puts "rbenv shell #{v}"
puts
system({"RBENV_VERSION" => v}, ARGV.join(' '))
puts '-' * 80
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment