rvm 0.0.67 → 0.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 67
4
+ :patch: 68
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.67"
8
+ s.version = "0.0.68"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wayne E. Seguin"]
12
- s.date = %q{2009-10-29}
12
+ s.date = %q{2009-10-30}
13
13
  s.default_executable = %q{rvm-install}
14
14
  s.description = %q{Manages Ruby interpreter installations and switching between them.}
15
15
  s.email = %q{wayneeseguin@gmail.com}
@@ -4,14 +4,16 @@ function __rvm_meta {
4
4
  rvm_meta_author="Wayne E. Seguin"
5
5
  rvm_meta_author_email="wayneeseguin@gmail.com"
6
6
  rvm_meta_website="http://rvm.beginrescueend.com/"
7
- rvm_meta_version="$(cat $rvm_path/lib/VERSION.yml | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')"
7
+ rvm_meta_version="${rvm_version}"
8
8
  }
9
9
 
10
10
  function __rvm_version { __rvm_meta ; echo "rvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]" ; }
11
11
 
12
- function __rvm_usage { cat "$rvm_path/README" | ${PAGER:-less} ; }
12
+ function __rvm_usage { cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} ; }
13
13
 
14
14
  function __rvm_parse_args {
15
+ if [[ ! -z "$(echo "$*" | awk '/trace/')" ]] ; then echo "$*" ; fi
16
+
15
17
  while [[ $# -gt 0 ]] ; do
16
18
  rvm_token="$1" ; shift
17
19
  case "$rvm_token" in
@@ -37,6 +39,7 @@ function __rvm_parse_args {
37
39
  system|default)
38
40
  rvm_action=${rvm_action:-use}
39
41
  rvm_ruby_interpreter="$rvm_token"
42
+ rvm_ruby_string="$rvm_token"
40
43
  ;;
41
44
 
42
45
  jruby|ree|macruby|rbx|rubinius|mput|shyouhei|default|all)
@@ -177,6 +180,7 @@ function __rvm_parse_args {
177
180
  ;;
178
181
 
179
182
  --head)
183
+ if [[ -z "$rvm_ruby_string" ]] ; then rvm_ruby_string="head"; else rvm_ruby_string="${rvm_ruby_string}-head" ; fi
180
184
  rvm_ruby_revision="head"
181
185
  rvm_head_flag=1
182
186
  rvm_action="${rvm_action:-use}"
@@ -251,6 +255,7 @@ function __rvm_parse_args {
251
255
  default|system)
252
256
  rvm_action="use"
253
257
  rvm_ruby_interpreter="system"
258
+ rvm_ruby_string="$rvm_token"
254
259
  ;;
255
260
 
256
261
  --install) rvm_install_on_use_flag=1 ;;
@@ -346,6 +351,13 @@ function rvm {
346
351
 
347
352
  trap '__rvm_cleanup_variables ; rm -rf "/tmp/rvm/$$" >/dev/null 2>&1' 0 1 2 3 15
348
353
 
354
+ # Check that this is the current version.
355
+ disk_version=$(cat "${rvm_path:-$HOME/.rvm}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')
356
+ if [[ "${rvm_version}" != "${disk_version}" ]] && [[ "reload" != "$1" ]]; then
357
+ echo -e "A newer version of rvm has been installed ($disk_version) than is loaded ($rvm_version), please do one of the following:\n * 'rvm reload'\n * open a new shell\n * source your shell init scripts"
358
+ return 1
359
+ fi
360
+
349
361
  __rvm_cleanup_variables
350
362
  __rvm_load_rvmrc
351
363
  __rvm_initialize
@@ -171,8 +171,7 @@ __rvm_gems_load() {
171
171
 
172
172
  if [[ -f "$gem" ]] ; then
173
173
  gem_file_name="$gem"
174
- cache_file="$gem"
175
- elif match "$gem" ".gem$" ]] ; then
174
+ elif match "$gem" ".gem$" ; then
176
175
  gem_file_name="$gem"
177
176
  elif [[ -z "${gem_version/ /}" ]] ; then # no version
178
177
  gem_file_name="${gem_name/ /}*.gem"
@@ -180,20 +179,23 @@ __rvm_gems_load() {
180
179
  gem_file_name="${gem_name/ /}-${gem_version/ /}.gem"
181
180
  fi
182
181
 
183
- if [[ -z "$rvm_force_flag" ]] && [[ -f "${rvm_ruby_gem_home}/specifications/${gem_file_name}" ]] ; then
182
+ if [[ -z "$rvm_force_flag" ]] && [[ -f "${rvm_ruby_gem_home}/specifications/${gem_file_name}spec" ]] ; then
184
183
  unset gem
185
184
  __rvm_log "warn" "$(__color "yellow")$gem_name $gem_version$(__color "none") exists, skipping (--force to re-install)"
186
185
  else
187
- set -x
188
- if [[ -f "$rvm_gem_path/cache/${gem_file_name}" ]] ; then
186
+ if [[ -f "$gem" ]] ; then
187
+ cache_file="$gem"
188
+ elif [[ -f "$rvm_gem_path/cache/${gem_file_name}" ]] ; then
189
189
  cache_file="$rvm_gem_path/cache/${gem_file_name}"
190
190
  else
191
- cache_file="${cache_file:-$(/bin/ls -t "${rvm_gem_path}/*/*/cache/${gem_file_name}*" 2> /dev/null | head -n1)}"
192
- if [[ -f "$cache_file" ]] ; then
193
- cp "$cache_file" "$rvm_gem_path/cache/$(basename "$cache_file")"
191
+ cache_file="${cache_file:-$(ls ${rvm_gem_path}/*/*/cache/${gem_file_name}* 2> /dev/null | sort | head -n1)}"
192
+ if [[ ! -z "$cache_file" ]] && [[ -f "$cache_file" ]] ; then
193
+ if [[ "$(dirname $cache_file)" != "$rvm_gem_path/cache/" ]] ; then
194
+ cp "$cache_file" "$rvm_gem_path/cache/"
195
+ cache_file="$rvm_gem_path/cache/$(basename $cache_file)"
196
+ fi
194
197
  fi
195
198
  fi
196
- set +x
197
199
 
198
200
  if [[ -z "$cache_file" ]] ; then
199
201
  if [[ -f "$gem_file_name" ]] ; then
@@ -210,7 +212,7 @@ __rvm_gems_load() {
210
212
  # TODO: Switch this to use match
211
213
  if [[ ! -z "$(echo "$rvm_ruby_gem_list" | awk "/${gem_name/ /} \(.*$gem_version/{print}")" ]] ; then
212
214
  if [[ ! -z "$rvm_force_flag" ]] ; then
213
- gem="$rvm_temp_path/$gem_file_name" # install as a named local gem
215
+ gem="$rvm_gem_path/cache/$gem_file_name" # install as a named local gem
214
216
  fi
215
217
  else
216
218
  gem="$cache_file"
@@ -9,7 +9,7 @@ require "irb/ext/save-history"
9
9
  IRB.conf[:HISTORY_FILE] = File.join(ENV["HOME"], ".irb-history")
10
10
 
11
11
  # Calculate the ruby string.
12
- rvm_ruby_string = ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_VERSION}-#{(RUBY_PATCHLEVEL) ? "p#{RUBY_PATCHLEVEL}" : "r#{RUBY_REVISION}"}"
12
+ rvm_ruby_string = ENV["rvm_ruby_string"] || "#{RUBY_ENGINE rescue 'ruby'}-#{RUBY_VERSION}-#{(RUBY_PATCHLEVEL) ? "p#{RUBY_PATCHLEVEL}" : "r#{RUBY_REVISION}"}"
13
13
 
14
14
  # Set up the prompt to be RVM specific.
15
15
  @prompt = {
@@ -24,8 +24,10 @@ IRB.conf[:PROMPT][:RVM] = @prompt
24
24
  IRB.conf[:PROMPT_MODE] = :RVM
25
25
 
26
26
  # Load the user's irbrc file, if possible.
27
- if File.exists?("#{ENV["HOME"]}/.irbrc_disabled")
28
- load File.join(ENV["HOME"], ".irbrc") rescue nil
27
+ begin
28
+ load File.join(ENV["HOME"], ".irbrc") if File.exists?("#{ENV["HOME"]}/.irbrc")
29
+ rescue => exception
30
+ puts "Error : 'load #{ENV["HOME"]}/.irbrc' : #{exception.message}"
29
31
  end
30
32
 
31
33
  # EOF
@@ -12,7 +12,8 @@ function __rvm_install_source {
12
12
  fi
13
13
 
14
14
  result=0
15
- if [[ -z "$rvm_ruby_tag" ]] && [[ -z "$rvm_ruby_revision" ]] ; then
15
+ # TODO: This really should be about the url instead of this hokey logic.
16
+ if [[ -z "$rvm_head_flag" ]] && [[ -z "$rvm_ruby_tag" ]] && [[ -z "$rvm_ruby_revision" ]] ; then
16
17
  if [[ ! -f "$rvm_archives_path/$rvm_ruby_package_name.tar.gz" ]] ; then
17
18
  rvm_url="${rvm_url:-"ftp://ftp.ruby-lang.org/pub/ruby/1.$rvm_major_version/$rvm_ruby_package_name.tar.gz"}"
18
19
  __rvm_log "info" "Downloading $rvm_ruby_package_name, this may take a while depending on your connection..."
@@ -23,18 +24,24 @@ function __rvm_install_source {
23
24
  __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_name.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_package_name ..."
24
25
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
25
26
  else
26
- __rvm_log "info" "Retrieving Ruby from $rvm_url"
27
27
  if [[ ! -z "$(echo $rvm_url | awk '/^git/')" ]] ; then
28
+
28
29
  if [[ -d "$rvm_ruby_src_path/.git" ]] ; then
29
30
  cd $rvm_ruby_src_path
30
31
  if [[ -z "$rvm_ruby_revision" ]] ; then
32
+ __rvm_log "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..."
31
33
  git pull origin master
32
34
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
33
35
  else
34
- git checkout ${rvm_ruby_revision:-HEAD}
36
+ if [[ -z "$rvm_ruby_sha" ]] ; then
37
+ git checkout HEAD
38
+ else
39
+ git checkout $(echo $rvm_ruby_sha | sed 's#^s##')
40
+ fi
35
41
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
36
42
  fi
37
43
  else
44
+ __rvm_log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
38
45
  git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path
39
46
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
40
47
  fi
@@ -49,19 +56,21 @@ function __rvm_install_source {
49
56
  rvm_rev=""
50
57
  else
51
58
  rvm_url=$rvm_ruby_repo_url/branches/ruby_1_${rvm_major_version}_${rvm_minor_version}
52
- rvm_rev="-r $rvm_ruby_revision"
59
+ rvm_rev="-$rvm_ruby_revision"
53
60
  fi
54
61
  fi
55
62
 
56
63
  if [[ -d "$rvm_ruby_src_path/.svn" ]] ; then
57
64
  cd $rvm_ruby_src_path
58
- if [[ -z "$rvm_rev" ]] ; then
59
- __rvm_run "svn.update" "svn update"
60
- else
61
- __rvm_run "svn.checkout" "svn checkout -q $rvm_rev"
65
+ __rvm_log "info" "Updating ruby from $rvm_url"
66
+ __rvm_run "svn.update" "svn update"
67
+ if [[ ! -z "$rvm_rev" ]] ; then
68
+ __rvm_log "info" "Checking out revision ${rvm_rev/-r/-r } from $rvm_url"
69
+ __rvm_run "svn.checkout" "svn update -q ${rvm_rev/-r/-r }"
62
70
  fi
63
71
  else
64
- __rvm_run "svn.checkout" "svn checkout -q $rvm_rev --force $rvm_url $rvm_ruby_src_path"
72
+ rm -rf $rvm_ruby_src_path
73
+ __rvm_run "svn.checkout" "svn checkout -q ${rvm_rev/-r/-r } $rvm_url $rvm_ruby_src_path"
65
74
  fi
66
75
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
67
76
  fi
@@ -535,9 +544,10 @@ function __rvm_rubygems_setup {
535
544
  __rvm_log "info" "Installing rubygems dedicated to $rvm_ruby_package_name..."
536
545
  rvm_gem_package_name="rubygems-1.3.5"
537
546
  rvm_gem_url="http://rubyforge.org/frs/download.php/60718/$rvm_gem_package_name.tgz"
538
- if [[ -d "$rvm_src_path/$rvm_gem_package_name" ]] ; then
547
+ if [[ -d "$rvm_src_path/$rvm_gem_package_name" ]] && [[ -f "$rvm_src_path/$rvm_gem_package_name/setup.rb" ]]; then
539
548
  cd "$rvm_src_path/$rvm_gem_package_name"
540
549
  else
550
+ rm -rf "$rvm_src_path/$rvm_gem_package_name"
541
551
  __rvm_log "info" "Retrieving $rvm_gem_package_name"
542
552
  __rvm_fetch "$rvm_gem_url"
543
553
  mkdir -p "$rvm_src_path/$rvm_gem_package_name"
@@ -17,6 +17,9 @@ source $rvm_path/scripts/cli
17
17
  source $rvm_path/scripts/gems
18
18
 
19
19
  rvm_loaded_flag=1 ; export rvm_loaded_flag
20
+ rvm_version="$(cat "${rvm_path}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')" ; export rvm_version
21
+
22
+ alias rvm-restart="source \"${rvm_path}/scripts/rvm\""
20
23
 
21
24
  if [[ -f "$rvm_path/default" ]] ; then source $rvm_path/default ; fi
22
25
 
@@ -43,14 +43,14 @@ function __rvm_select {
43
43
  rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "jruby_version")"}"
44
44
  unset rvm_ruby_patch_level
45
45
  if match "$rvm_ruby_version" "^1.4" ; then
46
- rvm_ruby_version="1.4.0RC1"
47
- rvm_ruby_string="jruby-1.4.0RC1"
46
+ rvm_ruby_version="1.4.0RC3"
47
+ rvm_ruby_string="jruby-1.4.0RC3"
48
48
  rvm_package_file="$rvm_ruby_interpreter-bin-${rvm_ruby_version}"
49
49
  else
50
50
  rvm_package_file="$rvm_ruby_interpreter-bin-$rvm_ruby_version"
51
51
  rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
52
52
  fi
53
- rvm_url="http://dist.codehaus.org/$rvm_ruby_interpreter/$rvm_ruby_version/$rvm_package_file.tar.gz"
53
+ rvm_url="http://jruby.kenai.com/downloads/$rvm_ruby_interpreter/$rvm_ruby_version/$rvm_package_file.tar.gz"
54
54
  alias jruby_ng="jruby --ng"
55
55
  alias jruby_ng_server="jruby --ng-server"
56
56
  ;;
@@ -95,7 +95,16 @@ function __rvm_select {
95
95
  if [[ -z "$rvm_ruby_version" ]] ; then __rvm_log "fail" "Unknown ruby version: $rvm_ruby_version" ; fi
96
96
  ;;
97
97
 
98
- default|system|current|user)
98
+ current)
99
+ ruby_binary="$(which binary)"
100
+ if match "$ruby_binary" "rvm" ; then
101
+ rvm_ruby_string="$(dirname "$ruby_binary" | xargs dirname | xargs basename)"
102
+ else
103
+ rvm_ruby_interpreter="system"
104
+ fi
105
+ ;;
106
+
107
+ default|system|user)
99
108
  #no-op?
100
109
  ;;
101
110
 
@@ -104,7 +113,9 @@ function __rvm_select {
104
113
  rvm_ruby_string=$(basename $MY_RUBY_HOME)
105
114
  __rvm_select
106
115
  else
107
- __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
116
+ if [[ -z "$rvm_ruby_string" ]] ; then
117
+ __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
118
+ fi
108
119
  fi
109
120
  esac
110
121
 
@@ -132,7 +143,8 @@ function __rvm_select {
132
143
 
133
144
  export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string
134
145
  else
135
- rvm_ruby_gem_home="$GEM_HOME"
146
+ __rvm_unset_ruby_variables
147
+ rvm_ruby_interpreter="system"
136
148
  fi
137
149
  }
138
150
 
@@ -149,7 +161,7 @@ function __rvm_use {
149
161
  source $rvm_path/default
150
162
  else
151
163
  rvm_ruby_interpreter="system"
152
- __rvm_log "warn" "no default rvm specified, defaulting to pre-rvm sytem."
164
+ __rvm_log "warn" "no default rvm specified, defaulting to pre-rvm system."
153
165
  unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
154
166
  if [[ -s $rvm_path/system ]] ; then source $rvm_path/system ; fi
155
167
  fi
@@ -246,7 +258,11 @@ __rvm_ruby_string() {
246
258
  rvm_ruby_revision="head"
247
259
  unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag
248
260
  rvm_head_flag=1
261
+ elif [[ "default" = "$string" ]] ; then
262
+ rvm_ruby_interpreter="default"
263
+ break
249
264
  elif [[ "system" = "$string" ]] ; then
265
+ rvm_ruby_interpreter="system"
250
266
  break
251
267
  elif match "$string" "^preview" ; then
252
268
  rvm_ruby_patch_level="$string"
@@ -269,6 +285,9 @@ __rvm_ruby_string() {
269
285
  elif match "$string" "^r[0-9]" ; then
270
286
  unset rvm_ruby_patch_level
271
287
  rvm_ruby_revision="$string"
288
+ elif match "$string" "^s[0-9]" ; then
289
+ unset rvm_ruby_revision
290
+ rvm_ruby_sha="$string"
272
291
  elif match "$string" "^t[0-9]" ; then
273
292
  unset rvm_ruby_patch_level rvm_ruby_revision
274
293
  rvm_ruby_tag="$string"
@@ -303,8 +303,11 @@ function __rvm_implode {
303
303
 
304
304
  function __rvm_gemdir {
305
305
  if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
306
- mkdir -p $rvm_ruby_gem_home
307
- echo $rvm_ruby_gem_home
306
+ if [[ ! -z "$GEM_HOME" ]] ; then
307
+ echo "$GEM_HOME"
308
+ else
309
+ gem env gemdir
310
+ fi
308
311
  }
309
312
 
310
313
  function __rvm_source_dir {
@@ -785,6 +788,11 @@ function __rvm_iconv_install {
785
788
 
786
789
  function __rvm_openssl_install {
787
790
  __rvm_make_flags
791
+ if match "$rvm_archflags" "x86_64" ; then
792
+ openssl_os="os/compiler darwin64-x86_64-cc"
793
+ else
794
+ openssl_os="os/compiler darwin-i386-cc"
795
+ fi
788
796
  __rvm_pushpop $rvm_src_path
789
797
  package="openssl" ; version="0.9.8k" ; archive_format="tar.gz"
790
798
  __rvm_log "info" "Retrieving $package-$version.$archive_format"
@@ -828,22 +836,21 @@ function __rvm_ncurses_install {
828
836
  __rvm_make_flags() {
829
837
  PATH=${rvm_path}/usr/bin:$PATH ; export PATH
830
838
  if [[ "Darwin" = "$(uname)" ]] ; then
839
+
831
840
  if [[ -z "$rvm_archflags" ]] ; then
832
- if [[ $(echo "scale=4; $(uname -r | awk -F'.' '{print $1"."$2}') >= 10.0" | bc) -eq 1 ]] ; then
833
- rvm_archflags="-arch x86_64"
834
- else
835
- rvm_archflags="-arch i386"
836
- fi
841
+ # Build for the archtecture that is reported.
842
+ # The user may override via setting rvm_archflags in ~/.rvmrc
843
+ rvm_archflags="-arch $(uname -m )"
837
844
  fi
838
845
 
839
- if [[ -z "$rvm_sdk" ]] ; then
840
- rvm_sdk="$(ls /Developer/SDKs/ | sort | tail -n 1)"
846
+ if [[ "-arch x86_64" = "$rvm_archflags" ]] ; then
847
+ rvm_ruby_configure="${rvm_ruby_configure} --build=x86_64-apple-darwin$(uname -r) --host=x86_64-apple-darwin$(uname -r)"
848
+ elif [[ "-arch i386" = "$rvm_archflags" ]] ; then
849
+ rvm_ruby_configure="${rvm_ruby_configure} --build=i386-apple-darwin$(uname -r) --host=i386-apple-darwin$(uname -r)"
841
850
  fi
842
851
 
843
- if [[ "-arch x86_64" = "$rvm_archflags" ]] ; then
844
- openssl_os="os/compiler darwin64-x86_64-cc"
845
- else
846
- openssl_os="os/compiler darwin-i386-cc"
852
+ if [[ -z "$rvm_sdk" ]] ; then
853
+ rvm_sdk="$(ls /Developer/SDKs/ | sort | tail -n 1)"
847
854
  fi
848
855
 
849
856
  CFLAGS="-isysroot /Developer/SDKs/$rvm_sdk $rvm_archflags" ; export CFLAGS
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.67
4
+ version: 0.0.68
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne E. Seguin
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-29 00:00:00 -04:00
12
+ date: 2009-10-30 00:00:00 -04:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15