Created
January 17, 2011 19:16
-
-
Save jc00ke/783298 to your computer and use it in GitHub Desktop.
Is there a newer MagLev version?
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
rvm --create --use maglev-24990@my_gemset | |
ruby update.rb |
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
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-#{latest} maglev-#{installed}" | |
puts "sed -i 's/#{installed}/#{latest}' .rvmrc" | |
puts "*" * 75 | |
end | |
# @faustroll is a regexp wizard | |
# @timfelgentreff on the ones and twos, and rvm upgrade |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"rvm upgrade maglev-#{latest} maglev-#{current}" will install the newer version, remove the old one and migrate all your gemsets