rvm 0.1.46 → 0.1.47

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,6 +9,8 @@
9
9
  (ruby-)1.9.1-head
10
10
  (ruby-)1.9.2-preview1
11
11
  (ruby-)1.9.2-preview3
12
+ (ruby-)1.9.2-rc1
13
+ (ruby-)1.9.2-rc2
12
14
  (ruby-)1.9.2(-p0)
13
15
  (ruby-)1.9.2-head
14
16
  ruby-head
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 46
4
+ :patch: 47
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.1.46"
8
+ s.version = "0.1.47"
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-08-18}
12
+ s.date = %q{2010-08-21}
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}
@@ -587,10 +587,8 @@ rvm() {
587
587
  reload) unset rvm_loaded_flag ; rvm_reload_flag=1 ;;
588
588
 
589
589
  fetch|install|uninstall|remove)
590
- if [[ -n "$rvm_ruby_strings" ]] && $rvm_scripts_path/match "$rvm_ruby_strings" "," ; then
590
+ if [[ -n "$rvm_ruby_strings" ]]; then
591
591
  $rvm_scripts_path/manage "$rvm_action" "$rvm_ruby_strings"
592
- elif [[ -n "$rvm_ruby_string" ]]; then
593
- $rvm_scripts_path/manage "$rvm_action" "$rvm_ruby_string"
594
592
  else
595
593
  $rvm_scripts_path/manage "$rvm_action"
596
594
  fi
@@ -79,6 +79,10 @@ gemset_dir() {
79
79
  gemset_create() {
80
80
  rvm_ruby_gem_prefix=$(echo $rvm_ruby_gem_home | sed 's/'${rvm_gemset_separator}'.*$//')
81
81
  for gemset in $(echo $gems_args) ; do
82
+ if [[ "$gemset" == *"${rvm_gemset_separator}"* ]]; then
83
+ $rvm_scripts_path/log "error" "Can't do that, it contains a \"${rvm_gemset_separator}\"."
84
+ continue
85
+ fi
82
86
  gem_home="${rvm_ruby_gem_prefix}${rvm_gemset_separator}${gemset}"
83
87
  \mkdir -p "$gem_home"
84
88
  # When the globalcache is enabled, we need to ensure we setup the cache directory correctly.
@@ -35,7 +35,7 @@ list_gemsets() {
35
35
  done ; unset version
36
36
 
37
37
  if [[ -f "$rvm_config_path/default" ]] && [[ -s $rvm_config_path/default ]] ; then
38
- version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n1 | awk -F"'" '{print $2}' | xargs basename)
38
+ version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n1 | awk -F"'" '{print $2}' | xargs basename --)
39
39
  if [[ ! -z "$version" ]] ; then
40
40
  printf "\n\nDefault Ruby (for new shells)\n"
41
41
  string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]"
@@ -50,10 +50,10 @@ list_gemsets() {
50
50
 
51
51
  list_default() {
52
52
  if [[ "$1" = "string" ]] ; then
53
- $rvm_scripts_path/alias show default 2>/dev/null | awk -F"$rvm_gemset_separator" '{print $1}' | xargs basename
53
+ $rvm_scripts_path/alias show default 2>/dev/null | awk -F"$rvm_gemset_separator" '{print $1}' | xargs basename --
54
54
  else
55
55
  if [[ -L "$rvm_rubies_path/default" ]]; then
56
- version=$($rvm_scripts_path/alias show default 2>/dev/null | awk -F"$rvm_gemset_separator" '{print $1}' | xargs basename)
56
+ version=$($rvm_scripts_path/alias show default 2>/dev/null | awk -F"$rvm_gemset_separator" '{print $1}' | xargs basename --)
57
57
  if [[ ! -z "$version" ]] ; then
58
58
  printf "\n\nDefault Ruby (for new shells)\n"
59
59
  string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]"
@@ -81,7 +81,7 @@ list_strings() {
81
81
  # This is meant to be used with scripting.
82
82
  list_gemset_strings() {
83
83
  local all_rubies="$(list_strings)"
84
- for gemset in $(\ls $rvm_gems_path/ 2>/dev/null | xargs -n1 basename | grep -v '^\(@\|doc$\|cache$\|system$\)' | sort); do
84
+ for gemset in $(\ls $rvm_gems_path/ 2>/dev/null | xargs -n1 basename -- | grep -v '^\(@\|doc$\|cache$\|system$\)' | sort); do
85
85
  local ruby_name="$(echo "$gemset" | awk -F$rvm_gemset_separator '{print $1}')"
86
86
  [[ "$all_rubies" != *"$ruby_name"* ]] && continue
87
87
  echo "$gemset"
@@ -94,6 +94,10 @@ list_known_strings() {
94
94
  }
95
95
 
96
96
  list_known() {
97
+ if [[ "$1" = "strings" ]]; then
98
+ list_known_strings
99
+ return 0
100
+ fi
97
101
  if [[ -z "$rvm_interactive" ]] || [[ -z "$TERM" ]] || [[ "unknown" = "$TERM" ]] ; then
98
102
  cat "$rvm_config_path/known"
99
103
  else
@@ -102,7 +106,17 @@ list_known() {
102
106
  }
103
107
 
104
108
 
109
+ list_rubies_strings() {
110
+ find "$rvm_rubies_path/" -type d -maxdepth 1 | tail -n+2 | xargs -n1 basename -- | __rvm_strip
111
+ }
112
+
105
113
  list_rubies() {
114
+
115
+ if [[ "$1" = "strings" ]]; then
116
+ list_rubies_strings
117
+ return 0
118
+ fi
119
+
106
120
  echo
107
121
 
108
122
  current_ruby="$(__rvm_environment_identifier | awk -F"$rvm_gemset_separator" '{print $1}')"
@@ -126,7 +140,7 @@ list_rubies() {
126
140
  done ; unset version
127
141
 
128
142
  if [[ -f "$rvm_config_path/default" ]] && [[ -s $rvm_config_path/default ]] ; then
129
- version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n 1 | awk -F"'" '{print $2}' | xargs basename)
143
+ version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n 1 | awk -F"'" '{print $2}' | xargs basename --)
130
144
  if [[ ! -z "$version" ]] ; then
131
145
  printf "\n\nDefault Ruby (for new shells)\n"
132
146
  string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]"
@@ -1190,7 +1190,7 @@ __rvm_manage_rubies() {
1190
1190
  __rvm_unset_ruby_variables
1191
1191
  done
1192
1192
  else # all
1193
- if [[ "$rvm_action" != "install" ]] ; then
1193
+ if [[ "$rvm_action" != "install" && "$rvm_action" != "remove" && "$rvm_action" != "uninstall" ]] ; then
1194
1194
  while read -r bin_line
1195
1195
  do # Keep this on second line damnit!
1196
1196
  if [[ -x "$bin_line" ]] ; then
@@ -1208,7 +1208,7 @@ __rvm_manage_rubies() {
1208
1208
  fi
1209
1209
  done < <(\ls $rvm_rubies_path/*/bin/ruby 2> /dev/null)
1210
1210
  else
1211
- $rvm_scripts_path/log "warn" 'Really? Install all? See "rvm list known" and limit the selection to something more sane please :)'
1211
+ $rvm_scripts_path/log "warn" 'Really? '"$rvm_action"' all? See "rvm list known" and limit the selection to something more sane please :)'
1212
1212
  fi
1213
1213
  fi
1214
1214
 
@@ -1217,6 +1217,7 @@ __rvm_manage_rubies() {
1217
1217
 
1218
1218
  }
1219
1219
 
1220
- rvm_action="$1" ; rubies_string="$2"
1220
+ rvm_action="$1"
1221
+ rubies_string="$2"
1221
1222
  __rvm_manage_rubies
1222
1223
  exit $?
@@ -24,7 +24,7 @@ if [[ "Linux" = "$system" ]] ; then
24
24
  printf "\n $ aptitude install curl sun-java6-bin sun-java6-jre sun-java6-jdk"
25
25
 
26
26
  printf "\n $item For MRI & ree (if you wish to use it) you will need (depending on what you are installing):"
27
- printf "\n $ aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev vim libsqlite3-0 libsqlite3-dev sqlite3 libreadline5-dev libreadline6-dev libxml2-dev git-core subversion autoconf"
27
+ printf "\n $ aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev vim libsqlite3-0 libsqlite3-dev sqlite3 libreadline-dev libxml2-dev git-core subversion autoconf"
28
28
 
29
29
  printf "\n $item For IronRuby (if you wish to use it) you will need:"
30
30
  printf "\n $ aptitude install curl mono-2.0-devel"
@@ -292,17 +292,19 @@ __rvm_use() {
292
292
 
293
293
  environment_id="$(__rvm_environment_identifier)"
294
294
 
295
- if [[ ! -z "$rvm_default_flag" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then
295
+ if [[ -n "$rvm_default_flag" && "default" != "$rvm_ruby_interpreter" ]] ; then
296
296
  if [[ "$rvm_selfcontained" = "0" ]] ; then
297
297
  # Sets up the default wrappers.
298
- $rvm_scripts_path/wrapper "$rvm_ruby_string"
298
+ $rvm_scripts_path/wrapper "$rvm_ruby_string" --no-prefix
299
+ else
300
+ $rvm_scripts_path/wrapper "$rvm_scripts_path" "default"
299
301
  fi
300
302
  if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
301
303
  $rvm_scripts_path/alias delete default &> /dev/null
302
- \rm -f $rvm_bin_path/default*
303
- [[ -f $rvm_config_path/default ]] && \rm -f $rvm_config_path/default
304
- [[ -f $rvm_environments_path/default ]] && \rm -f $rvm_environments_path/default
305
- [[ -f $rvm_wrappers_path/default ]] && \rm -f $rvm_wrappers_path/default
304
+ \find "$rvm_bin_path" -name 'default_*' -maxdepth 1 -delete
305
+ \rm -f $rvm_config_path/default
306
+ \rm -f $rvm_environments_path/default
307
+ \rm -rf $rvm_wrappers_path/default
306
308
  else
307
309
  RUBY_VERSION="$($rvm_ruby_home/bin/ruby -v | sed 's#^\(.*\) (.*$#\1#')"
308
310
  export GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME RUBY_VERSION
@@ -7,9 +7,6 @@ if [[ -z "$1" ]] ; then
7
7
  exit 1
8
8
  fi
9
9
 
10
- action="$1" ; shift
11
- args="$*"
12
-
13
10
  __rvm_attempt_single_exec() {
14
11
  # Return if we have multiple rubies. or we're not running exec.
15
12
  local ruby_string_lines="$(printf "$rvm_ruby_strings" | wc -l | __rvm_strip)"
@@ -160,6 +157,16 @@ __rvm_json() {
160
157
 
161
158
  rubies=() ; successes=() ; errors=() ; statuses=()
162
159
 
160
+
161
+ action="$1";
162
+ [[ "$#" -gt 0 ]] && shift
163
+ args="$*"
164
+
165
+ if [[ "$action" == "ruby" ]] && echo "$args" | grep -q "^'--[^[:space:]]*'$" ; then
166
+ $rvm_scripts_path/log "warn" "You called rvm ruby with the arguments $args which look like use options."
167
+ $rvm_scripts_path/log "warn" "Please note that 'rvm ruby' invokes set operations instead."
168
+ fi
169
+
163
170
  rvm_ruby_strings="$(__rvm_expand_ruby_string "$rvm_ruby_strings")"
164
171
 
165
172
  # Check for a single ruby && exec if present.
@@ -591,14 +591,6 @@ __rvm_ensure_has_environment_files() {
591
591
  local environment_identifier="$(__rvm_environment_identifier)"
592
592
  file_name="${rvm_environments_path}/$environment_identifier"
593
593
 
594
- # Ensure system is a blank file.
595
- if [[ "$environment_identifier" == "system" ]]; then
596
- \rm -f "$file_name" 2>&1 | grep -v 'rm: cannot remove .* Permission denied'
597
- \mkdir -p "$(dirname "$file_name")"
598
- \touch "$file_name" 2>&1 | grep -v 'touch: cannot touch .* Permission denied'
599
- return
600
- fi
601
-
602
594
  if [[ ! -s "$file_name" ]] ; then
603
595
  \mkdir -p "${rvm_environments_path}"
604
596
  echo "export PATH=\"${rvm_ruby_gem_home}/bin:${rvm_ruby_global_gems_path}/bin:${rvm_ruby_home}/bin:${rvm_bin_path}:\$PATH\"" > $file_name
@@ -656,6 +648,16 @@ __rvm_ultimate_question() {
656
648
  printf "\nUltimate Question."
657
649
  }
658
650
 
651
+ __rvm_load_env_file() {
652
+ if [[ -f "$rvm_environments_path/$1" ]]; then
653
+ # Restore the path to it's state minus rvm
654
+ PATH="$(echo $PATH | \tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)"
655
+ . "$rvm_environments_path/$1"
656
+ else
657
+ rvm use "$1" >/dev/null 2>&1
658
+ fi
659
+ }
660
+
659
661
  # Checks the rvmrc for the given directory. Note that if
660
662
  # argument is passed, it will be used instead of pwd.
661
663
  __rvm_project_rvmrc() {
@@ -663,23 +665,19 @@ __rvm_project_rvmrc() {
663
665
  # Get the first argument or the pwd.
664
666
  cwd="${1:-"$(pwd)"}"
665
667
  while : ; do
666
- if [[ -z "$cwd" ]] || [[ "$HOME" = "$cwd" ]] || [[ "/" = "$cwd" ]] ; then
668
+ if [[ -z "$cwd" || "$HOME" = "$cwd" || "/" = "$cwd" ]] ; then
667
669
  if [[ -n "$rvm_rvmrc_cwd" ]] ; then
668
- if [[ -f "$rvm_environments_path/$rvm_previous_environment" ]] ; then
669
- . "$rvm_environments_path/$rvm_previous_environment"
670
- else
671
- if [[ -f "$rvm_environments_path/default" ]] ; then
672
- . "$rvm_environments_path/default"
673
- fi
670
+ if [[ "$rvm_project_rvmrc_default" = "1" ]]; then
671
+ __rvm_load_env_file "default"
672
+ elif [[ -n "$rvm_previous_environment" ]] ; then
673
+ __rvm_load_env_file "$rvm_previous_environment"
674
674
  fi ; unset rvm_rvmrc_cwd rvm_previous_environment
675
675
  fi
676
676
  break
677
677
  else
678
678
  if [[ -f "$cwd/.rvmrc" ]] ; then
679
679
  if [[ "$rvm_rvmrc_cwd" != "$cwd" ]] ; then
680
- if [[ -z "$rvm_previous_environment" ]] ; then
681
- rvm_previous_environment="$(__rvm_environment_identifier)"
682
- fi
680
+ rvm_previous_environment="$(__rvm_environment_identifier)"
683
681
  rvm_rvmrc_cwd="$cwd"
684
682
  source "$cwd/.rvmrc"
685
683
  fi
@@ -736,12 +734,14 @@ __rvm_environment_identifier() {
736
734
  }
737
735
 
738
736
  __rvm_expand_ruby_string() {
739
- if [[ -z "$1" || "$1" = "all" || "$1" == "all-gemsets" ]]; then
737
+ if [[ -z "$1" || "$1" = "all" ]]; then
738
+ $rvm_scripts_path/list strings | tr ' ' "\n" | __rvm_strip
739
+ elif [[ "$1" = "all" || "$1" == "all-gemsets" ]]; then
740
740
  $rvm_scripts_path/list gemsets strings | __rvm_strip
741
741
  elif [[ "$1" == "default-with-rvmrc" || "$1" == "rvmrc" ]]; then
742
742
  $rvm_scripts_path/tools path-identifier "$(pwd)"
743
743
  elif [[ "$1" == "all-rubies" || "$1" == "rubies" ]]; then
744
- $rvm_scripts_path/list strings | tr ' ' "\n" | __rvm_strip
744
+ $rvm_scripts_path/list rubies strings | __rvm_strip
745
745
  elif [[ "$1" == "current" || "$1" == "gemsets" ]]; then
746
746
  local current_ruby="$(__rvm_environment_identifier | awk -F"$rvm_gemset_separator" '{print $1}')"
747
747
  rvm_silence_logging=1 $rvm_scripts_path/gemsets list | sed "s/^/$current_ruby$rvm_gemset_separator/" | __rvm_strip
@@ -67,11 +67,6 @@ prefix="$1"
67
67
 
68
68
  binaries="$(echo "$@" | __rvm_strip)"
69
69
 
70
- if [[ 'system' == '$ruby_string' ]]; then
71
- $rvm_scripts_path/log "error" "Wrapper can't be called with system rubies - sorry!"
72
- exit 1
73
- fi
74
-
75
70
  # Default the list of binaries to those we use regularily.
76
71
  if [[ -z "$binaries" ]] ; then
77
72
  binaries="ruby gem irb ri rdoc rake erb testrb"
@@ -101,6 +96,14 @@ for binary_name in $binaries; do
101
96
  \rm -rf "$destination"
102
97
  ln -nsf "$file_name" "$destination"
103
98
  fi; unset destination
99
+ elif [[ "$prefix" == "--no-prefix" ]]; then
100
+ override_check=1
101
+ wrap_binary
102
+ if [[ -f "$file_name" ]]; then
103
+ destination="$rvm_bin_path/$binary_name"
104
+ \rm -rf "$destination"
105
+ ln -nsf "$file_name" "$destination"
106
+ fi; unset destination
104
107
  else
105
108
  symlink_binary
106
109
  fi ; unset file_name
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 71
4
+ hash: 69
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 46
10
- version: 0.1.46
9
+ - 47
10
+ version: 0.1.47
11
11
  platform: ruby
12
12
  authors:
13
13
  - Wayne E. Seguin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-18 00:00:00 -04:00
18
+ date: 2010-08-21 00:00:00 -04:00
19
19
  default_executable: rvm-install
20
20
  dependencies: []
21
21