rvm 0.1.24 → 0.1.26

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.
data/README CHANGED
@@ -65,6 +65,7 @@ Flags
65
65
  --summary - Used with rubydo to print out a summary of the commands run.
66
66
  --jit - Used with rubinius install to build with JIT
67
67
  --latest - with gemset --dump skips version strings for latest gem.
68
+ --gems - with uninstall/remove removes gems with the interpreter.
68
69
  --reconfigure - Force ./configure on install even if Makefile already exists.
69
70
 
70
71
 
@@ -10,6 +10,7 @@ add(){
10
10
  fi
11
11
  }
12
12
 
13
+ rvm_gemset_separator=${rvm_gemset_separator:-"+"}
13
14
  if [[ ! -z "$(which ruby 2>/dev/null | awk '/rvm/{print}')" ]] ; then
14
15
  unset format
15
16
  while [[ $# -gt 0 ]] ; do
@@ -52,8 +53,8 @@ if [[ ! -z "$(which ruby 2>/dev/null | awk '/rvm/{print}')" ]] ; then
52
53
  fi
53
54
 
54
55
  if [[ ! -z "$gemset_flag" ]] ; then
55
- gemset="$(gem env gemdir | awk -F% '{print $2}')"
56
- if [[ ! -z "$gemset" ]] ; then gemset="%$gemset" ; fi
56
+ gemset="$(echo $GEM_HOME | awk -F${rvm_gemset_separator} '{print $2}')"
57
+ if [[ ! -z "$gemset" ]] ; then gemset="${rvm_gemset_separator}$gemset" ; fi
57
58
  fi
58
59
 
59
60
  if [[ ! -z "$unicode_flag" ]] ; then
@@ -68,22 +69,28 @@ if [[ ! -z "$(which ruby 2>/dev/null | awk '/rvm/{print}')" ]] ; then
68
69
  system) unicode="➆" ;;
69
70
  ruby)
70
71
  case "$version" in
71
- 1.8.6) unicode="❻" ;;
72
- 1.8.7) unicode="❼" ;;
73
- 1.9.1) unicode="❶" ;;
72
+ 1.8.6) unicode="❻" ;;
73
+ 1.8.7) unicode="❼" ;;
74
+ 1.9.1) unicode="❶" ;;
74
75
  1.9.2) unicode="❷" ;;
75
76
  *) unicode="♢" ;;
76
77
  esac ;;
77
78
  *) unicode="♢" ;;
78
- esac
79
+ esac
80
+
81
+ if [[ ! -z "$(echo $ruby_string | awk '/-head/')" ]] ; then
82
+ unicode="${unicode}〠"
83
+ fi
79
84
  # TODO: Architecture
80
85
  # TODO: gemset
81
86
  echo $unicode
82
87
  else
83
88
  command="prompt=\"$format\""
84
89
  eval "$command"
85
- echo "$prompt" | sed 's#-\s*$##' | sed 's#-%#%#'
90
+ echo "$prompt" | sed 's#-\s*$##' | sed 's#-'${rvm_gemset_separator}'#'${rvm_gemset_separator}'#'
86
91
  fi
92
+ else
93
+ echo "system"
87
94
  fi
88
95
 
89
96
  exit 0
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+ if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
3
+ if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
4
+ rvm_path="${rvm_path:-$HOME/.rvm}"
5
+ mkdir -p $rvm_path/src/
6
+ cd $rvm_path/src
7
+
8
+ rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git
9
+ cd rvm
10
+ dos2unix scripts/* >/dev/null 2>&1
11
+ bash scripts/install
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+
3
+ if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
4
+ if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
5
+ rvm_path="${rvm_path:-$HOME/.rvm}"
6
+ mkdir -p $rvm_path/src/
7
+ cd $rvm_path/src
8
+
9
+ stable_version=$(curl -B http://rvm.beginrescueend.com/releases/stable-version.txt 2>/dev/null)
10
+
11
+ echo "rvm-${stable_version}"
12
+
13
+ curl -L "http://rvm.beginrescueend.com/releases/rvm-${stable_version}.tar.gz" -o "rvm-${stable_version}.tar.gz"
14
+
15
+ tar zxf "rvm-${stable_version}.tar.gz"
16
+
17
+ cd "rvm-${stable_version}"
18
+
19
+ dos2unix scripts/* >/dev/null 2>&1
20
+
21
+ bash scripts/install
data/config/db CHANGED
@@ -8,8 +8,9 @@ rubygems_version=1.3.6
8
8
  rubygems_1.3.5_url=http://rubyforge.org/frs/download.php/60718
9
9
  rubygems_1.3.6_url=http://rubyforge.org/frs/download.php/69365
10
10
  rbx_version=1.0.0
11
- rbx_patch_level=rc3
12
- rbx_url=http://asset.rubini.us/rubinius-1.0.0-rc3-20100216.tar.gz
11
+ rbx_patch_level=rc4
12
+ rbx_1.0.0_rc3_url=http://asset.rubini.us/rubinius-1.0.0-rc3-20100216.tar.gz
13
+ rbx_1.0.0_rc4_url=http://asset.rubini.us/rubinius-1.0.0-rc4-20100331.tar.gz
13
14
  ree_version=1.8.7
14
15
  ree_1.8.6_patch_level=20090610
15
16
  ree_1.8.6_url=http://rubyforge.org/frs/download.php/58677
@@ -29,7 +30,7 @@ macruby_version=0.5
29
30
  macruby_url=http://www.macruby.org/files
30
31
  macruby_repo_url=git://git.macruby.org/macruby/MacRuby.git
31
32
  macruby_nightly_url=http://macruby.icoretech.org/latest/macruby_nightly-latest.pkg
32
- maglev_version=23082
33
+ maglev_version=23101
33
34
  maglev_url=http://glass-downloads.gemstone.com/maglev
34
35
  maglev_repo_url=git://github.com/MagLev/maglev.git
35
36
  rubinius_repo_url=git://github.com/evanphx/rubinius.git
data/config/md5 CHANGED
@@ -1,4 +1,5 @@
1
1
  rubinius-1.0.0-rc1-20091125.tar.gz=c1cf037f05caf1bc962c09e220b435f4
2
+ rubinius-1.0.0-rc4-20100331.tar.gz=c631131cc9542c548b4fc3791d8aa6b2
2
3
  ruby-1.8.5-p115.tar.gz=20ca6cc87eb077296806412feaac0356
3
4
  ruby-1.8.5-p231.tar.gz=e900cf225d55414bffe878f00a85807c
4
5
  ruby-1.8.6-p286.tar.gz=797ea136fe43e4286c9362ee4516674e
@@ -68,3 +69,7 @@ GemStone-23082.Darwin-i386.tar.gz=aa5f1768e5bad2bb687913c575f9cff6
68
69
  GemStone-23082.Linux-x86_64.tar.gz=7b7fd0df5d1deacf7aa12ccc9a94a33f
69
70
  MagLev-23082.Darwin-i386.tar.gz=d9027e7b7c8220573b1d3d588712ffc4
70
71
  MagLev-23082.Linux-x86_64.tar.gz=d63c4c94a2eaf19b051182e974413fef
72
+ GemStone-23101.Darwin-i386.tar.gz=09b2c6fbb17b5571d31f2539779a2c24
73
+ GemStone-23101.Linux-x86_64.tar.gz=9710555efbeb3563c607f09db1d33090
74
+ MagLev-23101.Darwin-i386.tar.gz=281c9615cb2ef94f720b67fb893f1e26
75
+ MagLev-23101.Linux-x86_64.tar.gz=3294165bd510129fcf591920573c3af1
data/examples/rvmrc CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  # Bin Path
29
29
  # This is where rvm places all of it's executable/wrapper scripts.
30
- #export rvm_bin_path="${$rvm_path}/bin"
30
+ #export rvm_bin_path="${rvm_path}/bin"
31
31
 
32
32
  # Gem Path
33
33
  # This is where rvm installs all gems to for each ruby
data/install CHANGED
@@ -13,9 +13,9 @@ source scripts/utility
13
13
  usage() {
14
14
  echo -e "
15
15
  Usage:
16
- ${0} <options>
16
+ ${0} [options]
17
17
 
18
- Options:
18
+ options:
19
19
  --auto : Automatically update shell profile files.
20
20
  --prefix : Installation prefix directory.
21
21
  --help : Display help/usage (this) message
@@ -23,6 +23,15 @@ usage() {
23
23
  "
24
24
  }
25
25
 
26
+ spinner_counter=0
27
+ spinner() {
28
+ array=('/' '-' '\\' '|' '/' '-' '\\' '|')
29
+ index=$((($spinner_counter % 8)))
30
+ echo -e -n "\r${array[$index]}"
31
+ let "spinner_counter=spinner_counter+1"
32
+ which perl > /dev/null 2>&1 && perl -e 'sleep 0.5'
33
+ }
34
+
26
35
  if echo "$*" | grep -q 'trace' ; then echo "$*" ; env | grep '^rvm_' ; set -x ; fi
27
36
 
28
37
  while [[ $# -gt 0 ]] ; do
@@ -47,18 +56,25 @@ fi
47
56
  if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi
48
57
 
49
58
  source scripts/initialize
59
+ if grep -q 'scripts/rvm' $HOME/.bash* || grep -q 'scripts/rvm' $HOME/.zsh*; then
60
+ if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
61
+ export upgrade_flag=1
62
+ else
63
+ export upgrade_flag=0
64
+ fi
65
+ else
66
+ export upgrade_flag=0
67
+ fi
68
+
50
69
  __rvm_initialize
51
70
 
52
71
  #
53
- # Setup
72
+ # Setup & Configuration
54
73
  #
55
74
  item="$(tput setaf 2)* $(tput sgr0)"
56
75
  question="\n$(tput setaf 2)<?>$(tput sgr0)"
57
76
  cwd=$(pwd)
58
77
  source_path="${source_path:-$cwd}"
59
-
60
- # State what is required to use rvm
61
- echo -e "\nInstalling rvm to $rvm_path/ ..."
62
78
  rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
63
79
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
64
80
  rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
@@ -71,9 +87,25 @@ rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}"
71
87
  rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
72
88
  rvm_symlink_path="${rvm_symlink_path:-$rvm_prefix/bin}"
73
89
 
90
+ export rvm_gemset_separator="@" # TODO: Remove this after a while.
91
+
92
+ echo -e "\n$(tput setaf 2)RVM$(tput sgr0) - shell scripts which allow management of multiple ruby interpreters and environments."
93
+ echo -e "\n $(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
94
+ echo -e "\n $(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)"
95
+
96
+ echo -e "\n********************************************************************************"
97
+ if [[ "$upgrade_flag" -eq 1 ]] ;then
98
+ echo -e -n " Upgrading the RVM installation in $rvm_path/"
99
+ else
100
+ echo -e -n " Installing rvm to $rvm_path/"
101
+ fi
102
+
103
+ spinner
104
+
74
105
  mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gems_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path $rvm_symlink_path $HOME/.gem/cache
75
106
 
76
107
  for file in README LICENCE ; do
108
+ spinner
77
109
  cp -f "$source_path/$file" "$rvm_path/"
78
110
  done
79
111
 
@@ -81,19 +113,22 @@ done
81
113
  # Scripts
82
114
  #
83
115
  for dir_name in config scripts examples lib hooks ; do
116
+ spinner
84
117
  mkdir -p "$rvm_path/$dir_name"
85
118
  if [[ -d "$source_path/$dir_name" ]] ; then
86
119
  cp -Rf "$source_path/$dir_name" "$rvm_path"
87
120
  fi
88
121
  done ; unset dir_name
89
122
 
123
+ spinner
90
124
  if [[ ! -s "$rvm_config_path/user" ]] ; then
91
125
  mkdir -p "$rvm_config_path/"
92
126
  echo '# Users settings file, overrides db file settings and persists across installs.' >> $rvm_config_path/user
93
127
  fi
94
128
 
95
- scripts="monitor match log install color db fetch log set package"
96
- for script_name in $(echo $scripts) ; do
129
+ scripts=("monitor" "match" "log" "install" "color" "db" "fetch" "log" "set" "package")
130
+ for script_name in $scripts ; do
131
+ spinner
97
132
  chmod +x $rvm_scripts_path/$script_name
98
133
  done
99
134
 
@@ -102,14 +137,17 @@ done
102
137
  #
103
138
  # Cleanse and purge...
104
139
  for file in rvm-prompt rvm rvmsudo ; do
140
+ spinner && perl -e 'sleep 0.2'
105
141
  rm -f "$rvm_bin_path/$file"
106
142
  cp -f "$source_path/binscripts/$file" $rvm_bin_path/
107
143
  done
144
+ spinner
108
145
  chmod +x $rvm_bin_path/*
109
146
 
110
147
  #
111
148
  # RC Files
112
149
  #
150
+ spinner
113
151
  if [[ ! -z "$rvm_auto_flag" ]] ; then
114
152
  echo -e "Checking rc files... ($rvm_rc_files)"
115
153
  if [[ "$rvm_loaded_flag" != "1" ]] ; then
@@ -134,11 +172,13 @@ fi
134
172
  #
135
173
  rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
136
174
  mkdir -p "$rvm_rubies_path/"
175
+ spinner
137
176
  for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
138
177
  if [[ -d "$ruby" ]] ; then
139
178
  mv "$ruby" "$rvm_rubies_path/"
140
179
  new_path="$rvm_rubies_path/$(basename $ruby)"
141
180
  for file in gem rake ; do
181
+ spinner
142
182
  if [[ -s "$new_path/bin/$file" ]] ; then
143
183
  sed -i.orig -e '1,1s=.*=#!'"$new_path/bin/ruby=" "$new_path/bin/$file"
144
184
  rm -f "$new_path/bin/$file.orig"
@@ -148,7 +188,46 @@ for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-*
148
188
  fi
149
189
  done
150
190
  #
151
- # End of migration.
191
+ # End of rubies migration.
192
+ #
193
+
194
+ #
195
+ # Migrate old gemset directories to new gemset pattern.
196
+ #
197
+ spinner
198
+ echo -e -n "\r*" # Stop spinner.
199
+
200
+ for gemset in $rvm_path/gems/*\%* ; do
201
+ new_path=${gemset/\%/${rvm_gemset_separator}}
202
+ if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
203
+ echo -e " Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
204
+ mv $gemset $new_path
205
+ fi
206
+ done
207
+
208
+ for gemset in $rvm_path/gems/*\+* ; do
209
+ new_path=${gemset/\+/${rvm_gemset_separator}}
210
+ if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
211
+ echo -e " Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
212
+ mv $gemset $new_path
213
+ fi
214
+ done
215
+ for gemset in $rvm_path/gems/*\@ ; do
216
+ new_path=$(echo $gemset | sed -e 's#\@$##')
217
+ if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
218
+ echo -e " Fixing: $(basename $gemset) to $(basename $new_path) for new gemset separator."
219
+ mv $gemset $new_path
220
+ fi
221
+ done
222
+
223
+ # Upgrade any default file.
224
+ if [[ -s $rvm_config_path/default ]] && grep -q '\%' $rvm_config_path/default ; then
225
+ sed -e "s#\%#${rvm_gemset_separator}#g" $rvm_config_path/default > $rvm_config_path/default.new
226
+ mv $rvm_config_path/default.new $rvm_config_path/default
227
+ fi
228
+
229
+ #
230
+ # End of gemset migration.
152
231
  #
153
232
 
154
233
  if [[ "root" = "$(whoami)" ]] ; then
@@ -160,11 +239,11 @@ if [[ "root" = "$(whoami)" ]] ; then
160
239
  chmod +x $rvm_symlink_path/rvmsudo
161
240
  fi
162
241
 
163
- echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
164
- ./scripts/notes
242
+ if [[ "$upgrade_flag" -eq 0 ]] ; then
243
+ echo -e "\n********************************************************************************"
244
+ ./scripts/notes
245
+ fi
165
246
 
166
- echo -e "$(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
167
- echo -e "\n$(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm "
168
247
  echo -e "\n********************************************************************************"
169
248
  name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
170
249
  echo -e "\n${name:-"$(whoami)"},\n"
@@ -177,20 +256,28 @@ echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
177
256
  echo -e "\n ~ Wayne"
178
257
  echo -e "\n********************************************************************************"
179
258
 
180
- if [[ "root" != "$(whoami)" ]] ; then
181
- echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
182
- echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
183
- echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
184
- echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
185
- echo -e "\n This means that if you see '[ -z "$PS1" ] && return' then you must remove it and split your .bashrc"
186
- echo -e "\n Put everything *except the return code line(s)* into your .bash_profile, and everything above that code in your .bashrc."
187
- echo -e "\n Be *sure* to REMOVE the '&& return' statement line."
188
- echo -e "\n If you wish to DRY up your config you can 'source ~/.bashrc' at the top of your .bash_profile."
189
- echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
190
- fi
191
-
192
- if [[ -s $HOME/.bashrc ]] && grep '&& return' $HOME/.bashrc ; then
193
- echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n\n"
259
+ if [[ "$upgrade_flag" -eq 1 ]] ; then
260
+ echo -e "\n$(tput setaf 6)**** NOTICE *************************************************************************************"
261
+ echo -e "* Gemset separator has changed, it is now @ and will remain unless any rubies error using it. *"
262
+ echo -e "* If you encounter any issues with a ruby your best bet is to 'rvm remove X ; rvm install X' *"
263
+ echo -e "*************************************************************************************************$(tput sgr0)\n"
264
+ echo -e "Upgrade of RVM in $rvm_path/ is complete.\n"
265
+ else
266
+ if [[ "root" != "$(whoami)" ]] ; then
267
+ echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
268
+ echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
269
+ echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
270
+ echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
271
+ echo -e "\n This means that if you see '[ -z "$PS1" ] && return' then you must remove it and split your .bashrc"
272
+ echo -e "\n Put everything *except the return code line(s)* into your .bash_profile, and everything above that code in your .bashrc."
273
+ echo -e "\n Be *sure* to REMOVE the '&& return' statement line."
274
+ echo -e "\n If you wish to DRY up your config you can 'source ~/.bashrc' at the top of your .bash_profile."
275
+ echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
276
+ fi
277
+ if [[ -s $HOME/.bashrc ]] && grep '&& return' $HOME/.bashrc ; then
278
+ echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n"
279
+ fi
280
+ echo -e "Installation of RVM to $rvm_path/ is complete.\n\n"
194
281
  fi
195
282
 
196
283
  exit 0
data/lib/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 24
4
+ :patch: 26
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.1.24"
8
+ s.version = "0.1.26"
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{2010-03-21}
12
+ s.date = %q{2010-04-05}
13
13
  s.default_executable = %q{rvm-install}
14
14
  s.description = %q{Manages Ruby interpreter environments and switching between them.}
15
15
  s.email = %q{wayneeseguin@gmail.com}
@@ -22,6 +22,8 @@ Gem::Specification.new do |s|
22
22
  "README",
23
23
  "binscripts/rvm",
24
24
  "binscripts/rvm-prompt",
25
+ "binscripts/rvm-update-head",
26
+ "binscripts/rvm-update-latest",
25
27
  "binscripts/rvmsudo",
26
28
  "config/db",
27
29
  "config/md5",
@@ -65,7 +67,6 @@ Gem::Specification.new do |s|
65
67
  "scripts/utility",
66
68
  "scripts/version"
67
69
  ]
68
- s.has_rdoc = false
69
70
  s.homepage = %q{http://github.com/wayneeseguin/rvm}
70
71
  s.post_install_message = %q{********************************************************************************
71
72
 
data/scripts/cd CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  # Source a .rvmrc file in a directory after changing to it, if it exists.
4
4
  # To disable this fature, set rvm_project_rvmrc=0 in $HOME/.rvmrc
5
- if [[ "$rvm_project_rvmrc" != 0 ]] ; then
5
+ if [[ "$rvm_project_rvmrc" -ne 0 ]] ; then
6
6
  cd() {
7
7
  builtin cd "$@"
8
8
  local cwd ; cwd=$(pwd)
9
9
  while : ; do
10
10
  if [[ -z "$cwd" ]] || [[ "$HOME" = "$cwd" ]] || [[ "/" = "$cwd" ]] ; then
11
- if [[ "$rvm_project_rvmrc_default" = 1 ]] ; then
11
+ if [[ "$rvm_project_rvmrc_default" -eq 1 ]] ; then
12
12
  rvm default 1>/dev/null 2>&1
13
13
  fi
14
14
  break
data/scripts/cli CHANGED
@@ -3,7 +3,7 @@
3
3
  __rvm_usage() { cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} ; }
4
4
 
5
5
  __rvm_parse_args() {
6
- if echo "$*" | grep -q 'trace' ; then echo "$*" ; __rvm_version ; fi
6
+ if echo "$@" | grep -q 'trace' ; then echo "$@" ; __rvm_version ; fi
7
7
 
8
8
  while [[ $# -gt 0 ]] ; do
9
9
  rvm_token="$1" ; shift
@@ -54,22 +54,22 @@ __rvm_parse_args() {
54
54
  export rvm_ruby_gem_home="$GEM_HOME"
55
55
 
56
56
  if [[ "clear" = "$1" ]] ; then
57
- unset rvm_gemset_name ; shift
57
+ __rvm_gemset_clear
58
58
  rvm_ruby_args="clear"
59
59
  elif [[ "use" = "$1" ]] ; then
60
60
  rvm_use_flag=1
61
61
  rvm_ruby_args="$@" ; shift
62
62
  export rvm_use_flag rvm_ruby_args
63
63
  rvm_gemset_name="$1"; shift
64
- if [[ ! -z "$(echo $rvm_gemset_name | grep '%')" ]] ; then
65
- rvm_ruby_string=$(echo $rvm_gemset_name | sed 's/\(.*\)%.*/\1/')
66
- rvm_gemset_name=$(echo $rvm_gemset_name | sed 's/.*%\(.*\)/\1/')
64
+ if [[ ! -z "$(echo $rvm_gemset_name | grep $rvm_gemset_separator)" ]] ; then
65
+ rvm_ruby_string=$(echo $rvm_gemset_name | sed 's/\(.*\)'${rvm_gemset_separator}'.*/\1/')
66
+ rvm_gemset_name=$(echo $rvm_gemset_name | sed 's/.*'${rvm_gemset_separator}'\(.*\)/\1/')
67
67
  if [[ "$rvm_ruby_string" != "$rvm_gemset_name" ]] ; then
68
- export rvm_ruby_string="$rvm_ruby_string%$rvm_gemset_name"
68
+ export rvm_ruby_string="$rvm_ruby_string${rvm_gemset_separator}$rvm_gemset_name"
69
69
  else
70
70
  unset rvm_ruby_string
71
71
  fi
72
- export rvm_ruby_gem_home="$rvm_ruby_gem_home%$rvm_gemset_name"
72
+ export rvm_ruby_gem_home="$rvm_ruby_gem_home${rvm_gemset_separator}$rvm_gemset_name"
73
73
  fi
74
74
  if [[ ! -z "$rvm_gemset_name" ]] ; then export rvm_gemset_name ; fi
75
75
  elif [[ "delete" = "$1" ]] ; then
@@ -77,15 +77,15 @@ __rvm_parse_args() {
77
77
  rvm_ruby_args="$@" ; shift
78
78
  rvm_gemset_name="$1"; shift
79
79
  export rvm_delete_flag rvm_ruby_args rvm_gemset_name
80
- if [[ ! -z "$(echo $rvm_gemset_name | grep '%')" ]] ; then
81
- rvm_ruby_string=$(echo $rvm_gemset_name | sed 's/\(.*\)%.*/\1/')
82
- rvm_gemset_name=$(echo $rvm_gemset_name | sed 's/.*%\(.*\)/\1/')
80
+ if [[ ! -z "$(echo $rvm_gemset_name | grep $rvm_gemset_separator)" ]] ; then
81
+ rvm_ruby_string=$(echo $rvm_gemset_name | sed 's/\(.*\)'${rvm_gemset_separator}'.*/\1/')
82
+ rvm_gemset_name=$(echo $rvm_gemset_name | sed 's/.*'${rvm_gemset_separator}'\(.*\)/\1/')
83
83
  if [[ "$rvm_ruby_string" != "$rvm_gemset_name" ]] ; then
84
- export rvm_ruby_string="$rvm_ruby_string%$rvm_gemset_name"
84
+ export rvm_ruby_string="$rvm_ruby_string${rvm_gemset_separator}$rvm_gemset_name"
85
85
  else
86
86
  unset rvm_ruby_string
87
87
  fi
88
- export rvm_ruby_gem_home="$rvm_ruby_gem_home%$rvm_gemset_name"
88
+ export rvm_ruby_gem_home="$rvm_ruby_gem_home${rvm_gemset_separator}$rvm_gemset_name"
89
89
  fi
90
90
  if [[ ! -z "$rvm_gemset_name" ]] ; then export rvm_gemset_name ; fi
91
91
  else
@@ -206,31 +206,7 @@ __rvm_parse_args() {
206
206
  rvm_action="${rvm_action:-use}"
207
207
  ;;
208
208
 
209
- --head)
210
- #if [[ -z "$rvm_ruby_string" ]] ; then export rvm_ruby_string="head"; else export rvm_ruby_string="${rvm_ruby_string}-head" ; fi
211
- #rvm_action="${rvm_action:-use}"
212
- #rvm_ruby_revision="head"
213
- export rvm_head_flag=1
214
- ;;
215
-
216
- #
217
- # Legacy items, replaced with ruby strings.
218
- #
219
- #-t|--tag)
220
- # rvm_ruby_tag="$1";
221
- # rvm_action="${rvm_action:-use}"
222
- # shift
223
- #;;
224
- #--rev|--revision)
225
- # rvm_ruby_revision="$1";
226
- # rvm_action="${rvm_action:-use}"
227
- # shift
228
- #;;
229
- #-b|--branch)
230
- # rvm_ruby_branch="$1";
231
- # rvm_action="${rvm_action:-use}"
232
- # shift
233
- #;;
209
+ --head) export rvm_head_flag=1 ;;
234
210
 
235
211
  --bin)
236
212
  if [[ "update" = "$rvm_action" ]] ; then
@@ -292,7 +268,6 @@ __rvm_parse_args() {
292
268
  export rvm_ruby_string="$rvm_token"
293
269
  ;;
294
270
 
295
-
296
271
  -h|--help|usage|help) rvm_action=help ;;
297
272
  -G|--gems) rvm_gems_path="$1" ; shift ;;
298
273
  --source) rvm_src_path="$1" ; shift ;;
@@ -310,27 +285,20 @@ __rvm_parse_args() {
310
285
  --proxy) export rvm_proxy="$1" ; shift ;;
311
286
  --disable-llvm|--disable-jit) export rvm_llvm_flag=0 ;;
312
287
  --enable-llvm|--enable-jit) export rvm_llvm_flag=1 ;;
288
+ reboot|damnit|wtf|argh|BOOM|boom|wth) $rvm_action="reboot" ;;
313
289
 
314
- --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--passenger|--editor|--sticky|--create|--rvmrc)
290
+ --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--passenger|--editor|--sticky|--create|--rvmrc|--gems)
315
291
  export rvm_$(echo $rvm_token | sed 's#-##g')_flag=1
316
292
  if [[ "--debug" = "$rvm_token" ]] ; then export rvm_debug_flag ; fi
317
293
  ;;
318
294
 
319
- reboot|flush|asdf|damnit|wtf|argh|work|workdamnit|BOOM|boom|wth)
320
- $rvm_action="reboot"
321
- ;;
322
-
323
- --)
324
- rvm_ruby_args="$*"
325
- rvm_parse_break=1
326
- ;;
327
-
295
+ --) rvm_ruby_args="$*" ; rvm_parse_break=1 ;;
328
296
  *)
329
297
  if [[ ! -z "$rvm_token" ]] ; then
330
298
  if [[ "gemset" = "$rvm_action" ]] ; then
331
- if $rvm_scripts_path/match "$rvm_token" "^.+%.+$" ; then
332
- export rvm_gemset_name="$(echo "$rvm_token" | awk -F'%' '{print $2}')"
333
- export rvm_ruby_string="$(echo "$rvm_token" | awk -F'%' '{print $1}')"
299
+ if $rvm_scripts_path/match "$rvm_token" "^.+${rvm_gemset_separator}.+$" ; then
300
+ export rvm_gemset_name="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $2}')"
301
+ export rvm_ruby_string="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $1}')"
334
302
  elif [[ ! -z "$(echo "$rvm_token" | awk '/\.gems$/')" ]] ; then
335
303
  export rvm_file_name="$(echo "$rvm_token" | sed 's#\.gems##g').gems"
336
304
  # elif [[ ! -z "$(echo "$rvm_token" | awk '/\.gems$/')" ]] ; then
@@ -343,9 +311,9 @@ __rvm_parse_args() {
343
311
  if [[ -z "$rvm_action" ]] ; then
344
312
  rvm_action="ruby" # Not sure if we really want to do this but we'll try it out.
345
313
  fi
346
- elif $rvm_scripts_path/match "$rvm_token" "^.+%.+$" ; then
347
- export rvm_gemset_name="$(echo "$rvm_token" | awk -F'%' '{print $2}')"
348
- export rvm_ruby_string="$(echo "$rvm_token" | awk -F'%' '{print $1}')"
314
+ elif $rvm_scripts_path/match "$rvm_token" "^.+${rvm_gemset_separator}.+$" ; then
315
+ export rvm_gemset_name="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $2}')"
316
+ export rvm_ruby_string="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $1}')"
349
317
  elif $rvm_scripts_path/match "$rvm_token" "-" ; then
350
318
  export rvm_ruby_string="$rvm_token"
351
319
  elif $rvm_scripts_path/match "$rvm_token" "^[0-9].[0-9]" ; then
@@ -442,12 +410,12 @@ rvm() {
442
410
 
443
411
  # Clear the gemset.
444
412
  if [[ "$rvm_delete_flag" -eq 1 ]] ; then
445
- gem_prefix="$(echo $GEM_HOME | sed 's/%.*$//')"
446
- if [[ "$GEM_HOME" = "$gem_prefix%$rvm_gemset_name" ]] ; then
413
+ gem_prefix="$(echo $GEM_HOME | sed 's/'${rvm_gemset_separator}'.*$//')"
414
+ if [[ "$GEM_HOME" = "${gem_prefix}${rvm_gemset_separator}${rvm_gemset_name}" ]] ; then
447
415
  rvm_ruby_gem_home="$gem_prefix"
448
416
  GEM_HOME="$rvm_ruby_gem_home"
449
417
  BUNDLE_PATH="$rvm_ruby_gem_home"
450
- GEM_PATH="$rvm_ruby_gem_home/bin:$rvm_ruby_gem_home%global/bin"
418
+ GEM_PATH="$rvm_ruby_gem_home/bin:$rvm_ruby_gem_home${rvm_gemset_separator}global/bin"
451
419
  export rvm_ruby_gem_home GEM_HOME BUNDLE_PATH GEM_PATH
452
420
  fi ; unset gem_prefix
453
421
  fi