Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Commit

Permalink
Fixed bug when user's .rvmrc has rvm_pretty_print_flag=1
Browse files Browse the repository at this point in the history
  • Loading branch information
greendog99 committed Feb 13, 2011
1 parent 7addc38 commit c999679
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions _rvm.rb
Expand Up @@ -2,15 +2,18 @@

puts "Setting up RVM gemset and installing bundled gems (may take a while) ... ".magenta

current_ruby = `rvm list`.match(/=> ([^ ]+)/)[1]
# Need to strip colors in case rvm_pretty_print_flag is enabled in user's .rvmrc
rvm_list = `rvm list`.gsub(Regexp.new("\e\\[.?.?.?m"), '')

current_ruby = rvm_list.match(/=> ([^ ]+)/)[1]
desired_ruby = ask("Which RVM Ruby would you like to use? [#{current_ruby}]".red)
desired_ruby = current_ruby if desired_ruby.blank?

gemset_name = ask("What name should the custom gemset have? [#{@app_name}]".red)
gemset_name = @app_name if gemset_name.blank?

# Create the gemset
run "rvm gemset create #{gemset_name}"
run "rvm gemset create #{desired_ruby}@#{gemset_name}"

# Let us run shell commands inside our new gemset. Use this in other template partials.
@rvm = "rvm #{desired_ruby}@#{gemset_name}"
Expand Down

0 comments on commit c999679

Please sign in to comment.