Skip to content

Instantly share code, notes, and snippets.

@timfel
Forked from jc00ke/.rvmrc
Created January 17, 2011 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save timfel/783357 to your computer and use it in GitHub Desktop.
Save timfel/783357 to your computer and use it in GitHub Desktop.
rvm --create --use maglev-24990@my_gemset
ruby update.rb
require "open-uri"
installed = /(\d+)$/.match(ENV['RUBY_VERSION'])[1].to_i
version = `curl -s https://github.com/MagLev/maglev/raw/master/version.txt | head -n 1`.chomp.strip
latest = /([\d]+?)-\d+\)$/.match(version)[1].to_i
if (latest > installed)
puts "*" * 75
puts "There's a later version: #{latest}"
puts "maglev stop"
puts "rvm upgrade maglev-#{installed} maglev-#{latest}"
puts "sed -i 's/#{installed}/#{current}/' .rvmrc"
puts "*" * 75
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment