rvm 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/config/db +2 -2
- data/install +1 -3
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +2 -2
- data/scripts/cli +2 -1
- data/scripts/gems +2 -1
- data/scripts/install +1 -3
- data/scripts/manage +19 -14
- data/scripts/rvm-install +1 -3
- data/scripts/selector +2 -0
- data/scripts/update +1 -3
- data/scripts/utility +57 -8
- metadata +2 -2
data/config/db
CHANGED
@@ -11,9 +11,9 @@ ree_version=1.8.7
|
|
11
11
|
ree_1.8.6_patch_level=20090610
|
12
12
|
ree_1.8.6_url=http://rubyforge.org/frs/download.php/58677
|
13
13
|
ree_1.8.6_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition.git
|
14
|
-
ree_1.8.7_url=http://rubyforge.org/frs/download.php/
|
14
|
+
ree_1.8.7_url=http://rubyforge.org/frs/download.php/68719
|
15
15
|
ree_1.8.7_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition187.git
|
16
|
-
ree_1.8.7_patch_level=
|
16
|
+
ree_1.8.7_patch_level=2010.01
|
17
17
|
ruby_1.9.1_patch_level=378
|
18
18
|
ruby_1.9.2_patch_level=preview1
|
19
19
|
ruby_1.8.5_patch_level=231
|
data/install
CHANGED
@@ -67,9 +67,7 @@ rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
|
|
67
67
|
rvm_symlink_path="${rvm_symlink_path:-/usr/local/bin}"
|
68
68
|
rvm_gem_options="${rvm_gem_options:-"--no-rdoc --no-ri"}"
|
69
69
|
|
70
|
-
|
71
|
-
eval "mkdir -p '\$rvm_${path}_path/'"
|
72
|
-
done
|
70
|
+
mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gem_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path $rvm_symlink_path
|
73
71
|
|
74
72
|
for file in README LICENCE ; do
|
75
73
|
cp -f "$source_path/$file" "$rvm_path/"
|
data/lib/VERSION.yml
CHANGED
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.
|
8
|
+
s.version = "0.1.2"
|
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-01-
|
12
|
+
s.date = %q{2010-01-24}
|
13
13
|
s.default_executable = %q{rvm-install}
|
14
14
|
s.description = %q{Manages Ruby interpreter installations and switching between them.}
|
15
15
|
s.email = %q{wayneeseguin@gmail.com}
|
data/scripts/cli
CHANGED
@@ -8,7 +8,7 @@ __rvm_parse_args() {
|
|
8
8
|
while [[ $# -gt 0 ]] ; do
|
9
9
|
rvm_token="$1" ; shift
|
10
10
|
case "$rvm_token" in
|
11
|
-
fetch|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|readline|monitor|notes)
|
11
|
+
fetch|path|info|setup|version|srcdir|list|rubies|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|readline|monitor|notes)
|
12
12
|
rvm_action=$rvm_token
|
13
13
|
;;
|
14
14
|
|
@@ -379,6 +379,7 @@ rvm() {
|
|
379
379
|
use) __rvm_use ; result=$? ;;
|
380
380
|
srcdir) __rvm_source_dir ; result=$? ;;
|
381
381
|
list) __rvm_list ; result=$? ;;
|
382
|
+
rubies) __rvm_rubies ; result=$? ;;
|
382
383
|
version) __rvm_version ; result=$? ;;
|
383
384
|
reset) __rvm_reset ; result=$? ;;
|
384
385
|
implode) __rvm_implode ; result=$? ;;
|
data/scripts/gems
CHANGED
@@ -171,6 +171,7 @@ __rvm_parse_gem_line() {
|
|
171
171
|
fi
|
172
172
|
}
|
173
173
|
|
174
|
+
# Install a gem
|
174
175
|
__rvm_gem_install() {
|
175
176
|
__rvm_parse_gem_line $*
|
176
177
|
|
@@ -236,8 +237,8 @@ __rvm_gem_install() {
|
|
236
237
|
return $result
|
237
238
|
}
|
238
239
|
|
240
|
+
# Output the user's current gem directory.
|
239
241
|
__rvm_gems_gemdir() {
|
240
|
-
|
241
242
|
if [[ "$rvm_user_flag" -eq 1 ]] ; then
|
242
243
|
echo $(rvm system ; gem env | grep "\- $HOME" | awk '{print $NF}')
|
243
244
|
elif [[ "$rvm_system_flag" -eq 1 ]] ; then
|
data/scripts/install
CHANGED
@@ -67,9 +67,7 @@ rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
|
|
67
67
|
rvm_symlink_path="${rvm_symlink_path:-/usr/local/bin}"
|
68
68
|
rvm_gem_options="${rvm_gem_options:-"--no-rdoc --no-ri"}"
|
69
69
|
|
70
|
-
|
71
|
-
eval "mkdir -p '\$rvm_${path}_path/'"
|
72
|
-
done
|
70
|
+
mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gem_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path $rvm_symlink_path
|
73
71
|
|
74
72
|
for file in README LICENCE ; do
|
75
73
|
cp -f "$source_path/$file" "$rvm_path/"
|
data/scripts/manage
CHANGED
@@ -16,7 +16,6 @@ __rvm_install_source() {
|
|
16
16
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
17
17
|
|
18
18
|
$rvm_scripts_path/log "info" "Installing Ruby from source to: $rvm_ruby_home"
|
19
|
-
mkdir -p "$rvm_ruby_log_path"
|
20
19
|
__rvm_pushpop "$rvm_src_path"
|
21
20
|
if [[ ! -z "$rvm_force_flag" ]] ; then rm -rf "$rvm_ruby_home" "$rvm_ruby_src_path" ; fi
|
22
21
|
|
@@ -148,11 +147,15 @@ PATH="$rvm_ruby_home/bin:$rvm_ruby_gem_home/bin:\$PATH" ; export PATH
|
|
148
147
|
exec $macruby_path/mac$binary_name $prefix "\$@"
|
149
148
|
RubyWrapper
|
150
149
|
)
|
150
|
+
|
151
151
|
for file_name in "$rvm_ruby_home/bin/$binary_name" "$rvm_bin_path/$binary_name-$rvm_ruby_string" ; do
|
152
152
|
rm -f $file_name
|
153
153
|
echo "$ruby_wrapper" > $file_name
|
154
154
|
if [[ -f $file_name ]] ; then chmod +x $file_name ; fi
|
155
155
|
done
|
156
|
+
if [[ "$binary_name" = "ruby" ]] ; then
|
157
|
+
echo "$ruby_wrapper" > $rvm_bin_path/$rvm_ruby_string
|
158
|
+
fi
|
156
159
|
unset file_name ruby_wrapper binary_name files prefix
|
157
160
|
done
|
158
161
|
__rvm_irbrc
|
@@ -186,7 +189,6 @@ RubyWrapper
|
|
186
189
|
fi
|
187
190
|
builtin cd "$rvm_ruby_src_path"
|
188
191
|
|
189
|
-
mkdir -p "$rvm_ruby_log_path"
|
190
192
|
mkdir -p "${rvm_ruby_home}/lib/ruby/gems/1.8/gems"
|
191
193
|
if [[ ! -z "$rvm_ruby_configure_flags" ]] ; then
|
192
194
|
rvm_ruby_configure_flags="$(echo $rvm_ruby_configure_flags | sed 's#--#-c --#g')"
|
@@ -340,7 +342,6 @@ RubyWrapper
|
|
340
342
|
echo -e "java must be installed and in your path in order to install JRuby." ; return 1
|
341
343
|
fi
|
342
344
|
|
343
|
-
mkdir -p "$rvm_ruby_log_path"
|
344
345
|
__rvm_pushpop $rvm_src_path
|
345
346
|
__rvm_fetch_ruby
|
346
347
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
@@ -388,7 +389,6 @@ RubyWrapper
|
|
388
389
|
$rvm_scripts_path/log "error" "Prerequisite checks have failed. Aborting the installation." ; __rvm_pushpop ; return $result
|
389
390
|
fi
|
390
391
|
|
391
|
-
mkdir -p "$rvm_ruby_log_path"
|
392
392
|
__rvm_pushpop $rvm_src_path
|
393
393
|
|
394
394
|
if [[ ! -d "$rvm_src_path/$rvm_ruby_string" ]] || [[ ! -z "$rvm_force_flag" ]] ; then
|
@@ -424,8 +424,8 @@ RubyWrapper
|
|
424
424
|
$rvm_scripts_path/log "error" "There has been an error while trying to extract the gemstone package. Aborting the installation." ; __rvm_pushpop ; return $result
|
425
425
|
fi
|
426
426
|
|
427
|
-
|
428
|
-
|
427
|
+
chmod -R 777 "$rvm_gemstone_package_file" # for now.
|
428
|
+
ln -nfs "$rvm_gemstone_package_file" "gemstone"
|
429
429
|
|
430
430
|
__rvm_pushpop
|
431
431
|
|
@@ -453,14 +453,14 @@ RubyWrapper
|
|
453
453
|
#ln -fs "$rvm_ruby_home/$(echo $rvm_gemstone_package_file | awk -F'.' '{print $1}')" "$rvm_ruby_home/gemstone"
|
454
454
|
|
455
455
|
if [[ ! -e ${rvm_ruby_home}/etc/conf.d/maglev.conf ]] ; then
|
456
|
-
$rvm_scripts_path/log "info" "Creating default 'maglev' repository."
|
457
|
-
$rvm_bin_path/rvm 1.8.7 rake "stone:create[maglev]" >/dev/null
|
456
|
+
$rvm_scripts_path/log "info" "Creating default 'maglev' repository."
|
457
|
+
$rvm_bin_path/rvm 1.8.7 rake "stone:create[maglev]" >/dev/null 2>&1
|
458
458
|
fi
|
459
459
|
|
460
|
-
$rvm_scripts_path/log "info" "Generating maglev HTML documentation"
|
460
|
+
$rvm_scripts_path/log "info" "Generating maglev HTML documentation"
|
461
461
|
$rvm_bin_path/rvm 1.8.7 rake rdoc >/dev/null 2>&1
|
462
462
|
|
463
|
-
$rvm_scripts_path/log "info" "Generating smalltalk FFI."
|
463
|
+
$rvm_scripts_path/log "info" "Generating smalltalk FFI."
|
464
464
|
$rvm_bin_path/rvm 1.8.7 rake stwrappers >/dev/null 2>&1
|
465
465
|
|
466
466
|
|
@@ -479,9 +479,11 @@ RubyWrapper
|
|
479
479
|
if [[ "$rvm_head_flag" = 1 ]] ; then
|
480
480
|
mono_version="$(mono -V | head -n 1 | cut -d ' ' -f5)"
|
481
481
|
if $rvm_scripts_path/match "$mono_version" "([0-9]+)\.([0-9]+)\.?([0-9]+)?" ; then
|
482
|
-
|
482
|
+
mono_major_ver="$(echo $mono_version | cut -d '.' -f1)"
|
483
|
+
mono_minor_ver="$(echo $mono_version | cut -d '.' -f2)"
|
484
|
+
if [[ $mono_major_ver -lt 2 ]] || ( [[ $mono_major_ver -eq 2 ]] && [[ $mono_minor_ver -lt 6 ]] ) ; then
|
483
485
|
echo -e "Mono 2.6 (or greater) must be installed and in your path in order to build IronRuby from the repository."
|
484
|
-
echo -e "Version detected: ${
|
486
|
+
echo -e "Version detected: ${mono_version}"
|
485
487
|
return 1
|
486
488
|
fi
|
487
489
|
else
|
@@ -503,8 +505,8 @@ RubyWrapper
|
|
503
505
|
|
504
506
|
cp -r $rvm_ruby_src_path/Merlin/Main/Bin/mono_release/* $rvm_ruby_home/bin/
|
505
507
|
cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Scripts/bin/* $rvm_ruby_home/bin/
|
506
|
-
cp -r $rvm_ruby_src_path/Merlin/External.LCA_RESTRICTED/Languages/Ruby/
|
507
|
-
cp -r $rvm_ruby_src_path/
|
508
|
+
cp -r $rvm_ruby_src_path/Merlin/External.LCA_RESTRICTED/Languages/Ruby/redist-libs/ruby/* $rvm_ruby_home/lib/ruby
|
509
|
+
cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Libs/* $rvm_ruby_home/lib/IronRuby
|
508
510
|
else
|
509
511
|
$rvm_scripts_path/log "info" "Retrieving IronRuby"
|
510
512
|
$rvm_scripts_path/fetch "$rvm_url"
|
@@ -545,6 +547,9 @@ RubyWrapper
|
|
545
547
|
echo "$ruby_wrapper" > $file_name
|
546
548
|
if [[ -f $file_name ]] ; then chmod +x $file_name ; fi
|
547
549
|
done
|
550
|
+
if [[ "$binary_name" = "ruby" ]] ; then
|
551
|
+
echo "$ruby_wrapper" > $rvm_bin_path/$rvm_ruby_string
|
552
|
+
fi
|
548
553
|
unset file_name ruby_wrapper binary_name binary_path files prefix
|
549
554
|
done
|
550
555
|
;;
|
data/scripts/rvm-install
CHANGED
@@ -67,9 +67,7 @@ rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
|
|
67
67
|
rvm_symlink_path="${rvm_symlink_path:-/usr/local/bin}"
|
68
68
|
rvm_gem_options="${rvm_gem_options:-"--no-rdoc --no-ri"}"
|
69
69
|
|
70
|
-
|
71
|
-
eval "mkdir -p '\$rvm_${path}_path/'"
|
72
|
-
done
|
70
|
+
mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gem_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path $rvm_symlink_path
|
73
71
|
|
74
72
|
for file in README LICENCE ; do
|
75
73
|
cp -f "$source_path/$file" "$rvm_path/"
|
data/scripts/selector
CHANGED
@@ -208,6 +208,8 @@ __rvm_select() {
|
|
208
208
|
|
209
209
|
rvm_ruby_selected_flag=1
|
210
210
|
|
211
|
+
mkdir -p $rvm_ruby_log_path
|
212
|
+
|
211
213
|
export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_configure_flags rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string
|
212
214
|
else
|
213
215
|
rvm_ruby_interpreter="${rvm_ruby_interpreter:-system}"
|
data/scripts/update
CHANGED
@@ -67,9 +67,7 @@ rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
|
|
67
67
|
rvm_symlink_path="${rvm_symlink_path:-/usr/local/bin}"
|
68
68
|
rvm_gem_options="${rvm_gem_options:-"--no-rdoc --no-ri"}"
|
69
69
|
|
70
|
-
|
71
|
-
eval "mkdir -p '\$rvm_${path}_path/'"
|
72
|
-
done
|
70
|
+
mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gem_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path $rvm_symlink_path
|
73
71
|
|
74
72
|
for file in README LICENCE ; do
|
75
73
|
cp -f "$source_path/$file" "$rvm_path/"
|
data/scripts/utility
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
+
# Query the rvm key-value database for a specific key
|
4
|
+
# Allow overrides from user specifications in $rvm_config_path/user
|
3
5
|
__rvm_db() {
|
4
6
|
key=$1 ; variable=$2
|
5
7
|
if [[ -f "$rvm_config_path/user" ]] ; then
|
@@ -20,6 +22,7 @@ __rvm_db() {
|
|
20
22
|
unset key value variable
|
21
23
|
}
|
22
24
|
|
25
|
+
# Ouput rvm environment information.
|
23
26
|
__rvm_info() {
|
24
27
|
if [[ ! -z "$(which ruby 2>/dev/null)" ]] ; then full_version=$(ruby -v) ; fi
|
25
28
|
|
@@ -51,10 +54,12 @@ environment:
|
|
51
54
|
MY_RUBY_HOME: "$MY_RUBY_HOME"
|
52
55
|
IRBRC: "$IRBRC"
|
53
56
|
Info
|
57
|
+
if [[ ! -z "$MAGLEV_HOME" ]] ; then echo " MAGLEV_HOME: $MAGLEV_HOME" ; fi
|
54
58
|
|
55
59
|
unset full_version
|
56
60
|
}
|
57
61
|
|
62
|
+
# Output debugging information that has been found useful to help people identify and resolve issues.
|
58
63
|
__rvm_debug() {
|
59
64
|
$rvm_scripts_path/log "debug" "PATH:\n$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"$5}')"
|
60
65
|
$rvm_scripts_path/log "debug" "uname -a: $(uname -a)"
|
@@ -90,7 +95,10 @@ __rvm_debug() {
|
|
90
95
|
$rvm_scripts_path/log "debug" "gem sources:\n$(gem sources | awk '/gems/')"
|
91
96
|
}
|
92
97
|
|
98
|
+
# ZSH has 1 based array indexing, bash has 0 based.
|
93
99
|
if [[ ! -z "$ZSH_VERSION" ]] ; then __shell_array_start=1 ; else __shell_array_start=0 ; fi
|
100
|
+
|
101
|
+
# Push an item onto a given array.
|
94
102
|
__rvm_push() {
|
95
103
|
array=$1 ; shift ; item=$2
|
96
104
|
# TODO: allow loop over more arguments.
|
@@ -99,30 +107,29 @@ __rvm_push() {
|
|
99
107
|
unset array item
|
100
108
|
}
|
101
109
|
|
110
|
+
# Clean all *duplicate* items out of the path. (keep first occurrence of each)
|
102
111
|
__rvm_clean_path() {
|
103
112
|
PATH=$(echo $PATH | tr -s ':' '\n' | awk '!($0 in a){a[$0];print}' | tr -s '\n' ':' | sed 's#:$##')
|
104
113
|
export PATH
|
105
114
|
}
|
106
115
|
|
116
|
+
# Clean all rvm items out of the current working path.
|
107
117
|
__rvm_remove_rvm_from_path() {
|
108
118
|
PATH=$(echo $PATH | tr -s ':' '\n' | grep -v "\.rvm" | tr -s '\n' ':' | sed 's#:$##')
|
109
119
|
export PATH
|
110
120
|
}
|
111
121
|
|
112
|
-
|
113
|
-
|
122
|
+
# Run a specified command and log it.
|
114
123
|
__rvm_run() {
|
115
124
|
log_file_name="$1" ; command="$2" ; message="$3"
|
116
|
-
rvm_ruby_log_path="$
|
117
|
-
mkdir -p $(dirname "$rvm_ruby_log_path/$log_file_name.log")
|
118
|
-
|
125
|
+
if [[ -z "$rvm_ruby_log_path" ]] ; then rvm_ruby_log_path="$rvm_log_path" ; fi
|
119
126
|
if [[ ! -z "$message" ]] ; then $rvm_scripts_path/log "info" "$message" ; fi
|
120
127
|
if [[ ! -z "$rvm_debug_flag" ]] ; then
|
121
128
|
$rvm_scripts_path/log "debug" "Executing: $command"
|
122
129
|
fi
|
123
130
|
|
124
131
|
touch "$rvm_ruby_log_path/$log_file_name.log" "$rvm_ruby_log_path/$log_file_name.error.log" # for zsh :(
|
125
|
-
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command" | tee "$rvm_ruby_log_path/$log_file_name.log"
|
132
|
+
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command" | tee "$rvm_ruby_log_path/$log_file_name.log" >> "$rvm_ruby_log_path/$log_file_name.error.log"
|
126
133
|
if [[ -z "$rvm_niceness" ]] || [[ "0" = "$rvm_niceness" ]] ; then
|
127
134
|
eval "$command" >> "$rvm_ruby_log_path/$log_file_name.log" 2>> "$rvm_ruby_log_path/$log_file_name.error.log"
|
128
135
|
else
|
@@ -132,6 +139,8 @@ __rvm_run() {
|
|
132
139
|
unset log_file command
|
133
140
|
}
|
134
141
|
|
142
|
+
# Unset both rvm variables as well as ruby-specific variables
|
143
|
+
# Preserve gemset if 'rvm_sticky_gems' is set (persist gemset unless clear is explicitely called).
|
135
144
|
__rvm_cleanup_variables() {
|
136
145
|
__rvm_unset_ruby_variables
|
137
146
|
|
@@ -140,6 +149,7 @@ __rvm_cleanup_variables() {
|
|
140
149
|
unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits
|
141
150
|
}
|
142
151
|
|
152
|
+
# Unset ruby-specific variables
|
143
153
|
__rvm_unset_ruby_variables() {
|
144
154
|
unset rvm_ruby_interpreter rvm_ruby_version rvm_url rvm_ruby_repo_url rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_ruby_binary rvm_ruby_home rvm_ruby_log_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_string rvm_ruby_src_path rvm_ruby_repo_url rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_head_flag rvm_ruby_configure rvm_ruby_mode rvm_ruby_patch rvm_ruby_package_file rvm_ruby_package_name
|
145
155
|
}
|
@@ -149,6 +159,7 @@ __rvm_load_rvmrc() {
|
|
149
159
|
if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
|
150
160
|
}
|
151
161
|
|
162
|
+
# Loop over the currently installed rubies and refresh their binscripts.
|
152
163
|
__rvm_bin_scripts() {
|
153
164
|
for rvm_ruby_binary in $rvm_rubies_path/*/bin/ruby ; do
|
154
165
|
if [[ -x "$rvm_ruby_binary" ]] ; then
|
@@ -159,6 +170,8 @@ __rvm_bin_scripts() {
|
|
159
170
|
done
|
160
171
|
}
|
161
172
|
|
173
|
+
# Write the bin/ wrapper script for currently selected ruby.
|
174
|
+
# TODO: Adjust binscript to be able to handle all rubies not just the standard interpreteres.
|
162
175
|
__rvm_bin_script() {
|
163
176
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
164
177
|
ruby_wrapper=$(cat <<RubyWrapper
|
@@ -178,6 +191,7 @@ RubyWrapper
|
|
178
191
|
chmod +x $rvm_bin_path/$rvm_ruby_package_name
|
179
192
|
}
|
180
193
|
|
194
|
+
# Load default ruby, if default is not set load system ruby.
|
181
195
|
__rvm_load_defaults() {
|
182
196
|
if [[ ! -s "$rvm_config_path/system" ]] ; then
|
183
197
|
for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME ; do
|
@@ -217,6 +231,8 @@ __rvm_load_defaults() {
|
|
217
231
|
fi
|
218
232
|
}
|
219
233
|
|
234
|
+
# Reset any rvm gathered information about the system and its state.
|
235
|
+
# rvm will refresh the stored information the next time it is called after reset.
|
220
236
|
__rvm_reset() {
|
221
237
|
PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)
|
222
238
|
PATH=$rvm_bin_path:$PATH ; export PATH
|
@@ -238,6 +254,7 @@ __rvm_reset() {
|
|
238
254
|
rm -f $rvm_bin_path/ruby $rvm_bin_path/gem $rvm_bin_path/rake $rvm_bin_path/irb $rvm_bin_path/default*
|
239
255
|
}
|
240
256
|
|
257
|
+
# Implode removes the entire rvm installation under $rvm_path.
|
241
258
|
__rvm_implode() {
|
242
259
|
while : ; do
|
243
260
|
$rvm_scripts_path/log "warn" "Are you SURE you wish for rvm to implode? This will remove $rvm_path ? (type 'yes' or 'no')"
|
@@ -262,6 +279,7 @@ __rvm_implode() {
|
|
262
279
|
done
|
263
280
|
}
|
264
281
|
|
282
|
+
# Output the current ruby's rvm source path.
|
265
283
|
__rvm_source_dir() {
|
266
284
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
267
285
|
if [[ -z "$rvm_ruby_src_path" ]] ; then
|
@@ -271,6 +289,15 @@ __rvm_source_dir() {
|
|
271
289
|
fi
|
272
290
|
}
|
273
291
|
|
292
|
+
# List all rvm installed rubies.
|
293
|
+
# This is meant to be used with scripting.
|
294
|
+
__rvm_rubies() {
|
295
|
+
\ls $rvm_rubies_path
|
296
|
+
}
|
297
|
+
|
298
|
+
# List all rvm installed rubies, default ruby and system ruby.
|
299
|
+
# Display the rubies, indicate their architecture and indicate which is currently used.
|
300
|
+
# This is not meant to be used with scripting. This is for interactive mode usage only.
|
274
301
|
__rvm_list() {
|
275
302
|
echo
|
276
303
|
if [[ ! -z "$rvm_all_flag" ]] ; then
|
@@ -298,7 +325,9 @@ __rvm_list() {
|
|
298
325
|
|
299
326
|
for version in $(\ls $rvm_rubies_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
|
300
327
|
if [[ ! -z "$(echo $version | awk '/^jruby-/')" ]] ; then
|
301
|
-
string="$($rvm_rubies_path/$version/bin/ruby -v | awk '{print $NF}')"
|
328
|
+
string="[ $($rvm_rubies_path/$version/bin/ruby -v | awk '{print $NF}') ]"
|
329
|
+
elif [[ ! -z "$(echo $version | awk '/^maglev-/')" ]] ; then
|
330
|
+
string="[ x86_64 ]"
|
302
331
|
else
|
303
332
|
string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
|
304
333
|
fi
|
@@ -342,6 +371,7 @@ __rvm_list() {
|
|
342
371
|
echo
|
343
372
|
}
|
344
373
|
|
374
|
+
# Initialize rvm, ensuring that the path and directories are as expected.
|
345
375
|
__rvm_initialize() {
|
346
376
|
rvm_ruby_load_path="."
|
347
377
|
rvm_ruby_require=""
|
@@ -355,6 +385,7 @@ __rvm_initialize() {
|
|
355
385
|
mkdir -p $rvm_src_path $rvm_bin_path $rvm_archives_path $rvm_gem_path $rvm_tmp_path
|
356
386
|
}
|
357
387
|
|
388
|
+
# Update rubygems or binscripts based on CLI selection.
|
358
389
|
__rvm_update() {
|
359
390
|
__rvm_pushpop $rvm_path
|
360
391
|
if [[ "head" = "$rvm_ruby_revision" ]] || [[ ! -z "$rvm_self_flag" ]] || [[ "update" = "$rvm_action" ]] || [[ ! -z "$rvm_update_flag" ]] ; then
|
@@ -368,6 +399,8 @@ __rvm_update() {
|
|
368
399
|
__rvm_pushpop
|
369
400
|
}
|
370
401
|
|
402
|
+
# Update rvm using rubygems
|
403
|
+
# If --head was specified, update from git repository master branch.
|
371
404
|
__rvm_update_rvm() {
|
372
405
|
mkdir -p "$rvm_src_path"
|
373
406
|
__rvm_pushpop "$rvm_src_path"
|
@@ -422,6 +455,7 @@ __rvm_reboot() {
|
|
422
455
|
fi ; unset response
|
423
456
|
}
|
424
457
|
|
458
|
+
# Perform an action using one of a selected ruby's specified binaries.
|
425
459
|
__rvm_ruby_do() {
|
426
460
|
__rvm_select
|
427
461
|
__rvm_use
|
@@ -481,6 +515,8 @@ __rvm_ruby_do() {
|
|
481
515
|
__rvm_unset_ruby_variables
|
482
516
|
}
|
483
517
|
|
518
|
+
# Loop over a set or all rvm installed rubies to perform some action.
|
519
|
+
# Record the results and report based on CLI selections.
|
484
520
|
__rvm_do() {
|
485
521
|
__rvm_state
|
486
522
|
|
@@ -516,6 +552,7 @@ __rvm_do() {
|
|
516
552
|
return ${#errors[*]}
|
517
553
|
}
|
518
554
|
|
555
|
+
# Output the summary in a human readable format.
|
519
556
|
__rvm_summary() {
|
520
557
|
export successes errors statuses
|
521
558
|
summary="\nSummary:\n\n"
|
@@ -531,6 +568,7 @@ __rvm_summary() {
|
|
531
568
|
return ${#errors[*]}
|
532
569
|
}
|
533
570
|
|
571
|
+
# Output the summary in a yaml format.
|
534
572
|
__rvm_yaml() {
|
535
573
|
export successes errors statuses
|
536
574
|
yaml="totals:\n rubies: ${#rubies[*]}\n successes: ${#successes[*]}\n errors: ${#errors[*]}\nsuccesses:"
|
@@ -552,6 +590,7 @@ __rvm_yaml() {
|
|
552
590
|
return ${#errors[*]}
|
553
591
|
}
|
554
592
|
|
593
|
+
# Output the summary in a json format.
|
555
594
|
__rvm_json() {
|
556
595
|
json="{"
|
557
596
|
json="$json\n \"totals\": { \"rubies\": ${#rubies[*]}, \"successes\": ${#successes[*]}, \"errors\": ${#errors[*]}},"
|
@@ -576,6 +615,7 @@ __rvm_json() {
|
|
576
615
|
return ${#errors[*]}
|
577
616
|
}
|
578
617
|
|
618
|
+
# Wrap the specified ruby code file in a Benchmark.bmbm block and execute it.
|
579
619
|
__rvm_benchmark() {
|
580
620
|
code="require \"benchmark\" \n Benchmark.bmbm do |benchmark| \n benchmark.report(\"${rvm_ruby_file}\") do \n"
|
581
621
|
echo -e "$code" > "$rvm_tmp_path/$$.rb"
|
@@ -589,13 +629,14 @@ __rvm_benchmark() {
|
|
589
629
|
__rvm_do
|
590
630
|
}
|
591
631
|
|
632
|
+
# Create the irbrc for the currently selected ruby installation.
|
592
633
|
__rvm_irbrc() {
|
593
|
-
# Create the irbrc for the currently selected ruby installation.
|
594
634
|
if [[ -d "$rvm_ruby_home" ]] && [[ ! -s "$rvm_ruby_irbrc" ]] ; then
|
595
635
|
cp $rvm_scripts_path/irbrc $rvm_ruby_irbrc
|
596
636
|
fi
|
597
637
|
}
|
598
638
|
|
639
|
+
# Push or Pop a directory based on zero or one directory argument provided.
|
599
640
|
__rvm_pushpop() {
|
600
641
|
if [[ -z "$1" ]] ; then
|
601
642
|
popd > /dev/null 2>&1
|
@@ -604,6 +645,8 @@ __rvm_pushpop() {
|
|
604
645
|
fi
|
605
646
|
}
|
606
647
|
|
648
|
+
# Save or restore the rvm's state. This is a toggle action.
|
649
|
+
# Meant for use before and after an operation that might reset the currently selected ruby.
|
607
650
|
__rvm_state() {
|
608
651
|
if [[ -z "$rvm_state" ]] ; then
|
609
652
|
if [[ -z "$(which ruby 2>/dev/null | awk /$(basename $rvm_rubies_path)/)" ]] ; then
|
@@ -619,6 +662,7 @@ __rvm_state() {
|
|
619
662
|
fi
|
620
663
|
}
|
621
664
|
|
665
|
+
# Output an inspection of selected 'binary' scripts, based on CLI selection.
|
622
666
|
__rvm_inspect() {
|
623
667
|
for binary in $rvm_ruby_args ; do
|
624
668
|
actual_file="$(which $binary 2>/dev/null)"
|
@@ -632,6 +676,8 @@ __rvm_inspect() {
|
|
632
676
|
done
|
633
677
|
}
|
634
678
|
|
679
|
+
# Attempt to override the Darwin build settings for rubies
|
680
|
+
# This should only be used in extreme edge cases that will not work via the default way.
|
635
681
|
__rvm_make_flags() {
|
636
682
|
# This is only an issue with Darwin :/
|
637
683
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
@@ -667,6 +713,8 @@ __rvm_make_flags() {
|
|
667
713
|
fi
|
668
714
|
}
|
669
715
|
|
716
|
+
# Select a gems(et) based on CLI set options and environment.
|
717
|
+
# This only sets 'rvm_ruby_gem_home'
|
670
718
|
__rvm_gems_select() {
|
671
719
|
if [[ -z "$(which gem 2>/dev/null)" ]] ; then return 0 ; fi
|
672
720
|
|
@@ -701,6 +749,7 @@ __rvm_gems_select() {
|
|
701
749
|
fi
|
702
750
|
}
|
703
751
|
|
752
|
+
# Use a gems(et) specified by 'rvm_ruby_gem_home'
|
704
753
|
__rvm_gems_use() {
|
705
754
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
706
755
|
|
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.1.
|
4
|
+
version: 0.1.2
|
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: 2010-01-
|
12
|
+
date: 2010-01-24 00:00:00 -05:00
|
13
13
|
default_executable: rvm-install
|
14
14
|
dependencies: []
|
15
15
|
|