scripts/irbrc.rb in rvm-0.0.67 vs scripts/irbrc.rb in rvm-0.0.68
- old
+ new
@@ -7,11 +7,11 @@
# Turn on history saving.
require "irb/ext/save-history"
IRB.conf[:HISTORY_FILE] = File.join(ENV["HOME"], ".irb-history")
# Calculate the ruby string.
-rvm_ruby_string = ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_VERSION}-#{(RUBY_PATCHLEVEL) ? "p#{RUBY_PATCHLEVEL}" : "r#{RUBY_REVISION}"}"
+rvm_ruby_string = ENV["rvm_ruby_string"] || "#{RUBY_ENGINE rescue 'ruby'}-#{RUBY_VERSION}-#{(RUBY_PATCHLEVEL) ? "p#{RUBY_PATCHLEVEL}" : "r#{RUBY_REVISION}"}"
# Set up the prompt to be RVM specific.
@prompt = {
:PROMPT_I => "#{rvm_ruby_string} > ", # default prompt
:PROMPT_S => "#{rvm_ruby_string}%l> ", # known continuation
@@ -22,10 +22,12 @@
}
IRB.conf[:PROMPT][:RVM] = @prompt
IRB.conf[:PROMPT_MODE] = :RVM
# Load the user's irbrc file, if possible.
-if File.exists?("#{ENV["HOME"]}/.irbrc_disabled")
- load File.join(ENV["HOME"], ".irbrc") rescue nil
+begin
+ load File.join(ENV["HOME"], ".irbrc") if File.exists?("#{ENV["HOME"]}/.irbrc")
+rescue => exception
+ puts "Error : 'load #{ENV["HOME"]}/.irbrc' : #{exception.message}"
end
# EOF