Created
June 4, 2010 17:58
-
-
Save nathmisaki/425733 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
versions = Dir[File.join('/home/nelson/.rvm/rubies', "ruby*")] | |
versions.each do |version| | |
version.match(/-([\d\.]\+)-/) | |
ruby_version_string = version.split('/').last | |
ruby_version = $1 | |
ENV['GEM_PATH'] = Dir["/home/nelson/.rvm/gems/#{ruby_version_string}*/"].join(':') | |
Dir.chdir '/home/nelson/projects/morpheus' | |
system(%&#{File.join(version, 'bin/ruby')} -r 'rubygems' -e "STDOUT.puts Gem.source_index.spec_dirs ;STDOUT.puts RUBY_VERSION; load Gem.bin_path('rspec', 'spec')" spec &) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result
$ ruby rvm_gist.rb
/Users/tomas/.rvm/gems/ruby-1.8.7-p249/specifications
/Users/tomas/.rvm/gems/ruby-1.8.7-p249@global/specifications
/Users/tomas/.rvm/gems/ruby-1.8.7-p249/specifications
1.8.7
.............................................................................................................................
Finished in 0.182365 seconds
125 examples, 0 failures
/Users/tomas/.rvm/gems/ruby-1.9.1-p378/specifications
/Users/tomas/.rvm/gems/ruby-1.9.1-p378@a-new-gemset-where-no-gems-are-installed/specifications
/Users/tomas/.rvm/gems/ruby-1.9.1-p378@global/specifications
/Users/tomas/.rvm/gems/ruby-1.8.7-p249/specifications
1.9.1
.............................................................................................................................
Finished in 0.205788 seconds
125 examples, 0 failures
/Users/tomas/.rvm/gems/ruby-1.9.2-preview1/specifications
/Users/tomas/.rvm/gems/ruby-1.9.2-preview1@global/specifications
/Users/tomas/.rvm/gems/ruby-1.8.7-p249/specifications
1.9.2
.............................................................................................................................
Finished in 0.1815 seconds
125 examples, 0 failures