rvm 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,8 +5,17 @@ unset GREP_OPTIONS
5
5
  source "$rvm_path/scripts/base"
6
6
 
7
7
  usage() {
8
- echo "Usage: rvm migrate from to" >&2
9
- echo "Moves all gemsets from one ruby to another." >&2
8
+ printf "
9
+
10
+ Usage:
11
+
12
+ rvm migrate {source-ruby} {destination-ruby}
13
+
14
+ Description:
15
+
16
+ Moves all gemsets from {source-ruby} ruby to {destination-ruby}.
17
+
18
+ " >&2
10
19
  }
11
20
 
12
21
  confirm() {
@@ -43,10 +52,10 @@ migrate_rubies() {
43
52
  elif [[ "$expanded_destination" = "$expanded_source" ]]; then
44
53
  die_with_error "Source and Destination Ruby are the same ($expanded_destination)"
45
54
 
46
- elif [[ ! -d "$rvm_rubies_path/$expanded_source" ]]; then
55
+ elif [[ ! -d "$rvm_path/rubies/$expanded_source" ]]; then
47
56
  die_with_error "Ruby '$expanded_source' is not installed - please install it first."
48
57
 
49
- elif [[ ! -d "$rvm_rubies_path/$expanded_destination" ]]; then
58
+ elif [[ ! -d "$rvm_path/rubies/$expanded_destination" ]]; then
50
59
  die_with_error "Ruby '$expanded_destination' is not installed - please install it first."
51
60
  fi
52
61
 
@@ -69,15 +78,15 @@ migrate_rubies() {
69
78
 
70
79
  echo "Moving $origin_gemset to $destination_gemset"
71
80
 
72
- rm -rf "$rvm_gems_path/$destination_gemset"
81
+ rm -rf "${rvm_gems_path:-"$rvm_path/gems"}/$destination_gemset"
73
82
  result="$?"
74
83
 
75
- [[ $result -gt 0 ]] && die_with_error "Unable to remove gem directory '$rvm_gems_path/$destination_gemset'" "$result"
84
+ [[ $result -gt 0 ]] && die_with_error "Unable to remove gem directory '${rvm_gems_path:-"$rvm_path/gems"}/$destination_gemset'" "$result"
76
85
 
77
- mv "$rvm_gems_path/$origin_gemset" "$rvm_gems_path/$destination_gemset"
86
+ mv "${rvm_gems_path:-"$rvm_path/gems"}/$origin_gemset" "${rvm_gems_path:-"$rvm_path/gems"}/$destination_gemset"
78
87
  result="$?"
79
88
 
80
- [[ $result -gt 0 ]] && die_with_error "Unable to move '$rvm_gems_path/$origin_gemset' to '$rvm_gems_path/$destination_gemset'" "$result"
89
+ [[ $result -gt 0 ]] && die_with_error "Unable to move '${rvm_gems_path:-"$rvm_path/gems"}/$origin_gemset' to '${rvm_gems_path:-"$rvm_path/gems"}/$destination_gemset'" "$result"
81
90
 
82
91
  echo "Making gemset $destination_gemset pristine."
83
92
 
@@ -105,19 +114,19 @@ migrate_rubies() {
105
114
  "$rvm_path/scripts/alias" create "$migrate_alias_name" "$migrate_new_alias_name" >/dev/null 2>&1
106
115
  fi
107
116
 
108
- done < "$rvm_config_path/alias"
117
+ done < "$rvm_path/config/alias"
109
118
 
110
119
  fi
111
120
 
112
121
  if confirm "Do you wish to move over wrappers?" ; then
113
122
 
114
- origin_wrappers_path="$rvm_wrappers_path/$expanded_source"
123
+ origin_wrappers_path="$rvm_path/wrappers/$expanded_source"
115
124
 
116
- binaries=($(cd "$rvm_bin_path" ; find . -maxdepth 1 -mindepth 1 -type f))
125
+ binaries=($(cd "${rvm_bin_path:-"$rvm_path/bin"}" ; find . -maxdepth 1 -mindepth 1 -type f))
117
126
 
118
127
  for binary_name in "${binaries[@]//.\/}" ; do
119
128
 
120
- full_bin_path="$rvm_bin_path/$binary_name"
129
+ full_bin_path="${rvm_bin_path:-"$rvm_path/bin"}/$binary_name"
121
130
 
122
131
  [[ ! -L "$full_bin_path" ]] && continue
123
132
 
@@ -32,7 +32,7 @@ dependencies:
32
32
  jruby: aptitude install curl sun-java6-bin sun-java6-jre sun-java6-jdk
33
33
 
34
34
  # For MRI & ree (if you wish to use it) you will need (depending on what you are installing):
35
- ruby: aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libreadline-dev libxml2-dev git-core
35
+ ruby: aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
36
36
  ruby-head: git subversion autoconf
37
37
 
38
38
  # For IronRuby (if you wish to use it) you will need:
@@ -12,49 +12,67 @@ library="${args[1]:-""}"
12
12
  args="$(echo ${args[@]:2})"
13
13
 
14
14
  install_package() {
15
+ local result
15
16
 
16
17
  __rvm_db "${package}_url" "package_url"
17
18
 
18
19
  if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi
19
20
 
20
21
  (
21
- builtin cd "$rvm_src_path"
22
+ builtin cd "${rvm_src_path:-"$rvm_path/src"}"
22
23
 
23
- "$rvm_path/scripts/log" "info" "Fetching $package-$version.$archive_format to $rvm_archives_path"
24
+ "$rvm_path/scripts/log" "info" "Fetching $package-$version.$archive_format to ${rvm_archives_path:-"$rvm_path/archives"}"
24
25
 
25
26
  if [[ "$archive_format" = "tar.gz" ]] || [[ "$archive_format" = "tgz" ]] ; then
26
- "$rvm_path/scripts/fetch" "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
27
- __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format to $rvm_src_path"
27
+ "$rvm_path/scripts/fetch" \
28
+ "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
29
+
30
+ __rvm_run "$package/extract" \
31
+ "tar zxf ${rvm_archives_path:-"$rvm_path/archives"}/$package-$version.$archive_format -C ${rvm_src_path:-"$rvm_path/src"}" "Extracting $package-$version.$archive_format to ${rvm_src_path:-"$rvm_path/src"}"
28
32
 
29
33
  elif [[ "$archive_format" = "tar.bz2" ]] ; then
30
- "$rvm_path/scripts/fetch" "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
31
- __rvm_run "$package/extract" "tar jxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format to $rvm_src_path"
34
+ "$rvm_path/scripts/fetch" \
35
+ "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
36
+
37
+ __rvm_run "$package/extract" \
38
+ "tar jxf ${rvm_archives_path:-"$rvm_path/archives"}/$package-$version.$archive_format -C ${rvm_src_path:-"$rvm_path/src"}" "Extracting $package-$version.$archive_format to ${rvm_src_path:-"$rvm_path/src"}"
32
39
 
33
40
  elif [[ "$archive_format" = "zip" ]] ; then
34
- "$rvm_path/scripts/fetch" "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
35
- __rvm_run "$package/extract" "unzip -q -o $rvm_archives_path/$package-$version.$archive_format -d $rvm_src_path/$package-$version" "Extracting $package-$version.$archive_format to $rvm_src_path"
41
+ "$rvm_path/scripts/fetch" \
42
+ "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
43
+
44
+ __rvm_run "$package/extract" \
45
+ "unzip -q -o ${rvm_archives_path:-"$rvm_path/archives"}/$package-$version.$archive_format -d ${rvm_src_path:-"$rvm_path/src"}/$package-$version" "Extracting $package-$version.$archive_format to ${rvm_src_path:-"$rvm_path/src"}"
36
46
 
37
47
  else
38
48
  printf "\nUnrecognized archive format '$archive_format'" ; return 1
39
49
  fi
40
50
 
41
- builtin cd "$rvm_src_path/$package-$version"
51
+ builtin cd "${rvm_src_path:-"$rvm_path/src"}/$package-$version"
42
52
 
43
- __rvm_run "$package/configure" "${configure:-"./configure --prefix=${prefix_path:-"$rvm_usr_path"}"} $configure_flags" "Configuring $package in $rvm_src_path/$package-$version."
53
+ __rvm_run "$package/configure" \
54
+ "${configure:-"./configure --prefix=${prefix_path:-"${rvm_usr_path:-"$rvm_path/usr"}"}"} $configure_flags" "Configuring $package in ${rvm_src_path:-"$rvm_path/src"}/$package-$version."
44
55
 
45
56
  unset configure_flags
46
57
 
47
58
  if [[ "$action" = "uninstall" ]] ; then
48
- __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "Uninstalling $package from $rvm_usr_path"
59
+ __rvm_run "$package/make.uninstall" \
60
+ "/usr/bin/make uninstall" "Uninstalling $package from ${rvm_usr_path:-"$rvm_path/usr"}"
49
61
 
50
62
  else
51
- __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package in $rvm_src_path/$package-$version."
52
- __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_usr_path"
63
+ __rvm_run "$package/make" \
64
+ "/usr/bin/make $rvm_make_flags" "Compiling $package in ${rvm_src_path:-"$rvm_path/src"}/$package-$version."
65
+
66
+ __rvm_run "$package/make.install" \
67
+ "/usr/bin/make install" "Installing $package to ${rvm_usr_path:-"$rvm_path/usr"}"
53
68
  fi
54
69
 
55
- \touch "$rvm_config_path/packages"
56
- "$rvm_path/scripts/db" "$rvm_config_path/packages" "${package}" "${version}"
70
+ touch "$rvm_path/config/packages"
71
+ "$rvm_path/scripts/db" "$rvm_path/config/packages" "${package}" "${version}"
57
72
  )
73
+ result=$?
74
+
75
+ return $result
58
76
  }
59
77
 
60
78
  readline() {
@@ -119,7 +137,7 @@ openssl() {
119
137
  else
120
138
  configure_command="./config"
121
139
  fi
122
- configure="$configure_command $openssl_os -I$rvm_usr_path/include -L$rvm_usr_path/lib --prefix=$rvm_usr_path zlib no-asm no-krb5 shared"
140
+ configure="$configure_command $openssl_os -I${rvm_usr_path:-"$rvm_path/usr"}/include -L${rvm_usr_path:-"$rvm_path/usr"}/lib --prefix=${rvm_usr_path:-"$rvm_path/usr"} zlib no-asm no-krb5 shared"
123
141
  install_package
124
142
  }
125
143
 
@@ -130,7 +148,7 @@ zlib() {
130
148
 
131
149
  autoconf() {
132
150
  package="autoconf" ; version="2.65" ; archive_format="tar.gz"
133
- prefix_path="${rvm_bin_path:-"${rvm_path:-"$HOME/.rvm"}"}"
151
+ prefix_path="${rvm_usr_path:-"$rvm_path/usr"}"
134
152
  install_package
135
153
  }
136
154
 
@@ -153,7 +171,7 @@ gettext() {
153
171
  libxml2() {
154
172
  package="libxml2" ; version="2.7.3" ; archive_format="tar.gz"
155
173
  if [[ "Darwin" = "$(uname)" ]] ; then
156
- configure="./configure --prefix=${rvm_usr_path} --build=i686-apple-darwin$(uname -r) --host=i686-apple-darwin$(uname -r)"
174
+ configure="./configure --prefix=${rvm_usr_path:-"$rvm_path/usr"} --build=i686-apple-darwin$(uname -r) --host=i686-apple-darwin$(uname -r)"
157
175
  fi
158
176
  install_package
159
177
  unset prefix_path
@@ -163,7 +181,7 @@ glib() {
163
181
  pkgconfig
164
182
  gettext
165
183
  package="glib" ; version="2.23.1" ; archive_format="tar.gz"
166
- configure="CC=\"cc -L$rvm_usr_path/lib -I$rvm_usr_path/include\" PKG_CONFIG=\"$rvm_usr_path/bin/pkg-config\" ./configure --prefix=$rvm_usr_path"
184
+ configure="CC=\"cc -L${rvm_usr_path:-"$rvm_path/usr"}/lib -I${rvm_usr_path:-"$rvm_path/usr"}/include\" PKG_CONFIG=\"${rvm_usr_path:-"$rvm_path/usr"}/bin/pkg-config\" ./configure --prefix=${rvm_usr_path:-"$rvm_path/usr"}"
167
185
 
168
186
  install_package
169
187
  }
@@ -180,12 +198,12 @@ llvm() {
180
198
  package="llvm" ; version="89156"
181
199
  if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi
182
200
  (
183
- builtin cd $rvm_src_path
184
- if [[ ! -d "$rvm_src_path/llvm/.svn" ]] ; then
201
+ builtin cd ${rvm_src_path:-"$rvm_path/src"}
202
+ if [[ ! -d "${rvm_src_path:-"$rvm_path/src"}/llvm/.svn" ]] ; then
185
203
  __rvm_db "${package}_url" "package_url"
186
- \rm -rf "$rvm_src_path/llvm"
204
+ \rm -rf "${rvm_src_path:-"$rvm_path/src"}/llvm"
187
205
  svn co -r "$version" "$package_url" llvm
188
- builtin cd "$rvm_src_path/llvm"
206
+ builtin cd "${rvm_src_path:-"$rvm_path/src"}/llvm"
189
207
  ./configure --enable-bindings=none
190
208
  UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make -j2
191
209
  sudo env UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make install
@@ -11,13 +11,19 @@ usage() {
11
11
  # related to wrappers.
12
12
  repair_symlinks() {
13
13
  (
14
- builtin cd "$rvm_bin_path"
14
+ builtin cd "${rvm_bin_path:-"$rvm_path/bin"}"
15
+
15
16
  for executable_name in $(\find \. -type l); do
16
- [[ -e "$executable_name" || "$(readlink "$executable_name")" != "$rvm_wrappers_path/"* ]] && continue
17
+
18
+ [[ -e "$executable_name" || "$(readlink "$executable_name")" != "$rvm_path/wrappers/"* ]] && continue
19
+
17
20
  if [[ -f "$executable_name" ]] ; then
21
+
18
22
  "$rvm_path/scripts/log" "info" \
19
23
  "Removing stale symlink from $(basename "$executable_name")"
24
+
20
25
  \rm -f "$executable_name"
26
+
21
27
  fi
22
28
  done
23
29
  )
@@ -27,16 +33,16 @@ repair_symlinks() {
27
33
  repair_environments() {
28
34
  local environment_name environments
29
35
 
30
- environments=($(cd "$rvm_environments_path" ; find . -maxdepth 1 -mindepth 1 -type f))
36
+ environments=($(cd "$rvm_path/environments" ; find . -maxdepth 1 -mindepth 1 -type f))
31
37
 
32
38
  for environment_name in "${environments[@]//.\/}" ; do
33
39
 
34
- [[ -L "$rvm_environments_path/$environment_name" ]] && continue
40
+ [[ -L "$rvm_path/environments/$environment_name" ]] && continue
35
41
 
36
42
  "$rvm_path/scripts/log" "info" \
37
43
  "Regenerating environment file for '$environment_name'"
38
44
 
39
- [[ -f "$rvm_environments_path/$environment_name" ]] && \rm -f "$rvm_environments_path/$environment_name"
45
+ [[ -f "$rvm_path/environments/$environment_name" ]] && \rm -f "$rvm_path/environments/$environment_name"
40
46
 
41
47
  (
42
48
  source "$rvm_path/scripts/base"
@@ -54,21 +60,21 @@ repair_archives() {
54
60
 
55
61
  local archive_file archives stored_md5sum
56
62
 
57
- archives=($(cd "$rvm_archives_path" ; find . -maxdepth 1 -mindepth 1 -type f))
63
+ archives=($(cd "${rvm_archives_path:-"$rvm_path/archives"}" ; find . -maxdepth 1 -mindepth 1 -type f))
58
64
 
59
65
  for archive_file in "${archives[@]//.\/}" ; do
60
66
 
61
- [[ -f "$rvm_archives_path/$archive_file" ]] || continue
67
+ [[ -f "${rvm_archives_path:-"$rvm_path/archives"}/$archive_file" ]] || continue
62
68
 
63
- stored_md5sum="$($rvm_path/scripts/db "$rvm_config_path/md5" "$archive_file" | head -n1)"
69
+ stored_md5sum="$($rvm_path/scripts/db "$rvm_path/config/md5" "$archive_file" | head -n1)"
64
70
 
65
71
  if [[ -n "$stored_md5sum" ]] ; then
66
72
 
67
- if [[ ! "$rvm_path/scripts/md5" "$rvm_archives_path/$archive_file" "$stored_md5sum" ]] ; then
73
+ if [[ ! "$rvm_path/scripts/md5" "${rvm_archives_path:-"$rvm_path/archives"}/$archive_file" "$stored_md5sum" ]] ; then
68
74
 
69
75
  "$rvm_path/scripts/log" "info" "Removing archive for '$archive_file' - Incorrect md5 checksum."
70
76
 
71
- rm -rf "$rvm_archives_path/$archive_file"
77
+ rm -rf "${rvm_archives_path:-"$rvm_path/archives"}/$archive_file"
72
78
  fi
73
79
  fi
74
80
  done
@@ -7,8 +7,11 @@ result=0
7
7
  __rvm_become
8
8
 
9
9
  rubygems_setup() {
10
+
10
11
  __rvm_warn_on_rubyopt
12
+
11
13
  unset RUBYOPT
14
+
12
15
  if [[ ! -z "$(echo "$rvm_ruby_version" | awk '/^1\.9/')" ]] || [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^mput/')" ]] ; then
13
16
  install=0
14
17
  elif [[ "$rvm_ruby_string" = "ruby-head" ]] ; then
@@ -20,14 +23,25 @@ rubygems_setup() {
20
23
  fi
21
24
 
22
25
  if [[ "$install" -eq 0 ]] ; then
23
- "$rvm_path/scripts/log" "error" "Cannot switch to ${version} for this interpreter."
26
+
27
+ "$rvm_path/scripts/log" "error" \
28
+ "Cannot switch to ${version} for this interpreter."
29
+
24
30
  exit 1
31
+
25
32
  else
26
- "$rvm_path/scripts/log" "info" "Removing old Rubygems files..."
33
+
34
+ "$rvm_path/scripts/log" "info" \
35
+ "Removing old Rubygems files..."
36
+
27
37
  rubygems_dir="$(ruby -rrbconfig -e "puts Config::CONFIG.values_at('sitelibdir','vendorlibdir').detect {|path| File.directory?(File.join(path, 'rubygems')) }.to_s")"
38
+
28
39
  if [[ -n "$rubygems_dir" && -d "$rubygems_dir" ]]; then
40
+
29
41
  # Remove common files installed by ruby gems.
30
- \rm -rf "${rubygems_dir}/ubygems.rb" "${rubygems_dir}/rubygems.rb" "${rubygems_dir}/rubygems" "${rubygems_dir}/gauntlet_rubygems.rb"
42
+ \rm -rf "${rubygems_dir}/ubygems.rb" "${rubygems_dir}/rubygems.rb" \
43
+ "${rubygems_dir}/rubygems" "${rubygems_dir}/gauntlet_rubygems.rb"
44
+
31
45
  fi
32
46
 
33
47
  "$rvm_path/scripts/log" "info" "Installing rubygems dedicated to $rvm_ruby_string..."
@@ -38,28 +52,52 @@ rubygems_setup() {
38
52
 
39
53
  # Sanity check... If setup.rb is missing from the rubygems source path,
40
54
  # something went wrong. Cleanup, aisle 3!
41
- if [[ ! -f "$rvm_src_path/$rvm_gem_package_name/setup.rb" ]]; then
42
- \rm -rf "$rvm_src_path/$rvm_gem_package_name"
55
+ if [[ ! -f "${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name/setup.rb" ]]; then
56
+ \rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name"
43
57
  fi
44
58
 
45
- if [[ ! -d "$rvm_src_path/$rvm_gem_package_name" ]] ; then
46
- "$rvm_path/scripts/log" "info" "Retrieving $rvm_gem_package_name"
47
- "$rvm_path/scripts/fetch" "$rvm_gem_url"
48
- result=$? ; if [[ "$result" -gt 0 ]] ; then
49
- "$rvm_path/scripts/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; return $result
59
+ if [[ ! -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name" ]] ; then
60
+
61
+ "$rvm_path/scripts/log" "info" \
62
+ "Retrieving $rvm_gem_package_name"
63
+
64
+ "$rvm_path/scripts/fetch" "$rvm_gem_url" ; result=$?
65
+
66
+ if [[ "$result" -gt 0 ]] ; then
67
+
68
+ "$rvm_path/scripts/log" "error" \
69
+ "There has been an error while trying to fetch the source. Aborting the installation."
70
+
71
+ return $result
72
+
50
73
  fi
51
- \mkdir -p "$rvm_src_path/$rvm_gem_package_name"
52
- __rvm_run "rubygems.extract" "gunzip < $rvm_archives_path/$rvm_gem_package_name.tgz | tar xf - -C $rvm_src_path" "Extracting $rvm_gem_package_name ..."
74
+
75
+ if [[ ! -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name" ]] ; then
76
+ \mkdir -p "${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name"
77
+ fi
78
+
79
+ __rvm_run "rubygems.extract" \
80
+ "gunzip < ${rvm_archives_path:-"$rvm_path/archives"}/$rvm_gem_package_name.tgz | tar xf - -C ${rvm_src_path:-"$rvm_path/src"}" \
81
+ "Extracting $rvm_gem_package_name ..."
53
82
  fi
54
83
 
55
- builtin cd "$rvm_src_path/$rvm_gem_package_name"
84
+ builtin cd "${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name"
56
85
 
57
- __rvm_run "rubygems.install" "GEM_PATH=$rvm_ruby_gem_path GEM_HOME=$rvm_ruby_gem_home BUNDLE_PATH=$rvm_ruby_gem_home $rvm_ruby_home/bin/ruby $rvm_src_path/$rvm_gem_package_name/setup.rb" "Installing rubygems for $rvm_ruby_home/bin/ruby"
86
+ __rvm_run "rubygems.install" \
87
+ "GEM_PATH=\"$rvm_ruby_gem_path:$rvm_ruby_global_gems_path\" GEM_HOME=\"$rvm_ruby_gem_home\" BUNDLE_PATH=\"$rvm_ruby_gem_home $rvm_ruby_home/bin/ruby\" \"${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name/setup.rb\"" \
88
+ "Installing rubygems for $rvm_ruby_home/bin/ruby"
58
89
  result=$?
90
+
59
91
  if [[ "$result" == 0 ]] ; then
60
- "$rvm_path/scripts/log" "info" "Installation of rubygems completed successfully."
92
+
93
+ "$rvm_path/scripts/log" "info" \
94
+ "Installation of rubygems completed successfully."
95
+
61
96
  else
62
- "$rvm_path/scripts/log" "warning" "Installation of rubygems did not complete successfully."
97
+
98
+ "$rvm_path/scripts/log" "warning" \
99
+ "Installation of rubygems did not complete successfully."
100
+
63
101
  fi
64
102
 
65
103
  if [[ ! -z "$rvm_ruby_major_version" ]] ; then
@@ -80,8 +118,12 @@ rubygems_setup() {
80
118
  }
81
119
 
82
120
  if ! command -v ruby > /dev/null ; then
83
- "$rvm_path/scripts/log" "error" "'ruby' was not found, cannot install rubygems unless ruby is present (Do you have an RVM ruby installed & selected?)"
121
+
122
+ "$rvm_path/scripts/log" "error" \
123
+ "'ruby' was not found, cannot install rubygems unless ruby is present (Do you have an RVM ruby installed & selected?)"
124
+
84
125
  exit 1
126
+
85
127
  fi
86
128
 
87
129
  #
@@ -92,15 +134,23 @@ version="${args[0]}"
92
134
  args="$(echo ${args[@]:1}) " # Strip trailing / leading / extra spacing.
93
135
 
94
136
  if [[ -z "$version" ]] ; then
95
- "$rvm_path/scripts/log" "error" "A version must be specified, for example 'rvm rubygems 1.3.7'"
137
+
138
+ "$rvm_path/scripts/log" "error" \
139
+ "A version must be specified, for example 'rvm rubygems 1.3.7'"
140
+
96
141
  exit 1
142
+
97
143
  fi
98
144
 
99
145
  # Update the rubygems to the current.
100
146
  if [[ "$version" = "current" ]]; then
147
+
101
148
  version="$(__rvm_db "${rvm_ruby_interpreter}_rubygems_version")"
149
+
102
150
  version="${rvm_rubygems_version:-"$(__rvm_db "rubygems_version")"}"
151
+
103
152
  fi
153
+
104
154
  rubygems_setup
105
155
 
106
156
  exit $result
@@ -5,7 +5,7 @@
5
5
  # http://github.com/wayneeseguin/rvm
6
6
 
7
7
  if [[ ${rvm_loaded_flag:-0} -eq 0 || ${rvm_reload_flag:-0} -eq 1 ]] ; then
8
- rvm_reload_flag=0
8
+ unset rvm_reload_flag
9
9
 
10
10
  if [[ -z "$rvm_ignore_rvmrc" ]]; then
11
11
  for rvmrc in /etc/rvmrc $HOME/.rvmrc ; do
@@ -39,36 +39,51 @@ if [[ ${rvm_loaded_flag:-0} -eq 0 || ${rvm_reload_flag:-0} -eq 1 ]] ; then
39
39
 
40
40
  # Fix rvm_prefix changes.
41
41
  echo "$rvm_prefix" | \grep -vq '\(\/\|\.\)$' && [[ -d "$rvm_prefix/rvm/scripts" ]]
42
+
42
43
  rvm_prefix_needs_trailing_slash="$?"
44
+
43
45
  if [[ "$rvm_prefix" = "/usr/local" || "$rvm_prefix_needs_trailing_slash" = "0" ]]; then
46
+
44
47
  rvm_prefix="$rvm_prefix/"
48
+
45
49
  fi
46
- unset rvm_prefix_needs_trailing_slash
47
50
 
48
51
  if [[ -z "$rvm_path" ]] ; then
49
52
  rvm_path="${rvm_prefix}rvm"
50
53
  fi
51
54
 
52
55
  if [[ -d "$rvm_path" ]] ; then
56
+
53
57
  for script in array utility initialize version selector cli cd override_gem ; do
58
+
54
59
  if [[ -f "$rvm_path/scripts/$script" ]] ; then
60
+
55
61
  source "$rvm_path/scripts/$script"
62
+
56
63
  else
57
- "$rvm_path/scripts/log" "error" "RVM: Could not source script '$rvm_path/scripts/$script', file does not exist. RVM will likely not work as expected."
64
+
65
+ "$rvm_path/scripts/log" "error" \
66
+ "RVM: Could not source script '$rvm_path/scripts/$script', file does not exist. RVM will likely not work as expected."
67
+
58
68
  fi
59
69
  done
60
70
 
61
71
  rvm_loaded_flag=1
62
72
 
63
73
  rvm_version="$(awk '/:/{printf $NF"."}' "$rvm_path/lib/VERSION.yml")"
74
+
64
75
  export rvm_version="${rvm_version/%.}"
65
76
 
66
77
  alias rvm-restart="source '${rvm_path}/scripts/rvm'"
67
78
 
68
79
  if ! command -v ruby >/dev/null 2>&1 || command -v ruby | \grep -v rvm >/dev/null ; then
69
- if [[ -s "$rvm_environments_path/default" ]] ; then
70
- source "$rvm_environments_path/default"
80
+
81
+ if [[ -s "$rvm_path/environments/default" ]] ; then
82
+
83
+ source "$rvm_path/environments/default"
84
+
71
85
  fi
86
+
72
87
  fi
73
88
 
74
89
  # Makes sure rvm_bin_path is in PATH atleast once.
@@ -77,5 +92,7 @@ if [[ ${rvm_loaded_flag:-0} -eq 0 || ${rvm_reload_flag:-0} -eq 1 ]] ; then
77
92
  else
78
93
  printf "\n\$rvm_path is not set. rvm cannot load."
79
94
  fi
95
+
96
+ unset rvm_prefix_needs_trailing_slash rvm_bin_path rvm_man_path rvm_rc_files rvm_gems_path rvm_gems_cache_path rvm_selfcontained rvm_interactive_flag rvm_gems_path rvm_project_rvmrc_default rvm_gemset_separator
80
97
  fi
81
98