Skip to content

Instantly share code, notes, and snippets.

@jc00ke
Created January 17, 2011 19:16
Show Gist options
  • Select an option

  • Save jc00ke/783298 to your computer and use it in GitHub Desktop.

Select an option

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

timfel commented Jan 17, 2011

Copy link
Copy Markdown

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

@jc00ke

jc00ke commented Jan 17, 2011

Copy link
Copy Markdown
Author

updated, thanks!

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