wayneeseguin-rvm 0.0.38 → 0.0.39

Sign up to get free protection for your applications and to get access to all the features.
data/rvm.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.38"
8
+ s.version = "0.0.39"
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-09-14}
12
+ s.date = %q{2009-09-15}
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}
data/scripts/rvm-cli CHANGED
@@ -1,5 +1,105 @@
1
1
  #!/bin/bash
2
2
 
3
+ function __rvm_meta {
4
+ rvm_meta_author="Wayne E. Seguin"
5
+ rvm_meta_author_email="wayneeseguin@gmail.com"
6
+ rvm_meta_website="http://rvm.beginrescueend.com/"
7
+ rvm_meta_version="`cat $rvm_path/VERSION.yml | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//'`"
8
+ rvm_meta_updated="2009.09.15"
9
+ }
10
+
11
+ function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; }
12
+
13
+ function __rvm_usage {
14
+
15
+ __rvm_meta
16
+
17
+ cat <<-Usage
18
+
19
+ rvm ${rvm_meta_version} ${rvm_meta_website} by ${rvm_meta_author} (${rvm_meta_author_email})
20
+
21
+ Usage:
22
+
23
+ rvm Action [Implementation] [Options]
24
+
25
+ Action:
26
+
27
+ * usage - Show this usage information
28
+ use - Switch to using a specific ruby version (new login shell)
29
+ info - Show information for current ruby
30
+ list - Show currently installed versions
31
+ gemdir - Switch to gem directory for installation (new login shell)
32
+ srcdir - Switch to src directory for the current ruby installation
33
+ gemdup - Clone source version gems to current version
34
+ (highly expiramental) Example: rvm gemdup ~/.gem/ruby/1.8/
35
+ install - Install a ruby version, default is from source
36
+ uninstall - Uninstall a ruby version
37
+ reset - Remove default and current settings, exit the shell.
38
+ (If you experience odd behavior try this first)
39
+ rubydo - Used with -f to run a ruby file against specified or all rubies
40
+ gemdo - Used with -f to execute a command using selected ruby's 'gem'
41
+ debug - Emit environment & configuration information for *current* ruby
42
+
43
+ reload - Reload rvm source itself (useful after changing rvm source)
44
+ implode - Removes all ruby installations it manages, everything in ~/.rvm
45
+ update - Upgrades rvm to the latest version.
46
+
47
+ Implementation:
48
+
49
+ * ruby - MRI/YARV Ruby (The Standard), defaults to 1.8.6
50
+ jruby - jRuby
51
+ rubinius - Rubinius
52
+ ree - Ruby Enterprise Edition
53
+ system - Use the system ruby (eg. pre-rvm state)
54
+ default - Use rvm set default ruby and system if it hasn't been set.
55
+
56
+ Options:
57
+
58
+ -v|--version - Ruby Package Version, defaults to 'latest'
59
+ -l|--level - Patch level for the specified Ruby version
60
+ -p|--prefix - Package and source directory prefix, with trailing slash!
61
+ Default is a users home directory and /usr/local/ for root
62
+ -a|--archives - Directory to place downladed files into (~/.rvm/archives/)
63
+ -n|--nice - Specify a process niceness (for slow computers, default 0)
64
+ -m|--gem-set - Named gem set for switching between different gem sets
65
+ --rm-gem-set - Removes a named gemset.
66
+
67
+ -l|--level - Specify a patch level to use
68
+ -t|--tag -
69
+ -r|--rev - Specify the repository revision # to use or 'head' for
70
+
71
+ -P|--prefix - Sets the prefix path for installs to be installed to
72
+ --bin - Specify path for binaries to be placed
73
+ --source - Specify src directory to use
74
+ --archive - Specify archive directory to use (tabralls / zips)
75
+ -G|--gems - Specify root gem path to use
76
+ -C|--configure - Specify custom configure options, comma separated
77
+ default: --enable-shared=true
78
+ --re-configure - Force installer to re-run configure if already run
79
+ -M|--make - Specify a custom make command
80
+ -I|--make-install - " a custom make install command
81
+
82
+ -f|--file - Specify a ruby file to run with 'rubydo' command
83
+ -h|--help - Emit this output and exit
84
+ -d|--default - Set the default Ruby to a specified version
85
+ -m|--gem-set - Use a named gem set instead of the default set.
86
+ -S|--script - Specify a script file to attempt to load and run (rubydo)
87
+ --all - Used with 'rvm list' to list "most" installable versions.
88
+ --rm-gem-set - Remove a named gem set
89
+ --jit - Enable JIT for the Rubinius build
90
+ --force - Force install, removes old install & source directories.
91
+ --set-prompt - Set prompt to have the selected ruby prepended.
92
+ --debug|--trace - Toggle debug mode on for very verbose output.
93
+
94
+ Resources:
95
+
96
+ http://rvm.beginrescueend.com/
97
+ https://www.pivotaltracker.com/projects/26822
98
+
99
+ Usage
100
+
101
+ }
102
+
3
103
  function __rvm_parse-args {
4
104
  while [ $# -gt 0 ] ; do
5
105
  rvm_token="$1" ; shift
@@ -25,13 +125,8 @@ function __rvm_parse-args {
25
125
  gemdir)
26
126
  rvm_action=$rvm_token
27
127
 
28
- if [ "$1" = "system" ] ; then
29
- rvm_ruby_interpreter="system" ; shift
30
- fi
31
-
32
- if [ "$1" = "user" ] ; then
33
- rvm_ruby_interpreter="user" ; shift
34
- fi
128
+ if [ "$1" = "system" ] ; then rvm_ruby_interpreter="system" ; shift ; fi
129
+ if [ "$1" = "user" ] ; then rvm_ruby_interpreter="user" ; shift ; fi
35
130
 
36
131
  rvm_ruby_interpreter="${rvm_ruby_interpreter:-current}"
37
132
  ;;
@@ -300,3 +395,4 @@ function rvm {
300
395
  return $status
301
396
  }
302
397
 
398
+
data/scripts/rvm-install CHANGED
@@ -154,7 +154,7 @@ if [ "$system" = "Linux" ] ; then
154
154
  echo -e "\033[0;33m <w> \033[0mFor jRuby (if you wish to use it) you will need:"
155
155
  echo -e "\033[0;32m <i> \033[0mThe SUN java runtime environment and development kit."
156
156
  fi
157
- elif [ "$sytem" = "Darwin" ] ; then
157
+ elif [ "$system" = "Darwin" ] ; then
158
158
  echo -e "\033[0;32m <i> \033[0mBe sure that you have XCode Tools installed in order to use rvm."
159
159
  echo -e "\033[0;32m <i> \033[0mIf you intend on installing MacRuby you must install LLVM first."
160
160
  fi
@@ -20,11 +20,11 @@ function __rvm_install-source {
20
20
  rvm_url="${rvm_url:-"ftp://ftp.ruby-lang.org/pub/ruby/1.$rvm_major_version/$rvm_ruby_package_name.tar.gz"}"
21
21
  __rvm_log "info" "\tDownloading $rvm_ruby_package_name, this may take a while depending on your connection..."
22
22
  __rvm_fetch $rvm_url
23
- if [ $status -eq 0 ] ; then status=$? ; fi
23
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
24
24
  __rvm_log "info" "\tExtracting $rvm_ruby_package_name ..."
25
25
  mkdir -p $rvm_ruby_src_path # Is this line necessary considering -C below? v
26
26
  __rvm_run "extract" tar xzf $rvm_archives_path/$rvm_ruby_package_name.tar.gz -C $rvm_source_path
27
- if [ $status -eq 0 ] ; then status=$? ; fi
27
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
28
28
  fi
29
29
  else
30
30
  __rvm_log "info" "\tRetrieving Ruby from $rvm_url"
@@ -33,14 +33,14 @@ function __rvm_install-source {
33
33
  cd $rvm_ruby_src_path
34
34
  if [ -z "$rvm_ruby_rev" ] ; then
35
35
  git pull origin master
36
- if [ $status -eq 0 ] ; then status=$? ; fi
36
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
37
37
  else
38
38
  git checkout ${rvm_ruby_rev:-HEAD}
39
- if [ $status -eq 0 ] ; then status=$? ; fi
39
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
40
40
  fi
41
41
  else
42
42
  git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path
43
- if [ $status -eq 0 ] ; then status=$? ; fi
43
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
44
44
  fi
45
45
  else
46
46
  if [ -z "$rvm_ruby_rev" ] ; then
@@ -67,30 +67,35 @@ function __rvm_install-source {
67
67
  else
68
68
  svn checkout -q $rvm_rev --force $rvm_url $rvm_ruby_src_path
69
69
  fi
70
- if [ $status -eq 0 ] ; then status=$? ; fi
70
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
71
71
  fi
72
72
  fi
73
73
 
74
74
  cd $rvm_ruby_src_path
75
- if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; popd > /dev/null ; return 1 ; fi
75
+ if [ $? -gt 0 ] ; then status=$? ; __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; popd > /dev/null ; return $status ; fi
76
+
77
+ # Readline
78
+ if [ ! -d $rvm_path/usr/include/readline ] ; then __rvm_readline_install ; fi
76
79
 
77
80
  if [ ! -s "$rvm_ruby_src_path/configure" -a "$rvm_ruby_interpreter" = "ruby" ] ; then
78
81
  rvm_autoconf=`which autoconf`
79
- if [ $? -ne 0 ] ; then __rvm_log "fail" "rvm expects autoconf" ; fi
82
+ if [ $? -gt 0 ] ; then __rvm_log "fail" "rvm expects autoconf" ; status=$? ; return $status ; fi
80
83
  __rvm_run "autoconf" $rvm_autoconf
81
- if [ $status -eq 0 ] ; then status=$? ; fi
84
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
82
85
  fi
83
86
 
84
- if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; popd > /dev/null ; return 1 ; fi
85
-
86
87
  if [ -s ./Makefile -a -z "$rvm_re_configure" ] ; then
87
88
  __rvm_log "warn" "\tSkipping configure step, Makefile exists so configure must have already been run."
88
89
  elif [ -s ./configure ] ; then
89
90
  __rvm_log "info" "\tConfiguring $rvm_ruby_package_name using $rvm_ruby_configure, this may take a while depending on your cpu(s)..."
90
- __rvm_run "configure" ./configure --prefix=$rvm_ruby_home $rvm_ruby_configure
91
- if [ $status -eq 0 ] ; then status=$? ; fi
91
+ if [ -d $rvm_path/usr/include/readline/ ] ; then
92
+ __rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure --with-readline-dir=$rvm_path/usr/include/readline/"
93
+ else
94
+ __rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure"
95
+ fi
96
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
92
97
  else
93
- __rvm_log "warn" "\tSkipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
98
+ __rvm_log "error" "\tSkipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
94
99
  fi
95
100
 
96
101
  __rvm_log "info" "\tCompiling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
@@ -99,7 +104,7 @@ function __rvm_install-source {
99
104
  else
100
105
  __rvm_run "make" $rvm_ruby_make
101
106
  fi
102
- if [ $status -eq 0 ] ; then status=$? ; fi
107
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
103
108
 
104
109
  if [ -z "$rvm_ruby_make" ] ; then
105
110
  __rvm_log "info" "\tInstalling $rvm_ruby_package_name"
@@ -107,24 +112,17 @@ function __rvm_install-source {
107
112
  else
108
113
  __rvm_run "install" $rvm_ruby_make_install
109
114
  fi
110
- if [ $status -eq 0 ] ; then status=$? ; fi
111
- __rvm_run "chmod.bin" chmod +x $rvm_ruby_home/bin/*
115
+ if [ $? -gt 0 ] ; then status=$? ; return $status ; fi
112
116
 
117
+ __rvm_run "chmod.bin" chmod +x $rvm_ruby_home/bin/*
113
118
  __rvm_bin_script
114
119
  __rvm_log "info" "Installation of $rvm_ruby_package_name is complete."
115
120
 
116
121
  GEM_HOME="$rvm_gem_home" ; export GEM_HOME
117
122
  GEM_PATH="$rvm_gem_home" ; export GEM_PATH
118
123
 
119
- echo $rvm_ruby_vesion | grep '^1\.9' > /dev/null
120
- if [ $? -gt 0 ] ; then
121
- __rvm_rubygems_install
122
- if [ $status -eq 0 ] ; then status=$? ; fi
123
- else
124
- mv $rvm_ruby_src_path/bin/gem $rvm_ruby_src_path/bin/gem.orig
125
- cat $rvm_ruby_src_path/bin/gem.orig | sed -e "s=!# */usr/bin/env ruby=!#/usr/bin/$rvm_ruby_home/bin/ruby=" > $rvm_ruby_src_path/bin/gem
126
- chmod +x $rvm_ruby_home/bin/gem
127
- fi
124
+ __rvm_rubygems_setup
125
+
128
126
  popd > /dev/null
129
127
 
130
128
  __rvm_post_install
@@ -195,23 +193,8 @@ function __rvm_install-ruby {
195
193
  chmod +x $rvm_ruby_home/bin/*
196
194
 
197
195
  __rvm_bin_script
196
+ __rvm_rubygems_setup
198
197
 
199
- __rvm_log "info" "\tInstalling rubygems dedicated to $rvm_ruby_package_name..."
200
- rvm_gem_package_name="rubygems-1.3.5"
201
- rvm_gem_url="http://rubyforge.org/frs/download.php/60718/$rvm_gem_package_name.tgz"
202
- if [ -d $rvm_source_path/$rvm_gem_package_name ] ; then
203
- cd $rvm_source_path/$rvm_gem_package_name
204
- else
205
- __rvm_fetch $rvm_gem_url
206
- mkdir -p $rvm_source_path/$rvm_gem_package_name
207
- __rvm_run "extract" tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_source_path
208
- fi
209
- # Well this is fun... fix nil error on require_paths:
210
- sed -i.orig "s/require_paths\.join/require_paths.to_a.join/" $rvm_source_path/$rvm_gem_package_name/lib/rubygems/gem_path_searcher.rb > $rvm_ruby_log_path/rubygems.install.log 2> $rvm_ruby_log_path/rubygems.install.error.log
211
- rm -f $rvm_source_path/$rvm_gem_package_name/lib/rubygems/gem_path_searcher.rb.orig
212
-
213
- __rvm_run "rubygems.install" $rvm_ruby_home/bin/ruby $rvm_source_path/$rvm_gem_package_name/setup.rb
214
- __rvm_log "info" "Installation of $rvm_ruby_package_name complete."
215
198
  popd > /dev/null
216
199
 
217
200
  for rvm_gem_name in rake ; do
@@ -295,7 +278,7 @@ function __rvm_install-ruby {
295
278
  ;;
296
279
 
297
280
  ruby)
298
- if [ -z "rvm_ruby_configure" ] ; then rvm_ruby_configure="--enable-shared=true" ; fi
281
+ if [ -z "rvm_ruby_configure" ] ; then rvm_ruby_configure="--enable-shared=true --enable-pthread=true " ; fi
299
282
  __rvm_install-source $*
300
283
  ;;
301
284
 
@@ -377,25 +360,37 @@ function __rvm_post_install {
377
360
  unset binary
378
361
  }
379
362
 
380
- function __rvm_rubygems_install {
381
- __rvm_log "info" "\tInstalling rubygems dedicated to $rvm_ruby_package_name..."
382
- rvm_gem_package_name="rubygems-1.3.5"
383
- rvm_gem_url="http://rubyforge.org/frs/download.php/60718/$rvm_gem_package_name.tgz"
384
- if [ -d $rvm_source_path/$rvm_gem_package_name ] ; then
385
- cd $rvm_source_path/$rvm_gem_package_name
363
+ function __rvm_rubygems_setup {
364
+
365
+ if [ "`echo $rvm_ruby_version | awk '{print substr($1, 0, 3)}'`" != "1.9" ] ; then
366
+ __rvm_log "info" "\tInstalling rubygems dedicated to $rvm_ruby_package_name..."
367
+ rvm_gem_package_name="rubygems-1.3.5"
368
+ rvm_gem_url="http://rubyforge.org/frs/download.php/60718/$rvm_gem_package_name.tgz"
369
+ if [ -d $rvm_source_path/$rvm_gem_package_name ] ; then
370
+ cd $rvm_source_path/$rvm_gem_package_name
371
+ else
372
+ __rvm_fetch $rvm_gem_url
373
+ mkdir -p $rvm_source_path/$rvm_gem_package_name
374
+ __rvm_run "rubygems.extract" tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_source_path
375
+ fi
376
+ # Well this is fun... fix nil error on require_paths:
377
+ # Q: Is this necessary any longer?
378
+ #sed -i.orig "s/require_paths\.join/require_paths.to_a.join/" $rvm_source_path/$rvm_gem_package_name/lib/rubygems/gem_path_searcher.rb
379
+ #rm -f $rvm_source_path/$rvm_gem_package_name/lib/rubygems/gem_path_searcher.rb.orig
380
+ __rvm_run "rubygems.install" GEM_HOME=$rvm_gem_path GEM_HOME=$rvm_gem_home $rvm_ruby_home/bin/ruby $rvm_source_path/$rvm_gem_package_name/setup.rb
381
+ status=$?
382
+ if [ $status -eq 0 ] ; then
383
+ __rvm_log "info" "Installation of rubygems $rvm_ruby_package_name completed successfully."
384
+ fi
385
+ if [ $status -eq 0 ] ; then status=$? ; fi
386
386
  else
387
- __rvm_fetch $rvm_gem_url
388
- mkdir -p $rvm_source_path/$rvm_gem_package_name
389
- __rvm_run "rubygems.extract" tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_source_path
390
- fi
391
- # Well this is fun... fix nil error on require_paths:
392
- sed -i.orig "s/require_paths\.join/require_paths.to_a.join/" $rvm_source_path/$rvm_gem_package_name/lib/rubygems/gem_path_searcher.rb
393
- rm -f $rvm_source_path/$rvm_gem_package_name/lib/rubygems/gem_path_searcher.rb.orig
394
- __rvm_run "rubygems.install" GEM_HOME=$rvm_gem_home $rvm_ruby_home/bin/ruby $rvm_source_path/$rvm_gem_package_name/setup.rb
395
- status=$?
396
- if [ $status -eq 0 ] ; then
397
- __rvm_log "info" "Installation of rubygems $rvm_ruby_package_name completed successfully."
387
+ # 1.9 has it's own built gem command, let's adjust the shebang line.
388
+ mv $rvm_ruby_src_path/bin/gem $rvm_ruby_src_path/bin/gem.orig
389
+ cat $rvm_ruby_src_path/bin/gem.orig | sed -e "s=!# */usr/bin/env ruby=!#/usr/bin/$rvm_ruby_home/bin/ruby=" > $rvm_ruby_src_path/bin/gem
390
+ chmod +x $rvm_ruby_home/bin/gem
391
+ __rvm_run "rubygems.update" $rvm_ruby_home/bin/gem update --system
398
392
  fi
393
+
399
394
  return $status
400
395
  }
401
396
 
data/scripts/rvm-selector CHANGED
@@ -77,8 +77,8 @@ function __rvm_select {
77
77
  fi
78
78
  ;;
79
79
 
80
- default|system|current)
81
- #noop?
80
+ default|system|current|user)
81
+ #no-op?
82
82
  ;;
83
83
  *)
84
84
  __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
@@ -116,6 +116,9 @@ function __rvm_select {
116
116
  rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version"}"
117
117
  rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"}"
118
118
  else
119
+ if [ "`echo $rvm_ruby_patch_level | awk '{print substr($1, 0, 1)}'`" != "p" ] ; then
120
+ rvm_ruby_patch_level="p$rvm_ruby_patch_level"
121
+ fi
119
122
  rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}"
120
123
  rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}"
121
124
  fi
@@ -145,21 +148,29 @@ function __rvm_use {
145
148
  source $rvm_path/default
146
149
  else
147
150
  __rvm_log "error" "no default rvm specified, defaulting to pre-rvm sytem."
148
- unset GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC
151
+ unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
149
152
  PATH="$rvm_system_path" ; export PATH
150
153
  if [ -s $rvm_path/system ] ; then source $rvm_path/system ; fi
151
154
  fi
152
155
 
153
156
  elif [ "$rvm_ruby_interpreter" = "system" ] ; then
154
157
 
155
- unset GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC
158
+ unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
156
159
  PATH="$rvm_system_path" ; export PATH
157
- if [ -s $rvm_path/system ] ; then source $rvm_path/system ; fi
160
+ if [ -s $rvm_path/system ] ; then
161
+ grep "^MY_RUBY_HOME='$rvm_path" "$rvm_path/system" > /dev/null
162
+ if [ $? -eq 0 ] ; then
163
+ rm -f $rvm_path/system # 'system' should *not* point to an rvm ruby.
164
+ else
165
+ source $rvm_path/system
166
+ fi
167
+ fi
158
168
 
159
169
  else
160
170
  GEM_HOME=$rvm_gem_home ; export GEM_HOME
161
171
  GEM_PATH=$rvm_gem_home ; export GEM_PATH
162
172
  MY_RUBY_HOME=$rvm_ruby_home ; export MY_RUBY_HOME
173
+ RUBY_VERSION=$rvm_ruby_package_name ; export RUBY_VERSION
163
174
  IRBRC="$rvm_ruby_irbrc" ; export IRBRC
164
175
  if [ -z "$IRBRC" ] ; then unset IRBRC ; fi
165
176
 
@@ -195,6 +206,19 @@ function __rvm_use {
195
206
  echo "unset ${variable}" >> $rvm_path/default
196
207
  fi
197
208
  done
209
+
210
+ if [ -s $rvm_path/bin/$rvm_ruby_package_name ] ; then
211
+ ln -fs $rvm_path/bin/$rvm_ruby_package_name $rvm_path/bin/ruby
212
+ ln -fs $rvm_path/bin/$rvm_ruby_package_name $rvm_path/bin/default-ruby # So that people know what it's for :)
213
+ ln -fs $rvm_path/bin/gem-$rvm_ruby_package_name $rvm_path/bin/gem
214
+ ln -fs $rvm_path/bin/irb-$rvm_ruby_package_name $rvm_path/bin/irb
215
+ else
216
+ rm -f $rvm_path/bin/ruby
217
+ rm -f $rvm_path/bin/default-ruby
218
+ rm -f $rvm_path/bin/gem
219
+ rm -f $rvm_path/bin/irb
220
+ fi
221
+
198
222
  unset rvm_set_default
199
223
  fi
200
224
  fi
data/scripts/rvm-update CHANGED
@@ -154,7 +154,7 @@ if [ "$system" = "Linux" ] ; then
154
154
  echo -e "\033[0;33m <w> \033[0mFor jRuby (if you wish to use it) you will need:"
155
155
  echo -e "\033[0;32m <i> \033[0mThe SUN java runtime environment and development kit."
156
156
  fi
157
- elif [ "$sytem" = "Darwin" ] ; then
157
+ elif [ "$system" = "Darwin" ] ; then
158
158
  echo -e "\033[0;32m <i> \033[0mBe sure that you have XCode Tools installed in order to use rvm."
159
159
  echo -e "\033[0;32m <i> \033[0mIf you intend on installing MacRuby you must install LLVM first."
160
160
  fi
data/scripts/rvm-utility CHANGED
@@ -1,105 +1,5 @@
1
1
  #!/bin/bash
2
2
 
3
- function __rvm_meta {
4
- rvm_meta_author="Wayne E. Seguin"
5
- rvm_meta_author_email="wayneeseguin@gmail.com"
6
- rvm_meta_website="http://rvm.beginrescueend.com/"
7
- rvm_meta_version="`cat $rvm_path/VERSION.yml | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//'`"
8
- rvm_meta_updated="2009.09.14"
9
- }
10
-
11
- function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; }
12
-
13
- function __rvm_usage {
14
-
15
- __rvm_meta
16
-
17
- cat <<-Usage
18
-
19
- rvm ${rvm_meta_version} ${rvm_meta_website} by ${rvm_meta_author} (${rvm_meta_author_email})
20
-
21
- Usage:
22
-
23
- rvm Action [Implementation] [Options]
24
-
25
- Action:
26
-
27
- * usage - Show this usage information
28
- use - Switch to using a specific ruby version (new login shell)
29
- info - Show information for current ruby
30
- list - Show currently installed versions
31
- gemdir - Switch to gem directory for installation (new login shell)
32
- srcdir - Switch to src directory for the current ruby installation
33
- gemdup - Clone source version gems to current version
34
- (highly expiramental) Example: rvm gemdup ~/.gem/ruby/1.8/
35
- install - Install a ruby version, default is from source
36
- uninstall - Uninstall a ruby version
37
- reset - Remove default and current settings, exit the shell.
38
- (If you experience odd behavior try this first)
39
- rubydo - Used with -f to run a ruby file against specified or all rubies
40
- gemdo - Used with -f to execute a command using selected ruby's 'gem'
41
- debug - Emit environment & configuration information for *current* ruby
42
-
43
- reload - Reload rvm source itself (useful after changing rvm source)
44
- implode - Removes all ruby installations it manages, everything in ~/.rvm
45
- update - Upgrades rvm to the latest version.
46
-
47
- Implementation:
48
-
49
- * ruby - MRI/YARV Ruby (The Standard), defaults to 1.8.6
50
- jruby - jRuby
51
- rubinius - Rubinius
52
- ree - Ruby Enterprise Edition
53
- system - Use the system ruby (eg. pre-rvm state)
54
- default - Use rvm set default ruby and system if it hasn't been set.
55
-
56
- Options:
57
-
58
- -v|--version - Ruby Package Version, defaults to 'latest'
59
- -l|--level - Patch level for the specified Ruby version
60
- -p|--prefix - Package and source directory prefix, with trailing slash!
61
- Default is a users home directory and /usr/local/ for root
62
- -a|--archives - Directory to place downladed files into (~/.rvm/archives/)
63
- -n|--nice - Specify a process niceness (for slow computers, default 0)
64
- -m|--gem-set - Named gem set for switching between different gem sets
65
- --rm-gem-set - Removes a named gemset.
66
-
67
- -l|--level - Specify a patch level to use
68
- -t|--tag -
69
- -r|--rev - Specify the repository revision # to use or 'head' for
70
-
71
- -P|--prefix - Sets the prefix path for installs to be installed to
72
- --bin - Specify path for binaries to be placed
73
- --source - Specify src directory to use
74
- --archive - Specify archive directory to use (tabralls / zips)
75
- -G|--gems - Specify root gem path to use
76
- -C|--configure - Specify custom configure options, comma separated
77
- default: --enable-shared=true
78
- --re-configure - Force installer to re-run configure if already run
79
- -M|--make - Specify a custom make command
80
- -I|--make-install - " a custom make install command
81
-
82
- -f|--file - Specify a ruby file to run with 'rubydo' command
83
- -h|--help - Emit this output and exit
84
- -d|--default - Set the default Ruby to a specified version
85
- -m|--gem-set - Use a named gem set instead of the default set.
86
- -S|--script - Specify a script file to attempt to load and run (rubydo)
87
- --all - Used with 'rvm list' to list "most" installable versions.
88
- --rm-gem-set - Remove a named gem set
89
- --jit - Enable JIT for the Rubinius build
90
- --force - Force install, removes old install & source directories.
91
- --set-prompt - Set prompt to have the selected ruby prepended.
92
- --debug|--trace - Toggle debug mode on for very verbose output.
93
-
94
- Resources:
95
-
96
- http://rvm.beginrescueend.com/
97
- https://www.pivotaltracker.com/projects/26822
98
-
99
- Usage
100
-
101
- }
102
-
103
3
  function __rvm_info {
104
4
  cat <<Info
105
5
 
@@ -181,7 +81,7 @@ function __rvm_run {
181
81
  if [ $rvm_debug ] ; then __rvm_log "debug" "Executing: $command" ; fi
182
82
  touch $rvm_ruby_log_path/$log_file_name.log $rvm_ruby_log_path/$log_file_name.error.log # for zsh :(
183
83
  echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command" | tee $rvm_ruby_log_path/$log_file_name.log > $rvm_ruby_log_path/$log_file_name.error.log
184
- if [ -z "$rvm_niceness" ] ; then
84
+ if [ -z "$rvm_niceness" -o "$rvm_niceness" = "0" ] ; then
185
85
  eval "$command" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log
186
86
  else
187
87
  eval "nice -n $rvm_niceness /bin/bash -l -c '$command'" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log
@@ -215,13 +115,12 @@ function __rvm_bin_script {
215
115
  if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
216
116
  ruby_wrapper=$(cat <<RubyWrapper
217
117
  #!/bin/bash
218
- if [ "`whoami`" = "root" ] ; then
219
- echo "rvm installed ruby binaries should *not* be run as the root user, yet: http://rvm.beginrescueend.com/faq/"
220
- fi
118
+
221
119
  GEM_HOME=$rvm_gem_home ; export GEM_HOME
222
120
  GEM_PATH=$rvm_gem_home ; export GEM_PATH
223
121
  MY_RUBY_HOME=$rvm_ruby_home ; export MY_RUBY_HOME
224
122
  PATH=$rvm_ruby_home/bin:$rvm_gem_home/bin:\$PATH ; export PATH
123
+
225
124
  exec "$rvm_ruby_binary" "\$@"
226
125
  RubyWrapper
227
126
  )
@@ -234,9 +133,16 @@ function __rvm_fetch {
234
133
 
235
134
  pushd $rvm_archives_path > /dev/null
236
135
  eval $rvm_fetch "$1"
237
- if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; popd > /dev/null ; return 1 ; fi
136
+ status=$?
137
+ if [ $status -gt 0 ] ; then
138
+ if [ $status -eq 78 ] ; then
139
+ __rvm_log "error" "The requested url does not exist: '$1'"
140
+ else
141
+ __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log"
142
+ fi
143
+ fi
238
144
  popd 2> /dev/null
239
-
145
+ return $status
240
146
  }
241
147
 
242
148
  function __rvm_load-defaults {
@@ -333,9 +239,7 @@ function __rvm_implode {
333
239
  }
334
240
 
335
241
  function __rvm_gem-dir {
336
-
337
242
  if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
338
-
339
243
  mkdir -p $rvm_gem_home
340
244
  echo $rvm_gem_home
341
245
  }
@@ -509,8 +413,6 @@ function __rvm_initialize {
509
413
  rvm_fetch="$rvm_fetch -O -L -s --create-dirs -C - "
510
414
  fi
511
415
 
512
- rvm_niceness=${rvm_niceness:-0}
513
-
514
416
  # TODO: Sanitize user input, ensure that there is a / a the end...
515
417
  if [ "`whoami`" = "root" ] ; then
516
418
  __rvm_log "fail" "root user support is not yet implemented."
@@ -555,8 +457,9 @@ function __rvm_update {
555
457
  __rvm_version
556
458
  fi
557
459
  __rvm_reload
558
- if [ "$rvm_bin_flag" ] ; then __rvm_bin_scripts ; fi
559
- if [ "$rvm_rubygems_flag" ] ; then __rvm_rubygems_install ; fi
460
+ __rvm_select
461
+ if [ "$rvm_bin_flag" ] ; then __rvm_bin_scripts ; fi
462
+ if [ "$rvm_rubygems_flag" ] ; then __rvm_rubygems_setup ; fi
560
463
  }
561
464
 
562
465
  function __rvm_update_rvm {
@@ -812,9 +715,17 @@ function __rvm_readline_install {
812
715
  version=5.2
813
716
  # TODO: Figure out how to list, grab and apply the patches
814
717
  __rvm_fetch "ftp://ftp.gnu.org/gnu/readline/$package-$version.tar.gz"
815
- __rvm_run "extract" tar zxf $rvm_archives_path/$package-$version.tar.gz -C $rvm_path/src/
718
+ __rvm_run "$package.extract" tar zxf $rvm_archives_path/$package-$version.tar.gz -C $rvm_path/src/
816
719
  cd $rvm_path/src/$package-$version
817
- __rvm_run "configure" ./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared
720
+ if [ "`uname`" = "Darwin" ] ; then
721
+ sdk=`ls -t /Developer/SDKs/ | head -n 1`
722
+ CFLAGS="-isysroot /Developer/SDKs/$sdk -arch i386 -arch x86_64"
723
+ LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/$sdk -arch i386 -arch x86_64"
724
+ export CFLAGS LDFLAGS
725
+ __rvm_run "$package.configure" ./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared
726
+ else
727
+ __rvm_run "$package.configure" ./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared
728
+ fi
818
729
  __rvm_run "$package.make" make
819
730
  __rvm_run "$package.make.install" make install
820
731
  popd > /dev/null
@@ -834,4 +745,3 @@ function __rvm_iconv_install {
834
745
 
835
746
  popd > /dev/null
836
747
  }
837
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wayneeseguin-rvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.38
4
+ version: 0.0.39
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-09-14 00:00:00 -07:00
12
+ date: 2009-09-15 00:00:00 -07:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15