Skip to content

Instantly share code, notes, and snippets.

@jc00ke
Created January 17, 2011 19:16
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 jc00ke/783298 to your computer and use it in GitHub Desktop.
Save jc00ke/783298 to your computer and use it in GitHub Desktop.
Is there a newer MagLev version?
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-#{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
@timfel
Copy link

timfel commented Jan 17, 2011

"rvm upgrade maglev-#{latest} maglev-#{current}" will install the newer version, remove the old one and migrate all your gemsets

@jc00ke
Copy link
Author

jc00ke commented Jan 17, 2011

updated, thanks!

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