rvm 0.0.98 → 0.0.99

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.
@@ -13,4 +13,7 @@ if [[ -z "$rvm_path" ]] ; then
13
13
  fi
14
14
 
15
15
  source $rvm_path/scripts/rvm
16
+
17
+ unset rvm_interactive
18
+
16
19
  rvm "$*"
@@ -1,2 +1,7 @@
1
1
  #!/usr/bin/env bash
2
- eval "sudo GEM_HOME=$GEM_HOME GEM_PATH=$GEM_PATH PATH=$PATH" "$@"
2
+
3
+ prefix="PATH='$PATH'"
4
+ if [[ ! -z "$GEM_HOME" ]] ; then prefix="GEM_HOME='$GEM_HOME' $prefix" ; fi
5
+ if [[ ! -z "$GEM_PATH" ]] ; then prefix="GEM_PATH='$GEM_PATH' $prefix" ; fi
6
+
7
+ eval "sudo" "/usr/bin/env $prefix $@"
data/config/db CHANGED
@@ -29,4 +29,4 @@ ruby_1.9.1_patch_level=376
29
29
  ruby_1.9.2_patch_level=preview1
30
30
  ruby_1.8.5_patch_level=231
31
31
  ruby_1.8.6_patch_level=383
32
- ruby_1.8.7_patch_level=174
32
+ ruby_1.8.7_patch_level=248
data/install CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ if [[ "--auto" = "$1" ]] ; then rvm_auto_flag=1 ; else unset rvm_auto_flag ; fi
4
+
3
5
  if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
4
6
  if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
5
7
 
@@ -15,6 +17,8 @@ fi
15
17
  source scripts/utility
16
18
  source scripts/initialize
17
19
 
20
+ __rvm_initialize
21
+
18
22
  #
19
23
  # Setup
20
24
  #
@@ -26,8 +30,7 @@ if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
26
30
  source_dir="${source_dir:-$cwd}"
27
31
 
28
32
  # State what is required to use rvm
29
- echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
30
- echo -e "\n Prepairing $rvm_path ..."
33
+ echo -e "\nInstalling rvm to $rvm_path/ ..."
31
34
  for dir_name in src scripts bin log archives config gems examples ; do
32
35
  mkdir -p "$rvm_path/$dir_name"
33
36
  done
@@ -36,7 +39,6 @@ cp -f "$source_dir/README" "$rvm_path/"
36
39
  #
37
40
  # Scripts
38
41
  #
39
- echo -e "\n Installing rvm to $rvm_path/ ..."
40
42
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
41
43
  for dir_name in config scripts examples lib hooks ; do
42
44
  mkdir -p "$rvm_path/$dir_name"
@@ -52,7 +54,6 @@ fi
52
54
  #
53
55
  # Bin Scripts
54
56
  #
55
- echo -e "\n Installing bin scripts to $rvm_path/bin ..."
56
57
  # Cleanse and purge...
57
58
  rm -f $rvm_path/bin/rvm ; rm -rf $rvm_path/bin/binscripts
58
59
  for file in rvm-prompt rvm rvmsudo ; do
@@ -63,42 +64,55 @@ chmod +x $rvm_path/bin/*
63
64
  #
64
65
  # RC Files
65
66
  #
66
- echo -e "\n Checking rc files ($rvm_rc_files) ..."
67
- if [[ "$rvm_loaded_flag" != "1" ]] ; then
68
- for rcfile in $(echo $rvm_rc_files) ; do
69
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
70
- if [[ -s "$HOME/.profile" ]] ; then
71
- if ! grep -q '.profile' "$rcfile" ; then
72
- echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
73
- echo -e "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
67
+ if [[ ! -z "$rvm_auto_flag" ]] ; then
68
+ echo -e "Checking rc files... ($rvm_rc_files)"
69
+ if [[ "$rvm_loaded_flag" != "1" ]] ; then
70
+ for rcfile in $(echo $rvm_rc_files) ; do
71
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
72
+ if [[ -s "$HOME/.profile" ]] ; then
73
+ if ! grep -q '.profile' "$rcfile" ; then
74
+ echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
75
+ echo -e "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
76
+ fi
74
77
  fi
75
- fi
76
- if ! grep -q "scripts\/rvm" "$rcfile" ; then
77
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
78
- echo -e "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
79
- fi
80
- done
78
+ if ! grep -q "scripts\/rvm" "$rcfile" ; then
79
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
80
+ echo -e "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
81
+ fi
82
+ done
83
+ fi
81
84
  fi
82
85
 
83
86
  if [[ "root" = "$(whoami)" ]] ; then
84
87
  echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
85
88
  mkdir -p $rvm_symlink_path
86
89
  ln -nfs $rvm_path/bin/rvm $rvm_symlink_path/rvm
90
+ ln -nfs $rvm_path/bin/rvmsudo $rvm_symlink_path/rvmsudo
87
91
  chmod +x $rvm_symlink_path/rvm
92
+ chmod +x $rvm_symlink_path/rvmsudo
88
93
  fi
89
94
 
90
- #
91
- # System Checks
92
- #
95
+ echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
93
96
  $rvm_path/scripts/notes
94
97
 
95
- echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings:"
96
- echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
97
- echo -e "\n $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
98
-
99
- echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/ \n"
100
- echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
98
+ echo -e "$(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
99
+ echo -e "\n$(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm "
100
+ echo "================================================================================"
101
+ name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
102
+ echo -e "\n${name:-"$(whoami)"},\n"
103
+ echo -e "\nThank you for using rvm. I hope that it makes your work easier and more enjoyable."
104
+ echo -e "If you have any questions, issues and/or ideas for improvement please hop in #rvm on irc.freenode.net and let me know."
105
+ echo -e "My irc nickname is 'wayneeseguin' and I hang out from ~09:00-17:00EST and again from ~21:00EST-~00:00EST."
106
+ echo -e "If I do not respond right away, please hang around after asking your question, I will respond as soon as I am back."
107
+ echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
101
108
  echo -e "\n ~ Wayne\n"
109
+ echo "================================================================================"
110
+
111
+ echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
112
+ echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bash_profile and/or .zshenv), after all path/variable settings:"
113
+ echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
114
+ echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
115
+ echo -e "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
102
116
 
103
117
  if [[ -x "$rvm_path/bin/rvm" ]] ; then "$rvm_path/bin/rvm" -v ; fi
104
118
 
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 98
4
+ :patch: 99
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.98"
8
+ s.version = "0.0.99"
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-12-21}
12
+ s.date = %q{2009-12-27}
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}
@@ -45,6 +45,7 @@ Gem::Specification.new do |s|
45
45
  "scripts/functions",
46
46
  "scripts/gems",
47
47
  "scripts/hash",
48
+ "scripts/hook",
48
49
  "scripts/initialize",
49
50
  "scripts/install",
50
51
  "scripts/irbrc",
@@ -90,3 +91,4 @@ Gem::Specification.new do |s|
90
91
  else
91
92
  end
92
93
  end
94
+
data/scripts/cd CHANGED
@@ -6,13 +6,18 @@ cd() {
6
6
  if [[ "$rvm_project_rvmrc" != 0 ]] ; then
7
7
  local cwd ; cwd=$(pwd)
8
8
  while : ; do
9
- if [[ -f "$cwd/.rvmrc" ]] ; then source "$cwd/.rvmrc" ; break ; fi
10
- cwd=$(dirname $cwd)
11
9
  if [[ -z "$cwd" ]] || [[ "$HOME" = "$cwd" ]] || [[ "/" = "$cwd" ]] ; then
12
10
  if [[ "$rvm_project_rvmrc_default" != 0 ]] ; then
13
11
  rvm default 1>/dev/null 2>&1
14
12
  fi
15
13
  break
14
+ else
15
+ if [[ -f "$cwd/.rvmrc" ]] ; then
16
+ source "$cwd/.rvmrc"
17
+ break
18
+ else
19
+ cwd=$(dirname "$cwd")
20
+ fi
16
21
  fi
17
22
  done
18
23
  fi
@@ -7,7 +7,7 @@ __rvm_meta() {
7
7
  rvm_meta_version="${rvm_version}"
8
8
  }
9
9
 
10
- __rvm_version() { __rvm_meta ; echo "rvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]" ; }
10
+ __rvm_version() { __rvm_meta ; echo -e "\nrvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]\n" ; }
11
11
 
12
12
  __rvm_usage() { cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} ; }
13
13
 
@@ -344,6 +344,8 @@ __rvm_parse_args() {
344
344
  }
345
345
 
346
346
  rvm() {
347
+ if [[ ! -z "$PS1" ]] ; then export rvm_interactive=1 ; else unset rvm_interactive ; fi
348
+
347
349
  if [[ -z "$ZSH_VERSION" ]] ; then
348
350
  trap 'rm -rf "$rvm_path/tmp/$$" >/dev/null 2>&1' 0 1 2 3 15
349
351
  fi
@@ -1,5 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
4
+
5
+ trap "if [[ -d $rvm_path/tmp/ ]] && [[ -f $rvm_path/tmp/$$ ]] ; then rm -f $rvm_path/tmp/$$ > /dev/null 2>&1 ; fi ; exit" 0 1 2 3 15
6
+
3
7
  if ! which curl &> /dev/null; then
4
8
  $rvm_scripts_path/log "fail" "rvm requires curl, which does not seem to exist in your path :("
5
9
  exit 1
@@ -8,6 +8,7 @@ color_yellow=$($rvm_scripts_path/color "yellow")
8
8
  color_none=$($rvm_scripts_path/color "none")
9
9
 
10
10
  if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
11
+ rvm_ruby_gem_home="${rvm_ruby_gem_home:-$GEM_HOME}"
11
12
  if [[ -d "$rvm_ruby_gem_home" ]] && which gem &> /dev/null ; then rvm_ruby_gem_home="$(gem env home)" ; fi
12
13
 
13
14
  trap "if [[ -d $rvm_path/tmp/ ]] && [[ -f $rvm_path/tmp/$$ ]] ; then rm -f $rvm_path/tmp/$$ > /dev/null 2>&1 ; fi ; exit" 0 1 2 3 15
@@ -21,7 +22,7 @@ __rvm_gems_dir() {
21
22
  }
22
23
 
23
24
  __rvm_gems_list() {
24
- if [[ $rvm_dir =~ rvm ]] ; then
25
+ if [[ $rvm_path =~ rvm ]] ; then
25
26
  for gemdir in "${rvm_gem_path}"/${rvm_ruby_string}%* ; do
26
27
  echo "$gemdir" | awk -F'%' '{print $2}'
27
28
  done
@@ -51,6 +52,8 @@ __rvm_gems_delete() {
51
52
  }
52
53
 
53
54
  __rvm_gems_dump() {
55
+ rvm_file_name="${rvm_file_name:-$gems_args}"
56
+
54
57
  if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
55
58
  GEM_HOME="$rvm_ruby_gem_home" ; export GEM_HOME ;
56
59
  GEM_PATH="$rvm_ruby_gem_home" ; export GEM_PATH ;
@@ -153,11 +156,12 @@ __rvm_parse_gem_line() {
153
156
  gem_file_name="${gem_name/ /}-${gem_version/ /}.gem"
154
157
  fi
155
158
  }
159
+
156
160
  __rvm_gem_install() {
157
161
  __rvm_parse_gem_line $*
158
162
 
159
- installed_gem="$(ls ${rvm_ruby_gem_home}/specifications/${gem_file_name}*spec 2>/dev/null | head -n 1)"
160
- if [[ -z "$rvm_force_flag" ]] && [[ -f "$installed_gem" ]] ; then
163
+ installed_gems="$(ls ${rvm_ruby_gem_home}/specifications/ 2>/dev/null)"
164
+ if [[ -z "$rvm_force_flag" ]] && [[ ! -z "$(echo $installed_gems | awk '/'${gem_file_name}spec'/')" ]] ; then
161
165
  unset gem
162
166
  $rvm_scripts_path/log "info" "$color_green$gem_name $gem_version$yellow exists, skipping (--force to re-install)"
163
167
  else
@@ -202,10 +206,10 @@ __rvm_gem_install() {
202
206
  # TODO: Set vars if fourth field is non-empty (means that there are conditional statements to execute in the gem install line.
203
207
  if [[ "rvm_make_flags_flag" -eq 1 ]] ; then __rvm_make_flags ; fi
204
208
 
205
- if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
206
- command="GEM_HOME='$rvm_ruby_gem_home' GEM_PATH='$rvm_ruby_gem_home' $gem_prefix gem install --no-rdoc --no-ri -q $gem $gem_postfix $vars"
209
+ if [[ ! -z "$rvm_ruby_gem_home" ]] && [[ "$rvm_ruby_gem_home" != "$rvm_gem_path" ]] ; then
210
+ command="GEM_HOME='$rvm_ruby_gem_home' GEM_PATH='$rvm_ruby_gem_home' $gem_prefix gem install $rvm_gem_options $gem $gem_postfix $vars"
207
211
  else
208
- command="$gem_prefix gem install --no-rdoc --no-ri -q $gem $gem_postfix $vars"
212
+ command="$gem_prefix gem install $rvm_gem_options -q $gem $gem_postfix $vars"
209
213
  fi
210
214
  __rvm_run "gem.install" "$command" "$gem_name $gem_version is not installed, installing..."
211
215
  result=$?
@@ -0,0 +1,12 @@
1
+ #!//usr/bin/env bash
2
+
3
+ if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
4
+
5
+ trap "if [[ -d $rvm_path/tmp/ ]] && [[ -f $rvm_path/tmp/$$ ]] ; then rm -f $rvm_path/tmp/$$ > /dev/null 2>&1 ; fi ; exit" 0 1 2 3 15
6
+
7
+ if [[ ! -z "$1" ]] ; then
8
+ if [[ -s "$rvm_hooks_path/$1" ]] ; then
9
+ if [[ "$rvm_verbose_flag" -eq 1 ]] || [[ "$rvm_debug_flag" -eq 1 ]] ; then $rvm_scripts_path/log "info" "running hook $1" ; fi
10
+ source "$rvm_hooks_path/$1"
11
+ fi
12
+ fi
@@ -30,7 +30,7 @@ rvm_config_path="${rvm_config_path:-"$rvm_path/config"}"
30
30
  rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}"
31
31
  rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
32
32
  rvm_symlink_path="${rvm_symlink_path:-/usr/local/bin}"
33
+ rvm_gem_options="${rvm_gem_options:-"--no-rdoc --no-ri"}"
33
34
 
34
35
  export rvm_path rvm_scripts_path rvm_archives_path rvm_src_path rvm_log_path rvm_bin_path rvm_gem_path rvm_config_path rvm_tmp_path
35
36
 
36
- __rvm_initialize
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ if [[ "--auto" = "$1" ]] ; then rvm_auto_flag=1 ; else unset rvm_auto_flag ; fi
4
+
3
5
  if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
4
6
  if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
5
7
 
@@ -15,6 +17,8 @@ fi
15
17
  source scripts/utility
16
18
  source scripts/initialize
17
19
 
20
+ __rvm_initialize
21
+
18
22
  #
19
23
  # Setup
20
24
  #
@@ -26,8 +30,7 @@ if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
26
30
  source_dir="${source_dir:-$cwd}"
27
31
 
28
32
  # State what is required to use rvm
29
- echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
30
- echo -e "\n Prepairing $rvm_path ..."
33
+ echo -e "\nInstalling rvm to $rvm_path/ ..."
31
34
  for dir_name in src scripts bin log archives config gems examples ; do
32
35
  mkdir -p "$rvm_path/$dir_name"
33
36
  done
@@ -36,7 +39,6 @@ cp -f "$source_dir/README" "$rvm_path/"
36
39
  #
37
40
  # Scripts
38
41
  #
39
- echo -e "\n Installing rvm to $rvm_path/ ..."
40
42
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
41
43
  for dir_name in config scripts examples lib hooks ; do
42
44
  mkdir -p "$rvm_path/$dir_name"
@@ -52,7 +54,6 @@ fi
52
54
  #
53
55
  # Bin Scripts
54
56
  #
55
- echo -e "\n Installing bin scripts to $rvm_path/bin ..."
56
57
  # Cleanse and purge...
57
58
  rm -f $rvm_path/bin/rvm ; rm -rf $rvm_path/bin/binscripts
58
59
  for file in rvm-prompt rvm rvmsudo ; do
@@ -63,42 +64,55 @@ chmod +x $rvm_path/bin/*
63
64
  #
64
65
  # RC Files
65
66
  #
66
- echo -e "\n Checking rc files ($rvm_rc_files) ..."
67
- if [[ "$rvm_loaded_flag" != "1" ]] ; then
68
- for rcfile in $(echo $rvm_rc_files) ; do
69
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
70
- if [[ -s "$HOME/.profile" ]] ; then
71
- if ! grep -q '.profile' "$rcfile" ; then
72
- echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
73
- echo -e "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
67
+ if [[ ! -z "$rvm_auto_flag" ]] ; then
68
+ echo -e "Checking rc files... ($rvm_rc_files)"
69
+ if [[ "$rvm_loaded_flag" != "1" ]] ; then
70
+ for rcfile in $(echo $rvm_rc_files) ; do
71
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
72
+ if [[ -s "$HOME/.profile" ]] ; then
73
+ if ! grep -q '.profile' "$rcfile" ; then
74
+ echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
75
+ echo -e "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
76
+ fi
74
77
  fi
75
- fi
76
- if ! grep -q "scripts\/rvm" "$rcfile" ; then
77
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
78
- echo -e "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
79
- fi
80
- done
78
+ if ! grep -q "scripts\/rvm" "$rcfile" ; then
79
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
80
+ echo -e "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
81
+ fi
82
+ done
83
+ fi
81
84
  fi
82
85
 
83
86
  if [[ "root" = "$(whoami)" ]] ; then
84
87
  echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
85
88
  mkdir -p $rvm_symlink_path
86
89
  ln -nfs $rvm_path/bin/rvm $rvm_symlink_path/rvm
90
+ ln -nfs $rvm_path/bin/rvmsudo $rvm_symlink_path/rvmsudo
87
91
  chmod +x $rvm_symlink_path/rvm
92
+ chmod +x $rvm_symlink_path/rvmsudo
88
93
  fi
89
94
 
90
- #
91
- # System Checks
92
- #
95
+ echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
93
96
  $rvm_path/scripts/notes
94
97
 
95
- echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings:"
96
- echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
97
- echo -e "\n $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
98
-
99
- echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/ \n"
100
- echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
98
+ echo -e "$(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
99
+ echo -e "\n$(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm "
100
+ echo "================================================================================"
101
+ name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
102
+ echo -e "\n${name:-"$(whoami)"},\n"
103
+ echo -e "\nThank you for using rvm. I hope that it makes your work easier and more enjoyable."
104
+ echo -e "If you have any questions, issues and/or ideas for improvement please hop in #rvm on irc.freenode.net and let me know."
105
+ echo -e "My irc nickname is 'wayneeseguin' and I hang out from ~09:00-17:00EST and again from ~21:00EST-~00:00EST."
106
+ echo -e "If I do not respond right away, please hang around after asking your question, I will respond as soon as I am back."
107
+ echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
101
108
  echo -e "\n ~ Wayne\n"
109
+ echo "================================================================================"
110
+
111
+ echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
112
+ echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bash_profile and/or .zshenv), after all path/variable settings:"
113
+ echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
114
+ echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
115
+ echo -e "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
102
116
 
103
117
  if [[ -x "$rvm_path/bin/rvm" ]] ; then "$rvm_path/bin/rvm" -v ; fi
104
118
 
@@ -1,14 +1,29 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
4
+
3
5
  if [[ ! -z "$2" ]] ; then level=$1 ; shift ; else level="info" ; fi
6
+
4
7
  message=$1
5
- case "$level" in
6
- debug) shift ; echo -e "$(tput setaf 5)<d>$(tput sgr0) $message $(tput setaf 5)</d> $(tput sgr0) " ;;
7
- info) shift ; echo -e "$(tput setaf 2)<i>$(tput sgr0) $message $(tput setaf 2)</i> $(tput sgr0) " ;;
8
- warn) shift ; echo -e "$(tput setaf 3)<w>$(tput sgr0) $message $(tput setaf 3)</w> $(tput sgr0) " ;;
9
- error) shift ; echo -e "$(tput setaf 1)<e>$(tput sgr0) $message $(tput setaf 1)</e> $(tput sgr0) " >&2 ;;
10
- fail) shift ; echo -e "$(tput setaf 1)<f>$(tput sgr0) $message $(tput setaf 1)</f> $(tput sgr0) " >&2 ;;
11
- *) echo -e "$message"
12
- esac
8
+
9
+ if [[ -z "$rvm_interactive" ]] ; then
10
+ case "$level" in
11
+ debug) shift ; echo -e "\n$(tput setaf 5)<d>$(tput sgr0) $message $(tput setaf 5)</d> $(tput sgr0) \n" ;;
12
+ info) shift ; echo -e "\n$(tput setaf 2)<i>$(tput sgr0) $message $(tput setaf 2)</i> $(tput sgr0) \n" ;;
13
+ warn) shift ; echo -e "\n$(tput setaf 3)<w>$(tput sgr0) $message $(tput setaf 3)</w> $(tput sgr0) \n" ;;
14
+ error) shift ; echo -e "\n$(tput setaf 1)<e>$(tput sgr0) $message $(tput setaf 1)</e> $(tput sgr0) \n" >&2 ;;
15
+ fail) shift ; echo -e "\n$(tput setaf 1)<f>$(tput sgr0) $message $(tput setaf 1)</f> $(tput sgr0) \n" >&2 ;;
16
+ *) echo -e "$message"
17
+ esac
18
+ else
19
+ case "$level" in
20
+ debug) shift ; echo -e "\n$(tput setaf 5)$message$(tput sgr0)\n" ;;
21
+ info) shift ; echo -e "\n$(tput setaf 2)$message$(tput sgr0)\n" ;;
22
+ warn) shift ; echo -e "\n$(tput setaf 3)$message$(tput sgr0)\n" ;;
23
+ error) shift ; echo -e "\n$(tput setaf 1)$message$(tput sgr0)\n" >&2 ;;
24
+ fail) shift ; echo -e "\n$(tput setaf 1)$message$(tput sgr0)\n" >&2 ;;
25
+ *) echo -e "$message"
26
+ esac
27
+ fi
13
28
 
14
29
  exit 0
@@ -36,11 +36,11 @@ __rvm_install_source() {
36
36
 
37
37
  if [[ "1.8.5" = "$rvm_ruby_version" ]] ; then
38
38
  # How to install ruby 1.8.5... "sneaky sneaky, sir"
39
- if [[ ! -d "$HOME/.rvm/src/ruby-1.8.7-p174/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p174 1>/dev/null ; fi
39
+ if [[ ! -d "$HOME/.rvm/src/ruby-1.8.7-p248/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p248 1>/dev/null ; fi
40
40
  if [[ ! -d "$HOME/.rvm/src/ruby-1.8.6-p383/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p383 1>/dev/null ; fi
41
- cp ~/.rvm/src/ruby-1.8.7-p174/ext/openssl/extconf.rb ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/
42
- cp ~/.rvm/src/ruby-1.8.7-p174/ext/openssl/openssl_missing.* ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/
43
- cp ~/.rvm/src/ruby-1.8.7-p174/ext/openssl/ossl_hmac.c ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/
41
+ cp ~/.rvm/src/ruby-1.8.7-p248/ext/openssl/extconf.rb ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/
42
+ cp ~/.rvm/src/ruby-1.8.7-p248/ext/openssl/openssl_missing.* ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/
43
+ cp ~/.rvm/src/ruby-1.8.7-p248/ext/openssl/ossl_hmac.c ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/
44
44
  cp ~/.rvm/src/ruby-1.8.6-p383/ext/readline/* ~/.rvm/src/ruby-1.8.5-p231/ext/readline/
45
45
  fi
46
46
 
@@ -168,7 +168,7 @@ RubyWrapper
168
168
  __rvm_rubygems_setup
169
169
 
170
170
  for rvm_gem_name in rake ; do
171
- __rvm_run "gems" "$rvm_ruby_home/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q" "Installing $rvm_gem_name"
171
+ __rvm_run "gems" "$rvm_ruby_home/bin/gem install $rvm_gem_name $rvm_gem_options" "Installing $rvm_gem_name"
172
172
  done
173
173
  __rvm_inject_ruby_shebang "$rvm_ruby_gem_home/bin/rake"
174
174
  __rvm_inject_gem_env "$rvm_ruby_gem_home/bin/rake"
@@ -320,7 +320,7 @@ RubyWrapper
320
320
  __rvm_use
321
321
 
322
322
  for rvm_gem_name in jruby-openssl ; do
323
- __rvm_run "gems" "$rvm_ruby_home/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q" "Installing $rvm_gem_name"
323
+ __rvm_run "gems" "$rvm_ruby_home/bin/gem install $rvm_gem_name $rvm_gem_options" "Installing $rvm_gem_name"
324
324
  done ; unset rvm_gem_name
325
325
  ;;
326
326
 
@@ -595,7 +595,7 @@ __rvm_post_install() {
595
595
  $rvm_scripts_path/log "info" "Installing gems for $rvm_ruby_string."
596
596
 
597
597
  for rvm_gem_name in rake ; do
598
- __rvm_run "gems.install" "$rvm_ruby_home/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q" "Installing $rvm_gem_name"
598
+ __rvm_run "gems.install" "$rvm_ruby_home/bin/gem install $rvm_gem_name $rvm_gem_options" "Installing $rvm_gem_name"
599
599
  done ; unset rvm_gem_name
600
600
 
601
601
  $rvm_scripts_path/log "info" "Installation of gems for $rvm_ruby_string is complete."
@@ -4,9 +4,9 @@ system="$(uname)"
4
4
 
5
5
  item="$(tput setaf 2)* $(tput sgr0)"
6
6
 
7
- echo -e "\n$(tput setaf 2)rvm notes for $system $(tput sgr0)\n"
7
+ echo -e "\n$(tput setaf 2)${system} Notes:$(tput sgr0)\n"
8
8
 
9
- echo -e " $item curl is required, be sure it is installed.\n"
9
+ echo -e " $item curl is required.\n"
10
10
 
11
11
  if [[ "Linux" = "$system" ]] ; then
12
12
  rvm_apt_get_binary="$(which aptitude 2> /dev/null)"
@@ -18,7 +18,7 @@ if [[ "Linux" = "$system" ]] ; then
18
18
  echo -e " $item For JRuby (if you wish to use it) you will need:"
19
19
  echo -e "\n $ aptitude install curl sun-java6-bin sun-java6-jre sun-java6-jdk"
20
20
  echo -e "\n $item For MRI & ree (if you wish to use it) you will need:"
21
- echo -e "\n $ aptitude install curl bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev"
21
+ echo -e "\n $ aptitude install curl bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev git-core"
22
22
  echo -e "\n $item For IronRuby (if you wish to use it) you will need:"
23
23
  echo -e "\n $ aptitude install curl mono-2.0-devel"
24
24
 
@@ -46,9 +46,9 @@ if [[ "Linux" = "$system" ]] ; then
46
46
  fi
47
47
  elif [[ "Darwin" = "$system" ]] ; then
48
48
  echo -e " $item For Snow Leopard be sure to have XCode Tools Version 3.2.1 (1613) or later (there were bugs with the dvd release version)."
49
- echo -e "\n $item You should download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
49
+ echo -e "\n $item You should download the latest XCode tools from developer.apple.com. This is necessary since the dvd install for Snow Leopard has bugs."
50
50
  echo -e "\n $item If you intend on installing MacRuby you must install LLVM first."
51
- echo -e "\n $item If you intend on installing JRuby you must install Java. The JDK is recommended."
51
+ echo -e "\n $item If you intend on installing JRuby you must install the JDK."
52
52
  echo -e "\n $item If you intend on installing IronRuby you must install Mono (version 2.6 or greater is recommended)."
53
53
  fi
54
54
 
@@ -15,8 +15,9 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
15
15
  if [[ "root" = "$(whoami)" ]] ; then
16
16
  rvm_path="/usr/local/rvm"
17
17
  else
18
- if [[ -d "$HOME/.rvm" ]] ; then rvm_path="$HOME/.rvm" ; fi
19
- if [[ -d "/usr/local/rvm" ]] && [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
18
+ if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
19
+ rvm_path="$HOME/.rvm"
20
+ elif [[ -d "/usr/local/rvm" ]] && [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
20
21
  rvm_path="${rvm_path:-"/usr/local/rvm"}"
21
22
  fi
22
23
  fi
@@ -41,6 +42,8 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
41
42
  source "$HOME/.rvm/default"
42
43
  elif [[ -s "$rvm_path/default" ]] ; then
43
44
  source "$rvm_path/default"
45
+ elif [[ -s "/usr/local/rvm/default" ]] ; then
46
+ source "/usr/local/rvm/default"
44
47
  fi
45
48
  else
46
49
  echo -e "\$rvm_path is not set. rvm cannot load."
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ if [[ "--auto" = "$1" ]] ; then rvm_auto_flag=1 ; else unset rvm_auto_flag ; fi
4
+
3
5
  if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
4
6
  if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
5
7
 
@@ -15,6 +17,8 @@ fi
15
17
  source scripts/utility
16
18
  source scripts/initialize
17
19
 
20
+ __rvm_initialize
21
+
18
22
  #
19
23
  # Setup
20
24
  #
@@ -26,8 +30,7 @@ if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
26
30
  source_dir="${source_dir:-$cwd}"
27
31
 
28
32
  # State what is required to use rvm
29
- echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
30
- echo -e "\n Prepairing $rvm_path ..."
33
+ echo -e "\nInstalling rvm to $rvm_path/ ..."
31
34
  for dir_name in src scripts bin log archives config gems examples ; do
32
35
  mkdir -p "$rvm_path/$dir_name"
33
36
  done
@@ -36,7 +39,6 @@ cp -f "$source_dir/README" "$rvm_path/"
36
39
  #
37
40
  # Scripts
38
41
  #
39
- echo -e "\n Installing rvm to $rvm_path/ ..."
40
42
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
41
43
  for dir_name in config scripts examples lib hooks ; do
42
44
  mkdir -p "$rvm_path/$dir_name"
@@ -52,7 +54,6 @@ fi
52
54
  #
53
55
  # Bin Scripts
54
56
  #
55
- echo -e "\n Installing bin scripts to $rvm_path/bin ..."
56
57
  # Cleanse and purge...
57
58
  rm -f $rvm_path/bin/rvm ; rm -rf $rvm_path/bin/binscripts
58
59
  for file in rvm-prompt rvm rvmsudo ; do
@@ -63,42 +64,55 @@ chmod +x $rvm_path/bin/*
63
64
  #
64
65
  # RC Files
65
66
  #
66
- echo -e "\n Checking rc files ($rvm_rc_files) ..."
67
- if [[ "$rvm_loaded_flag" != "1" ]] ; then
68
- for rcfile in $(echo $rvm_rc_files) ; do
69
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
70
- if [[ -s "$HOME/.profile" ]] ; then
71
- if ! grep -q '.profile' "$rcfile" ; then
72
- echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
73
- echo -e "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
67
+ if [[ ! -z "$rvm_auto_flag" ]] ; then
68
+ echo -e "Checking rc files... ($rvm_rc_files)"
69
+ if [[ "$rvm_loaded_flag" != "1" ]] ; then
70
+ for rcfile in $(echo $rvm_rc_files) ; do
71
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
72
+ if [[ -s "$HOME/.profile" ]] ; then
73
+ if ! grep -q '.profile' "$rcfile" ; then
74
+ echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
75
+ echo -e "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
76
+ fi
74
77
  fi
75
- fi
76
- if ! grep -q "scripts\/rvm" "$rcfile" ; then
77
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
78
- echo -e "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
79
- fi
80
- done
78
+ if ! grep -q "scripts\/rvm" "$rcfile" ; then
79
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
80
+ echo -e "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
81
+ fi
82
+ done
83
+ fi
81
84
  fi
82
85
 
83
86
  if [[ "root" = "$(whoami)" ]] ; then
84
87
  echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
85
88
  mkdir -p $rvm_symlink_path
86
89
  ln -nfs $rvm_path/bin/rvm $rvm_symlink_path/rvm
90
+ ln -nfs $rvm_path/bin/rvmsudo $rvm_symlink_path/rvmsudo
87
91
  chmod +x $rvm_symlink_path/rvm
92
+ chmod +x $rvm_symlink_path/rvmsudo
88
93
  fi
89
94
 
90
- #
91
- # System Checks
92
- #
95
+ echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
93
96
  $rvm_path/scripts/notes
94
97
 
95
- echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings:"
96
- echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
97
- echo -e "\n $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
98
-
99
- echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/ \n"
100
- echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
98
+ echo -e "$(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
99
+ echo -e "\n$(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm "
100
+ echo "================================================================================"
101
+ name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
102
+ echo -e "\n${name:-"$(whoami)"},\n"
103
+ echo -e "\nThank you for using rvm. I hope that it makes your work easier and more enjoyable."
104
+ echo -e "If you have any questions, issues and/or ideas for improvement please hop in #rvm on irc.freenode.net and let me know."
105
+ echo -e "My irc nickname is 'wayneeseguin' and I hang out from ~09:00-17:00EST and again from ~21:00EST-~00:00EST."
106
+ echo -e "If I do not respond right away, please hang around after asking your question, I will respond as soon as I am back."
107
+ echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
101
108
  echo -e "\n ~ Wayne\n"
109
+ echo "================================================================================"
110
+
111
+ echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
112
+ echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bash_profile and/or .zshenv), after all path/variable settings:"
113
+ echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
114
+ echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
115
+ echo -e "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
102
116
 
103
117
  if [[ -x "$rvm_path/bin/rvm" ]] ; then "$rvm_path/bin/rvm" -v ; fi
104
118
 
@@ -269,28 +269,28 @@ __rvm_use() {
269
269
  rm -f $rvm_symlink_path/passenger_ruby
270
270
  ln -nfs $rvm_bin_path/$rvm_ruby_string $rvm_symlink_path/passenger_ruby
271
271
  done
272
+ fi
273
+
274
+ if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
275
+ rm -f $rvm_path/default
276
+ rm -f $rvm_path/bin/default*
272
277
  else
273
- if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
274
- rm -f $rvm_path/default
275
- rm -f $rvm_path/bin/default*
276
- else
277
- RUBY_VERSION="$($MY_RUBY_HOME/bin/ruby -v | sed 's#^\(.*\) (.*$#\1#')"
278
- export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION
279
-
280
- echo "PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:\$PATH ; export PATH" > $rvm_path/default
281
-
282
- for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gem_set_name; do
283
- eval "export $variable"
284
- eval value=\$${variable}
285
- if [[ ! -z "$value" ]] ; then
286
- echo "${variable}='$value' ; export ${variable}" >> $rvm_path/default
287
- else
288
- echo "unset ${variable}" >> $rvm_path/default
289
- fi
290
- done ; unset variable value
291
-
292
- if [[ ! -z "$rvm_default_flag" ]] ; then $rvm_scripts_path/symlink "default" ; fi
293
- fi
278
+ RUBY_VERSION="$($MY_RUBY_HOME/bin/ruby -v | sed 's#^\(.*\) (.*$#\1#')"
279
+ export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION
280
+
281
+ echo "PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:\$PATH ; export PATH" > $rvm_path/default
282
+
283
+ for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gem_set_name; do
284
+ eval "export $variable"
285
+ eval value=\$${variable}
286
+ if [[ ! -z "$value" ]] ; then
287
+ echo "${variable}='$value' ; export ${variable}" >> $rvm_path/default
288
+ else
289
+ echo "unset ${variable}" >> $rvm_path/default
290
+ fi
291
+ done ; unset variable value
292
+
293
+ if [[ ! -z "$rvm_default_flag" ]] ; then $rvm_scripts_path/symlink "default" ; fi
294
294
  fi
295
295
  fi
296
296
  unset rvm_default_flag
@@ -307,7 +307,7 @@ __rvm_use() {
307
307
  export PATH="$new_path" ; unset new_path
308
308
  fi
309
309
 
310
- __rvm_hook "after_use"
310
+ $rvm_scripts_path/hook "after_use"
311
311
  }
312
312
 
313
313
  __rvm_ruby_string() {
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ if [[ "--auto" = "$1" ]] ; then rvm_auto_flag=1 ; else unset rvm_auto_flag ; fi
4
+
3
5
  if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
4
6
  if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
5
7
 
@@ -15,6 +17,8 @@ fi
15
17
  source scripts/utility
16
18
  source scripts/initialize
17
19
 
20
+ __rvm_initialize
21
+
18
22
  #
19
23
  # Setup
20
24
  #
@@ -26,8 +30,7 @@ if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
26
30
  source_dir="${source_dir:-$cwd}"
27
31
 
28
32
  # State what is required to use rvm
29
- echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
30
- echo -e "\n Prepairing $rvm_path ..."
33
+ echo -e "\nInstalling rvm to $rvm_path/ ..."
31
34
  for dir_name in src scripts bin log archives config gems examples ; do
32
35
  mkdir -p "$rvm_path/$dir_name"
33
36
  done
@@ -36,7 +39,6 @@ cp -f "$source_dir/README" "$rvm_path/"
36
39
  #
37
40
  # Scripts
38
41
  #
39
- echo -e "\n Installing rvm to $rvm_path/ ..."
40
42
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
41
43
  for dir_name in config scripts examples lib hooks ; do
42
44
  mkdir -p "$rvm_path/$dir_name"
@@ -52,7 +54,6 @@ fi
52
54
  #
53
55
  # Bin Scripts
54
56
  #
55
- echo -e "\n Installing bin scripts to $rvm_path/bin ..."
56
57
  # Cleanse and purge...
57
58
  rm -f $rvm_path/bin/rvm ; rm -rf $rvm_path/bin/binscripts
58
59
  for file in rvm-prompt rvm rvmsudo ; do
@@ -63,42 +64,55 @@ chmod +x $rvm_path/bin/*
63
64
  #
64
65
  # RC Files
65
66
  #
66
- echo -e "\n Checking rc files ($rvm_rc_files) ..."
67
- if [[ "$rvm_loaded_flag" != "1" ]] ; then
68
- for rcfile in $(echo $rvm_rc_files) ; do
69
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
70
- if [[ -s "$HOME/.profile" ]] ; then
71
- if ! grep -q '.profile' "$rcfile" ; then
72
- echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
73
- echo -e "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
67
+ if [[ ! -z "$rvm_auto_flag" ]] ; then
68
+ echo -e "Checking rc files... ($rvm_rc_files)"
69
+ if [[ "$rvm_loaded_flag" != "1" ]] ; then
70
+ for rcfile in $(echo $rvm_rc_files) ; do
71
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
72
+ if [[ -s "$HOME/.profile" ]] ; then
73
+ if ! grep -q '.profile' "$rcfile" ; then
74
+ echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
75
+ echo -e "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
76
+ fi
74
77
  fi
75
- fi
76
- if ! grep -q "scripts\/rvm" "$rcfile" ; then
77
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
78
- echo -e "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
79
- fi
80
- done
78
+ if ! grep -q "scripts\/rvm" "$rcfile" ; then
79
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
80
+ echo -e "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
81
+ fi
82
+ done
83
+ fi
81
84
  fi
82
85
 
83
86
  if [[ "root" = "$(whoami)" ]] ; then
84
87
  echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
85
88
  mkdir -p $rvm_symlink_path
86
89
  ln -nfs $rvm_path/bin/rvm $rvm_symlink_path/rvm
90
+ ln -nfs $rvm_path/bin/rvmsudo $rvm_symlink_path/rvmsudo
87
91
  chmod +x $rvm_symlink_path/rvm
92
+ chmod +x $rvm_symlink_path/rvmsudo
88
93
  fi
89
94
 
90
- #
91
- # System Checks
92
- #
95
+ echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
93
96
  $rvm_path/scripts/notes
94
97
 
95
- echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings:"
96
- echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
97
- echo -e "\n $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
98
-
99
- echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/ \n"
100
- echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
98
+ echo -e "$(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
99
+ echo -e "\n$(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm "
100
+ echo "================================================================================"
101
+ name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
102
+ echo -e "\n${name:-"$(whoami)"},\n"
103
+ echo -e "\nThank you for using rvm. I hope that it makes your work easier and more enjoyable."
104
+ echo -e "If you have any questions, issues and/or ideas for improvement please hop in #rvm on irc.freenode.net and let me know."
105
+ echo -e "My irc nickname is 'wayneeseguin' and I hang out from ~09:00-17:00EST and again from ~21:00EST-~00:00EST."
106
+ echo -e "If I do not respond right away, please hang around after asking your question, I will respond as soon as I am back."
107
+ echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
101
108
  echo -e "\n ~ Wayne\n"
109
+ echo "================================================================================"
110
+
111
+ echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
112
+ echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bash_profile and/or .zshenv), after all path/variable settings:"
113
+ echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
114
+ echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
115
+ echo -e "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
102
116
 
103
117
  if [[ -x "$rvm_path/bin/rvm" ]] ; then "$rvm_path/bin/rvm" -v ; fi
104
118
 
@@ -109,7 +109,7 @@ __rvm_remove_rvm_from_path() {
109
109
  export PATH
110
110
  }
111
111
 
112
- __rvm_gi() { gem install -q --no-rdoc --no-ri $* ; }
112
+ __rvm_gi() { gem install $rvm_gem_options $* ; }
113
113
 
114
114
  __rvm_run() {
115
115
  log_file_name="$1" ; command="$2" ; message="$3"
@@ -269,6 +269,7 @@ __rvm_source_dir() {
269
269
  }
270
270
 
271
271
  __rvm_list() {
272
+ echo
272
273
  if [[ ! -z "$rvm_all_flag" ]] ; then
273
274
  while read -r tag
274
275
  do
@@ -276,7 +277,7 @@ __rvm_list() {
276
277
  echo "${prefix}-t${tag/\//}"
277
278
  unset prefix tag
278
279
  done < <(svn list http://svn.ruby-lang.org/repos/ruby/tags/ | awk '/^v1_[8|9]/')
279
- echo -e "(ruby-)1.8.6(-p383)\n(ruby-)1.8.6-head\n(ruby-)1.8.7(-p174)\n(ruby-)1.8.7-head\n(ruby-)1.9.1(-p243)\n(ruby-)1.9.1(-p376)\n(ruby-)1.9.1-head\n(ruby-)1.9.2-preview1"
280
+ echo -e "(ruby-)1.8.6(-p383)\n(ruby-)1.8.6-head\n(ruby-)1.8.7(-p248)\n(ruby-)1.8.7-head\n(ruby-)1.9.1(-p243)\n(ruby-)1.9.1(-p376)\n(ruby-)1.9.1-head\n(ruby-)1.9.2-preview1"
280
281
  echo -e "jruby-1.2.0\njruby-1.3.0\njruby-1.3.1\njruby(-1.4.0) # the default\njruby-head"
281
282
  echo -e "rbx(-head) # rubinius head, the default rbx \nrbx(-head) --jit (rubinius head with LLVM enabled)"
282
283
  echo -e "ree-1.8.6\nree(-1.8.7) # the default\nree-1.8.6-head\nree-1.8.7-head"
@@ -293,7 +294,7 @@ __rvm_list() {
293
294
 
294
295
  for version in $(\ls $rvm_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
295
296
  if [[ ! -z "$(echo $version | awk '/^jruby-/')" ]] ; then
296
- string="$($version -v | awk '{print $NF}')"
297
+ string="$($rvm_path/$version/bin/ruby -v | awk '{print $NF}')"
297
298
  else
298
299
  string="[ $(file $rvm_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
299
300
  fi
@@ -324,9 +325,9 @@ __rvm_list() {
324
325
  system_version=$($system_ruby -v)
325
326
  string="[ $(file $system_ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
326
327
  if [[ ! -z "$system_ruby" ]] && [[ "$system_ruby -v)" = "$system_version" ]] ; then
327
- echo -e "=> $(tput setaf 2)system$(tput sgr0) $string\n"
328
+ echo -e "=> $(tput setaf 2)system$(tput sgr0) $string"
328
329
  else
329
- echo -e " $(tput setaf 2)system$(tput sgr0) $string\n"
330
+ echo -e " $(tput setaf 2)system$(tput sgr0) $string"
330
331
  fi
331
332
  else
332
333
  $rvm_scripts_path/log "info" "No system ruby found."
@@ -334,6 +335,7 @@ __rvm_list() {
334
335
 
335
336
  unset current_ruby version selected system_ruby system_version string
336
337
  fi
338
+ echo
337
339
  }
338
340
 
339
341
  __rvm_initialize() {
@@ -350,6 +352,7 @@ __rvm_initialize() {
350
352
  }
351
353
 
352
354
  __rvm_update() {
355
+ __rvm_pushpop $rvm_path
353
356
  if [[ "head" = "$rvm_ruby_revision" ]] || [[ ! -z "$rvm_self_flag" ]] || [[ "update" = "$rvm_action" ]] || [[ ! -z "$rvm_update_flag" ]] ; then
354
357
  __rvm_version
355
358
  __rvm_update_rvm
@@ -358,6 +361,7 @@ __rvm_update() {
358
361
  if [[ ! -z "$rvm_rubygems_flag" ]] ; then __rvm_rubygems_setup ; fi
359
362
 
360
363
  unset rvm_update_flag rvm_action rvm_self_flag rvm_ruby_revision rvm_bin_flag rvm_rubygems_flag
364
+ __rvm_pushpop
361
365
  }
362
366
 
363
367
  __rvm_update_rvm() {
@@ -382,16 +386,16 @@ __rvm_update_rvm() {
382
386
  fi
383
387
  else
384
388
  if [[ "true" = "$($ruby -S gem list rvm --installed)" ]]; then
385
- $ruby -S gem update rvm --no-rdoc --no-ri --quiet
389
+ $ruby -S gem update rvm $rvm_gem_options
386
390
  else
387
- $ruby -S gem install rvm --no-rdoc --no-ri --quiet
391
+ $ruby -S gem install rvm $rvm_gem_options
388
392
  fi
389
393
  # TODO: Check all gem paths instead of simply assuming the last one...
390
394
  builtin cd "$($ruby -S gem env | grep "\- $HOME" | awk '{print $NF}' | head -n 1)/gems/rvm-$(gem list rvm | sed 's/.*(//' | sed 's/).*//' | awk -F',' '{print $1 ; exit}')" && ./install
391
395
  fi
392
396
  unset ruby system_ruby
393
397
  __rvm_pushpop
394
- __rvm_hook "after_update"
398
+ $rvm_scripts_path/hook "after_update"
395
399
  }
396
400
 
397
401
  __rvm_reboot() {
@@ -406,7 +410,7 @@ __rvm_reboot() {
406
410
  else
407
411
  if [[ -d "$rvm_path" ]] ; then rm -rf "$rvm_path/" ; fi
408
412
  fi
409
- gem install rvm --no-rdoc --no-ri -q
413
+ gem install rvm $rvm_gem_options
410
414
  __rvm_update_rvm
411
415
  source $rvm_path/scripts/rvm
412
416
  else
@@ -448,17 +452,17 @@ __rvm_ruby_do() {
448
452
  elif [[ "gem" = "$(basename $binary)" ]] && $rvm_scripts_path/match "$rvm_ruby_args" '^install' ; then
449
453
  #__rvm_gem_install
450
454
  #$rvm_scripts_path/gem install $rvm_ruby_args
451
- rvm_command="$rvm_scripts_path/gems $rvm_ruby_mode $rvm_ruby_args --no-rdoc --no-ri"
455
+ rvm_command="$rvm_scripts_path/gems $rvm_ruby_mode $rvm_ruby_args $rvm_gem_options"
452
456
  else
453
457
  rvm_command="$binary $rvm_ruby_mode $rvm_ruby_args"
454
458
  fi
455
459
 
456
- mkdir -p ./log/$rvm_ruby_string/
457
460
  if [[ ! -z "$rvm_json_flag" ]] || [[ ! -z "$rvm_yaml_flag" ]] || [[ ! -z "$rvm_summary_flag" ]] ; then
461
+ mkdir -p ./log/$rvm_ruby_string/
458
462
  touch ./log/$rvm_ruby_string/$rvm_action.log ./log/$rvm_ruby_string/$rvm_action.error.log
459
463
  eval "$rvm_command" >> ./log/$rvm_ruby_string/$rvm_action.log 2>> ./log/$rvm_ruby_string/$rvm_action.error.log
460
464
  else
461
- echo -e "\n\n\033[0;32m$rvm_ruby_string: $($binary -v $rvm_ruby_mode | tr "\n" ' ')\033[0m\n"
465
+ $rvm_scripts_path/log "info" "$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v $rvm_ruby_mode | tr "\n" ' ')"
462
466
  eval "$rvm_command"
463
467
  fi
464
468
  result=$?
@@ -503,7 +507,7 @@ __rvm_do() {
503
507
 
504
508
  __rvm_state
505
509
 
506
- __rvm_hook "after_do"
510
+ $rvm_scripts_path/hook "after_do"
507
511
 
508
512
  return ${#errors[*]}
509
513
  }
@@ -659,15 +663,6 @@ __rvm_make_flags() {
659
663
  fi
660
664
  }
661
665
 
662
- __rvm_hook() {
663
- if [[ ! -z "$1" ]] ; then
664
- if [[ -s "$rvm_hooks_path/$1" ]] ; then
665
- if [[ "$rvm_verbose_flag" -eq 1 ]] || [[ "$rvm_debug_flag" -eq 1 ]] ; then $rvm_scripts_path/log "info" "running hook $1" ; fi
666
- source "$rvm_hooks_path/$1"
667
- fi
668
- fi
669
- }
670
-
671
666
  __rvm_gems_select() {
672
667
  if [[ -z "$(which gem 2>/dev/null)" ]] ; then return 0 ; fi
673
668
 
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.98
4
+ version: 0.0.99
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-12-21 00:00:00 -05:00
12
+ date: 2009-12-27 00:00:00 -05:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15
 
@@ -49,6 +49,7 @@ files:
49
49
  - scripts/functions
50
50
  - scripts/gems
51
51
  - scripts/hash
52
+ - scripts/hook
52
53
  - scripts/initialize
53
54
  - scripts/install
54
55
  - scripts/irbrc