Permalink
Browse files

Reduce number of lines (@charliesome).

  • Loading branch information...
1 parent cfbe5e2 commit ed41bf578f4549ce1a6bb989d95a46895a1e42ca @postmodern committed Mar 25, 2013
Showing with 2 additions and 5 deletions.
  1. +2 −5 share/chruby/chruby.sh
View
@@ -40,13 +40,10 @@ function chruby_use()
export PATH="$RUBY_ROOT/bin:$PATH"
eval `$RUBY_ROOT/bin/ruby - <<EOF
+begin; require 'rubygems'; rescue LoadError; end
puts "export RUBY_ENGINE=#{defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'};"
puts "export RUBY_VERSION=#{RUBY_VERSION};"
-begin
- require 'rubygems'
- puts "export GEM_ROOT=#{Gem.default_dir.inspect};"
-rescue LoadError
-end
+puts "export GEM_ROOT=#{Gem.default_dir.inspect};" if defined?(Gem)
EOF`
if [[ ! $UID -eq 0 ]]; then

0 comments on commit ed41bf5

Please sign in to comment.