rvm 0.0.8 → 0.0.9

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.
Files changed (4) hide show
  1. data/README +28 -22
  2. data/bash/rvm +104 -23
  3. data/bash/rvm-install +6 -0
  4. metadata +2 -2
data/README CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  About:
3
3
 
4
- rvm 0.0.5 http://github.com/wayneeseguin/rvm
4
+ rvm 0.0.9 http://github.com/wayneeseguin/rvm
5
5
 
6
6
  by Wayne E. Seguin (wayneeseguin@gmail.com)
7
7
 
@@ -11,23 +11,25 @@
11
11
 
12
12
  Action:
13
13
 
14
- * usage - Show this usage information
15
- use - Switch to using a specific ruby versio (new login shell)
16
- info - Show information for current ruby
17
- gemdir - Switch to gem directory for installation (new login shell)
18
- srcdir - Switch to src directory for the current ruby installation
19
- gemdup - Clone source implementation version gems to currently used version
20
- (expiramental)
21
- install - Install a ruby version, default is from source
22
- debug - Emit environment and configuration information for debugging
14
+ * usage - Show this usage information
15
+ use - Switch to using a specific ruby versio (new login shell)
16
+ info - Show information for current ruby
17
+ list - Show currently installed versions
18
+ gemdir - Switch to gem directory for installation (new login shell)
19
+ srcdir - Switch to src directory for the current ruby installation
20
+ gemdup - Clone source implementation version gems to currently used version
21
+ (expiramental) Example: rvm gemdup ~/.gem/ruby/1.8/
22
+ install - Install a ruby version, default is from source
23
+ uninstall - Uninstall a ruby version
24
+ debug - Emit environment and configuration information for debugging
23
25
 
24
26
  Implementation:
25
27
 
26
- * ruby - MRI/YARV Ruby (The Standard), defaults to 1.8.6
27
- jruby - jRuby
28
- ree - Ruby Enterprise Edition
29
- default - Resets to the default system ruby
30
- all - Used with install, installs all latest known versions
28
+ * ruby - MRI/YARV Ruby (The Standard), defaults to 1.8.6
29
+ jruby - jRuby
30
+ ree - Ruby Enterprise Edition
31
+ default - Resets to the default system ruby
32
+ all - Used with install, installs all latest known versions
31
33
 
32
34
  Options:
33
35
 
@@ -50,17 +52,21 @@
50
52
 
51
53
  Examples:
52
54
 
53
- $ gem install rvm # Install the rvm gem
54
- $ rvm-install # Install rvm, adds source hooks for bash & zsh
55
- $ rvm install jruby # Install jRuby (default version is 1.3.1)
56
- $ rvm use ruby -v 1.9.1 # Use Ruby 1.9.1, installs if necessary
57
- $ rvm use 1.9 # Equivalent to above, due to defaults
58
- $ rvm use 1.8 # Use Ruby 1.8.6, installs if necessary
59
- $ rvm use default # Use the system default (as if no rvm)
55
+ $ gem install rvm # Install the rvm gem
56
+ $ rvm-install # Install rvm, adds hooks for bash & zsh
57
+ $ rvm install jruby # Install jRuby (default version is 1.3.1)
58
+ $ rvm use ruby -v 1.9.1 # Use Ruby 1.9.1, installs if necessary
59
+ $ rvm use 1.9 # Equivalent to above, due to defaults
60
+ $ rvm use 1.8 # Use Ruby 1.8.6, installs if necessary
61
+ $ rvm use default # Use the system default (as if no rvm)
62
+ $ rvm gemdup ~/.gem/ruby/1.8/ # Install gems from ~/.gem/ruby/1.8/
60
63
 
61
64
  TODO: (in order)
62
65
 
63
66
  * rvm gemdir default
67
+ * root support
68
+ * Settings file, user overridable
69
+ * Show current in rvm list, if applicable
64
70
 
65
71
  Credits:
66
72
 
data/bash/rvm CHANGED
@@ -3,7 +3,7 @@
3
3
  rvm_author="Wayne E. Seguin"
4
4
  rvm_author_email="wayneeseguin@gmail.com"
5
5
  rvm_website="http://github.com/wayneeseguin/rvm"
6
- rvm_version="0.0.8"
6
+ rvm_version="0.0.9"
7
7
  rvm_updated="2009.08.25"
8
8
 
9
9
  #
@@ -32,10 +32,11 @@ function rvm-usage {
32
32
  * usage - Show this usage information
33
33
  use - Switch to using a specific ruby versio (new login shell)
34
34
  info - Show information for current ruby
35
+ list - Show currently installed versions
35
36
  gemdir - Switch to gem directory for installation (new login shell)
36
37
  srcdir - Switch to src directory for the current ruby installation
37
38
  gemdup - Clone source implementation version gems to currently used version
38
- (expiramental) Example: rvm gemdup ~/.gem/ruby/1.8/
39
+ (highly expiramental) Example: rvm gemdup ~/.gem/ruby/1.8/
39
40
  install - Install a ruby version, default is from source
40
41
  uninstall - Uninstall a ruby version
41
42
  debug - Emit environment and configuration information for debugging
@@ -80,7 +81,11 @@ function rvm-usage {
80
81
 
81
82
  TODO: (in order)
82
83
 
84
+ * rvm gemdup
83
85
  * rvm gemdir default
86
+ * root support
87
+ * Settings file, user overridable
88
+ * Show current in rvm list, if applicable
84
89
 
85
90
  Credits:
86
91
 
@@ -292,16 +297,78 @@ function rvm-install-ruby {
292
297
 
293
298
  }
294
299
 
300
+ function rvm-uninstall {
301
+
302
+ implementation="${1-$implementation}"
303
+ case "$implementation" in
304
+
305
+ jruby)
306
+ version="${version-1.3.1}"
307
+ if [ "$version" = "1.2.0" -o "$version" = "1.3.1" ] ; then
308
+ package_name="jruby*-$version"
309
+ else
310
+ fail "Unknown jRuby version: $version"
311
+ fi
312
+ ;;
313
+
314
+ ree)
315
+ version=${version-1.8.6}
316
+ if [ "$version" = "1.8.6" ] ; then
317
+ package_name="$install_path/ruby-enterprise-$version-${3-20090610}"
318
+ else
319
+ fail "Unknown Ruby Enterprise Edition version: $version"
320
+ fi
321
+ ;;
322
+
323
+ ruby)
324
+ if [ "$version" = "1.8.7" ] ; then
325
+ package_name="ruby-1.8.7-p${patchlevel-174}"
326
+
327
+ elif [ "$version" = "1.8.6" -o "$version" = "1.8" ] ; then
328
+ package_name="ruby-1.8.6-p${patchlevel-369}"
329
+
330
+ elif [ "$version" = "1.9.2" ] ; then
331
+ package_name="ruby-1.9.2-p${patchlevel-review1}"
332
+
333
+ elif [ "$version" = "1.9.1" -o "$version" = "1.9" ] ; then
334
+ package_name="ruby-1.9.1-p${patchlevel-243}"
335
+
336
+ else
337
+ fail "Unknown ruby version: $version"
338
+ fi
339
+ ;;
340
+
341
+ *)
342
+ fail "Ruby implementation '$implementation' is not known."
343
+
344
+ esac
345
+
346
+ if [ ! -z "$package_name" ] ; then
347
+ for path in $source_path $install_path ; do
348
+ if [ -d $path/$package_name ] ; then
349
+ info "Removing $path/$package_name"
350
+ rm -rf $path/$package_name
351
+ fi
352
+ done
353
+ else
354
+ fail "Cannot uninstall unknown package '$package_name'"
355
+ fi
356
+
357
+ }
358
+
295
359
  function rvm-use {
296
360
 
297
361
  implementation="${1-$implementation}"
298
362
  case "$implementation" in
299
363
 
300
364
  default)
365
+ # TODO: There is a reproducible bug here when switching off of 1.8.7...
366
+ # Seems that the path is not reset properly.
301
367
  rm -f ~/.rvm/current
302
368
  unset MY_RUBY_HOME
303
369
  unset GEM_HOME
304
370
  unset RUBY_VERSION
371
+ PATH=$original_path ; export PATH
305
372
  ;;
306
373
  #leopard) MY_RUBY_HOME="/System/Library/Frameworks/Ruby.framework/Versions/Current/usr"; GEM_HOME="$HOME/.gem/ruby/1.8" ;;
307
374
 
@@ -388,6 +455,18 @@ function rvm-use {
388
455
  fail "Your shell is not supported bash and zsh are currently supported."
389
456
  fi
390
457
  }
458
+
459
+ function rvm-list {
460
+ echo -e "\nruby:"
461
+ ls -l ~/.rvm/ | awk '/ ruby-[1-2].*/ { print " - " $NF }'
462
+ echo
463
+ echo "jruby:"
464
+ ls -l ~/.rvm/ | awk '/jruby-.*/ { print " - " $NF }'
465
+ echo
466
+ echo "ree:"
467
+ ls ~/.rvm/ | awk '/ruby-enterprise-.*/ { print " - " $NF }'
468
+ echo
469
+ }
391
470
 
392
471
  function rvm-gem-dir {
393
472
 
@@ -503,7 +582,7 @@ function rvm {
503
582
  while [ $# -gt 0 ] ; do
504
583
  token="$1" ; shift
505
584
  case "$token" in
506
- install|use|path|info|gemdir|setup|version|debug|srcdir)
585
+ install|uninstall|use|path|info|gemdir|setup|version|debug|srcdir|list)
507
586
  action=$token ;;
508
587
  ruby|jruby|ree|default|all)
509
588
  implementation="$token" ;;
@@ -573,28 +652,30 @@ function rvm {
573
652
  rvm-install-ruby $implementation $version $patchlevel
574
653
  fi
575
654
  ;;
576
- use) rvm-use $implementation $version $patchlevel ;;
577
- gemdir) rvm-gem-dir $implementation $version $patchlevel ;;
578
- srcdir) rvm-src-dir $implementation $version $patchlevel ;;
579
- gemdup) rvm-gem-dup $implementation $version $patchlevel ;;
580
- info) rvm-info $implementation $version $patchlevel ;;
581
- version) rvm-version ;;
582
- debug)
583
- rvm-version
584
- info "GEM_HOME: $GEM_HOME\nMY_RUBY_HOME: $MY_RUBY_HOME"
585
- info "ruby: `which ruby`\ngem: `which gem`\nirb: `which irb`"
586
- info "PATH:$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"%5}')"
587
- info "\n.bash_profile: \n$(cat ~/.bash_profile | tail -n 5)\n"
588
- info "\n.rvm/current: \n$(cat ~/.rvm/current)\n"
589
- return 0
655
+ uninstall) rvm-uninstall $implementation $version $patchlevel ;;
656
+ use) rvm-use $implementation $version $patchlevel ;;
657
+ list) rvm-list ;;
658
+ gemdir) rvm-gem-dir $implementation $version $patchlevel ;;
659
+ srcdir) rvm-src-dir $implementation $version $patchlevel ;;
660
+ gemdup) rvm-gem-dup $implementation $version $patchlevel ;;
661
+ info) rvm-info $implementation $version $patchlevel ;;
662
+ version) rvm-version ;;
663
+ debug)
664
+ rvm-version
665
+ info "GEM_HOME: $GEM_HOME\nMY_RUBY_HOME: $MY_RUBY_HOME"
666
+ info "ruby: `which ruby`\ngem: `which gem`\nirb: `which irb`"
667
+ info "PATH:$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"%5}')"
668
+ info "\n.bash_profile: \n$(cat ~/.bash_profile | tail -n 5)\n"
669
+ info "\n.rvm/current: \n$(cat ~/.rvm/current)\n"
670
+ return 0
590
671
  ;;
591
672
  *)
592
- if [ ! -z "$action" ] ; then
593
- fail "unknown action '$action'"
594
- else
595
- rvm-usage
596
- fi
597
- return 1
673
+ if [ ! -z "$action" ] ; then
674
+ fail "unknown action '$action'"
675
+ else
676
+ rvm-usage
677
+ fi
678
+ return 1
598
679
  esac
599
680
 
600
681
  set +x
@@ -1,5 +1,11 @@
1
1
  #!/bin/bash
2
2
 
3
+ user=`whoami`
4
+ if [ "$user" = "root" ] ; then
5
+ echo -e "\e[0;31m <e> \e[0mroot user support is not yet implemented."
6
+ exit 1
7
+ fi
8
+
3
9
  mkdir -p ~/.rvm/src ~/.rvm/bin
4
10
 
5
11
  cp $(pwd)/bash/rvm ~/.rvm/bin/
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.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne E. Seguin
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  requirements: []
54
54
 
55
55
  rubyforge_project: dynamicreports
56
- rubygems_version: 1.3.4
56
+ rubygems_version: 1.3.5
57
57
  signing_key:
58
58
  specification_version: 3
59
59
  summary: Ruby Version Manager (rvm)