rvm 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- data/install +6 -2
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +2 -2
- data/scripts/cli +2 -2
- data/scripts/fetch +1 -1
- data/scripts/gems +46 -17
- data/scripts/initialize +7 -1
- data/scripts/install +6 -2
- data/scripts/rvm-install +6 -2
- data/scripts/update +6 -2
- data/scripts/utility +13 -3
- metadata +2 -2
data/install
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
unset rvm_auto_flag
|
4
4
|
|
5
|
+
install_source_path=$(dirname $0)
|
6
|
+
if [[ -d "$install_source_path/scripts" ]] && [[ -s "$install_source_path/scripts/utility" ]] ; then
|
7
|
+
builtin cd $install_source_path
|
8
|
+
fi
|
9
|
+
|
5
10
|
source scripts/version
|
6
11
|
source scripts/utility
|
7
12
|
|
@@ -30,6 +35,7 @@ while [[ $# -gt 0 ]] ; do
|
|
30
35
|
esac
|
31
36
|
done
|
32
37
|
|
38
|
+
__rvm_load_rvmrc
|
33
39
|
|
34
40
|
if [[ -z "$rvm_path" ]] ; then
|
35
41
|
unset rvm_path
|
@@ -55,8 +61,6 @@ __rvm_initialize
|
|
55
61
|
item="$(tput setaf 2)* $(tput sgr0)"
|
56
62
|
question="\n$(tput setaf 2)<?>$(tput sgr0)"
|
57
63
|
cwd=$(pwd)
|
58
|
-
source_path="${source_path:-"$(dirname $0 | xargs dirname)"}"
|
59
|
-
if [[ ! -d "$source_path" ]] ; then unset source_path ; fi
|
60
64
|
source_path="${source_path:-$cwd}"
|
61
65
|
|
62
66
|
# State what is required to use rvm
|
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.16"
|
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-02-
|
12
|
+
s.date = %q{2010-02-18}
|
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}
|
data/scripts/cli
CHANGED
@@ -50,7 +50,7 @@ __rvm_parse_args() {
|
|
50
50
|
|
51
51
|
gems|gemset)
|
52
52
|
rvm_action="gems"
|
53
|
-
if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "dump" = "$1" ]] || [[ "load" = "$1" ]] || [[ "
|
53
|
+
if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "dump" = "$1" ]] || [[ "load" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "copy" = "$1" ]] || [[ "import" = "$1" ]] || [[ "export" = "$1" ]] ; then
|
54
54
|
export rvm_ruby_args="$*" ; export rvm_${1}_flag=1 ; shift
|
55
55
|
elif [[ "clear" = "$1" ]] ; then
|
56
56
|
unset rvm_gem_set_name ; shift
|
@@ -281,7 +281,7 @@ __rvm_parse_args() {
|
|
281
281
|
--disable-llvm|--disable-jit) export rvm_llvm_flag=0 ;;
|
282
282
|
--enable-llvm|--enable-jit) export rvm_llvm_flag=1 ;;
|
283
283
|
|
284
|
-
--self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--
|
284
|
+
--self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--passenger|--editor|--sticky_gems)
|
285
285
|
export rvm_$(echo $rvm_token | sed 's#-##g')_flag=1
|
286
286
|
if [[ "--debug" = "$rvm_token" ]] ; then export rvm_debug_flag ; fi
|
287
287
|
;;
|
data/scripts/fetch
CHANGED
@@ -5,7 +5,7 @@ if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
|
|
5
5
|
trap "if [[ -d $rvm_tmp_path/ ]] && [[ -f $rvm_tmp_path/$$ ]] ; then rm -f $rvm_tmp_path/$$ > /dev/null 2>&1 ; fi ; exit" 0 1 2 3 15
|
6
6
|
|
7
7
|
record_md5() {
|
8
|
-
if [[ "Darwin" = "$(uname)" ]] ; then
|
8
|
+
if [[ "Darwin" = "$(uname)" ]] || [[ "FreeBSD" = "$(uname)" ]]; then
|
9
9
|
archive_md5="$(md5 $archive | awk '{print $NF}')"
|
10
10
|
else
|
11
11
|
archive_md5="$(md5sum $archive | awk '{print $1}')"
|
data/scripts/gems
CHANGED
@@ -63,7 +63,7 @@ __rvm_gems_delete() {
|
|
63
63
|
fi
|
64
64
|
}
|
65
65
|
|
66
|
-
|
66
|
+
__rvm_gems_empty() {
|
67
67
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
68
68
|
if [[ ! -z "$rvm_gem_set_name" ]] ; then
|
69
69
|
gemdir="$rvm_gems_path/$rvm_ruby_string%$rvm_gem_set_name"
|
@@ -86,7 +86,34 @@ __rvm_gems_nuke() {
|
|
86
86
|
fi
|
87
87
|
}
|
88
88
|
|
89
|
-
|
89
|
+
# Migrate gemsets from ruby X to ruby Y
|
90
|
+
__rvm_gems_copy() {
|
91
|
+
source_ruby="$(echo $gem_args | awk '{print $1}')"
|
92
|
+
destination_ruby="$(echo $gem_args | awk '{print $2}')"
|
93
|
+
if [[ -z "$source_ruby" ]] ; then
|
94
|
+
$rvm_scripts_path/log "error" "Source and destination must be specified: 'rvm gems copy X Y'"
|
95
|
+
fi
|
96
|
+
if [[ -z "$destination_ruby" ]] ; then
|
97
|
+
$rvm_scripts_path/log "error" "Source and destination must be specified: 'rvm gems copy X Y'"
|
98
|
+
fi
|
99
|
+
source_path="$($rvm_bin_path/rvm $source_ruby gem env gemdir | tail -n 1)"
|
100
|
+
destination_path="$($rvm_bin_path/rvm $destination_ruby gem env gemdir | tail -n 1)"
|
101
|
+
|
102
|
+
if [[ -d "$source_path" ]] ; then
|
103
|
+
if [[ ! -d "$destination_path" ]] ; then mkdir -p $destination_path ; fi
|
104
|
+
$rvm_scripts_path/log "info" "Copying gemset from $source_ruby to $destination_ruby" ;
|
105
|
+
for dir in bin doc gems specifications ; do
|
106
|
+
cp -Rf $source_path/$dir $destination_path/
|
107
|
+
done
|
108
|
+
else
|
109
|
+
$rvm_scripts_path/log "error" "Gems directory does not exist for $source_path ($source_path)"
|
110
|
+
return 1
|
111
|
+
fi
|
112
|
+
|
113
|
+
unset source_ruby destination_ruby source_path destination_path
|
114
|
+
}
|
115
|
+
|
116
|
+
__rvm_gems_export() {
|
90
117
|
rvm_file_name="${rvm_file_name:-$gems_args}"
|
91
118
|
|
92
119
|
if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
|
@@ -103,10 +130,10 @@ __rvm_gems_dump() {
|
|
103
130
|
fi
|
104
131
|
fi
|
105
132
|
|
106
|
-
$rvm_scripts_path/log "info" "
|
133
|
+
$rvm_scripts_path/log "info" "Exporting current environments gems to $rvm_file_name"
|
107
134
|
|
108
135
|
touch $rvm_file_name
|
109
|
-
echo "# $rvm_file_name generated gem
|
136
|
+
echo "# $rvm_file_name generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator" > $rvm_file_name
|
110
137
|
for gem in $(gem list | sed 's#[\(|\)]##g' | sed 's#, #,#g' | tr ' ' ';') ; do
|
111
138
|
name="$(echo $gem | awk -F';' '{print $1}')"
|
112
139
|
if [[ -z "$rvm_latest_flag" ]] ; then
|
@@ -120,7 +147,7 @@ __rvm_gems_dump() {
|
|
120
147
|
done ; unset file_name
|
121
148
|
}
|
122
149
|
|
123
|
-
|
150
|
+
__rvm_gems_import() {
|
124
151
|
|
125
152
|
if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
|
126
153
|
export GEM_HOME="$rvm_ruby_gem_home"
|
@@ -150,7 +177,7 @@ __rvm_gems_load() {
|
|
150
177
|
mkdir -p "$rvm_gems_path/cache" # Ensure the base cache dir is initialized.
|
151
178
|
|
152
179
|
if [[ -s "$rvm_file_name" ]] ; then
|
153
|
-
echo "
|
180
|
+
echo "Importing $rvm_file_name file..."
|
154
181
|
rvm_ruby_gem_list=$(\ls $rvm_ruby_gem_home/specifications/ 2> /dev/null | sed 's#.gems.*$##' 2> /dev/null)
|
155
182
|
|
156
183
|
while read -r line
|
@@ -160,7 +187,7 @@ __rvm_gems_load() {
|
|
160
187
|
fi
|
161
188
|
done < <(awk '/^[^#]+/{print}' "${rvm_file_name}")
|
162
189
|
else
|
163
|
-
$rvm_scripts_path/log "error" "${rvm_file_name} does not exist to
|
190
|
+
$rvm_scripts_path/log "error" "${rvm_file_name} does not exist to import from."
|
164
191
|
fi
|
165
192
|
}
|
166
193
|
|
@@ -188,7 +215,7 @@ __rvm_parse_gem_args() {
|
|
188
215
|
gem_file_name="$gem"
|
189
216
|
elif $rvm_scripts_path/match "$gem" ".gem$" ; then
|
190
217
|
gem_file_name="$gem"
|
191
|
-
elif [[ -z "${gem_version/ /}" ]] ; then
|
218
|
+
elif [[ -z "${gem_version/ /}" ]] ; then
|
192
219
|
gem_file_name="${gem_name/ /}*.gem"
|
193
220
|
else # version
|
194
221
|
gem_file_name="${gem_name/ /}-${gem_version/ /}.gem"
|
@@ -285,14 +312,16 @@ if [[ -z "$(which gem 2>/dev/null)" ]] ; then
|
|
285
312
|
fi
|
286
313
|
|
287
314
|
action="$(echo $* | awk '{print $1}')"
|
288
|
-
|
289
|
-
|
290
|
-
if [[ "load" = "$action" ]] ; then
|
291
|
-
|
292
|
-
elif [[ "dump" = "$action" ]] ; then
|
293
|
-
|
294
|
-
elif [[ "
|
295
|
-
|
315
|
+
gem_args=$(echo "$*" | awk '{$1="" ; print}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
316
|
+
|
317
|
+
if [[ "import" = "$action" ]] || [[ "load" = "$action" ]] ; then
|
318
|
+
__rvm_gems_import
|
319
|
+
elif [[ "export" = "$action" ]] || [[ "dump" = "$action" ]] ; then
|
320
|
+
__rvm_gems_export
|
321
|
+
elif [[ "copy" = "$action" ]] ; then
|
322
|
+
__rvm_gems_copy
|
323
|
+
elif [[ "empty" = "$action" ]] ; then
|
324
|
+
__rvm_gems_empty
|
296
325
|
elif [[ "delete" = "$action" ]] ; then
|
297
326
|
__rvm_gems_delete
|
298
327
|
elif [[ "name" = "$action" ]] ; then
|
@@ -309,7 +338,7 @@ elif [[ "clear" = "$action" ]] ; then
|
|
309
338
|
$rvm_scripts_path/log "info" "gems(et) cleared."
|
310
339
|
exit 0
|
311
340
|
else
|
312
|
-
$rvm_scripts_path/log "error" "gems must be passed an action as the first parameter {
|
341
|
+
$rvm_scripts_path/log "error" "Unrecognized gems action '$action'.\ngems must be passed an action as the first parameter {import,export,copy,delete,empty,name,list,gemdir,install}"
|
313
342
|
fi
|
314
343
|
|
315
344
|
exit $?
|
data/scripts/initialize
CHANGED
@@ -15,7 +15,13 @@ rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
|
|
15
15
|
rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
|
16
16
|
rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
|
17
17
|
rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
|
18
|
-
|
18
|
+
|
19
|
+
if [[ "root" = "$(whoami)" ]] ; then
|
20
|
+
rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}"
|
21
|
+
else
|
22
|
+
rvm_gems_path="${rvm_gems_path:-"$HOME/.rvm/gems"}"
|
23
|
+
fi
|
24
|
+
|
19
25
|
rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
|
20
26
|
rvm_config_path="${rvm_config_path:-"$rvm_path/config"}"
|
21
27
|
rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}"
|
data/scripts/install
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
unset rvm_auto_flag
|
4
4
|
|
5
|
+
install_source_path=$(dirname $0)
|
6
|
+
if [[ -d "$install_source_path/scripts" ]] && [[ -s "$install_source_path/scripts/utility" ]] ; then
|
7
|
+
builtin cd $install_source_path
|
8
|
+
fi
|
9
|
+
|
5
10
|
source scripts/version
|
6
11
|
source scripts/utility
|
7
12
|
|
@@ -30,6 +35,7 @@ while [[ $# -gt 0 ]] ; do
|
|
30
35
|
esac
|
31
36
|
done
|
32
37
|
|
38
|
+
__rvm_load_rvmrc
|
33
39
|
|
34
40
|
if [[ -z "$rvm_path" ]] ; then
|
35
41
|
unset rvm_path
|
@@ -55,8 +61,6 @@ __rvm_initialize
|
|
55
61
|
item="$(tput setaf 2)* $(tput sgr0)"
|
56
62
|
question="\n$(tput setaf 2)<?>$(tput sgr0)"
|
57
63
|
cwd=$(pwd)
|
58
|
-
source_path="${source_path:-"$(dirname $0 | xargs dirname)"}"
|
59
|
-
if [[ ! -d "$source_path" ]] ; then unset source_path ; fi
|
60
64
|
source_path="${source_path:-$cwd}"
|
61
65
|
|
62
66
|
# State what is required to use rvm
|
data/scripts/rvm-install
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
unset rvm_auto_flag
|
4
4
|
|
5
|
+
install_source_path=$(dirname $0)
|
6
|
+
if [[ -d "$install_source_path/scripts" ]] && [[ -s "$install_source_path/scripts/utility" ]] ; then
|
7
|
+
builtin cd $install_source_path
|
8
|
+
fi
|
9
|
+
|
5
10
|
source scripts/version
|
6
11
|
source scripts/utility
|
7
12
|
|
@@ -30,6 +35,7 @@ while [[ $# -gt 0 ]] ; do
|
|
30
35
|
esac
|
31
36
|
done
|
32
37
|
|
38
|
+
__rvm_load_rvmrc
|
33
39
|
|
34
40
|
if [[ -z "$rvm_path" ]] ; then
|
35
41
|
unset rvm_path
|
@@ -55,8 +61,6 @@ __rvm_initialize
|
|
55
61
|
item="$(tput setaf 2)* $(tput sgr0)"
|
56
62
|
question="\n$(tput setaf 2)<?>$(tput sgr0)"
|
57
63
|
cwd=$(pwd)
|
58
|
-
source_path="${source_path:-"$(dirname $0 | xargs dirname)"}"
|
59
|
-
if [[ ! -d "$source_path" ]] ; then unset source_path ; fi
|
60
64
|
source_path="${source_path:-$cwd}"
|
61
65
|
|
62
66
|
# State what is required to use rvm
|
data/scripts/update
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
unset rvm_auto_flag
|
4
4
|
|
5
|
+
install_source_path=$(dirname $0)
|
6
|
+
if [[ -d "$install_source_path/scripts" ]] && [[ -s "$install_source_path/scripts/utility" ]] ; then
|
7
|
+
builtin cd $install_source_path
|
8
|
+
fi
|
9
|
+
|
5
10
|
source scripts/version
|
6
11
|
source scripts/utility
|
7
12
|
|
@@ -30,6 +35,7 @@ while [[ $# -gt 0 ]] ; do
|
|
30
35
|
esac
|
31
36
|
done
|
32
37
|
|
38
|
+
__rvm_load_rvmrc
|
33
39
|
|
34
40
|
if [[ -z "$rvm_path" ]] ; then
|
35
41
|
unset rvm_path
|
@@ -55,8 +61,6 @@ __rvm_initialize
|
|
55
61
|
item="$(tput setaf 2)* $(tput sgr0)"
|
56
62
|
question="\n$(tput setaf 2)<?>$(tput sgr0)"
|
57
63
|
cwd=$(pwd)
|
58
|
-
source_path="${source_path:-"$(dirname $0 | xargs dirname)"}"
|
59
|
-
if [[ ! -d "$source_path" ]] ; then unset source_path ; fi
|
60
64
|
source_path="${source_path:-$cwd}"
|
61
65
|
|
62
66
|
# State what is required to use rvm
|
data/scripts/utility
CHANGED
@@ -152,7 +152,7 @@ __rvm_cleanup_variables() {
|
|
152
152
|
|
153
153
|
if [[ "$rvm_sticky_gems" = "1" ]] ; then export rvm_gem_set_name ; else unset rvm_gem_set_name ; fi
|
154
154
|
|
155
|
-
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
|
155
|
+
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_import_flag rvm_export_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 rvm_ruby_patch rvm_sticky_gems
|
156
156
|
}
|
157
157
|
|
158
158
|
# Unset ruby-specific variables
|
@@ -469,9 +469,14 @@ __rvm_reboot() {
|
|
469
469
|
__rvm_ruby_do() {
|
470
470
|
__rvm_select
|
471
471
|
__rvm_use
|
472
|
+
|
472
473
|
binary="$(echo $rvm_action | sed 's#do$##')"
|
473
474
|
if [[ -x "$rvm_ruby_home/bin/$binary" ]] ; then
|
475
|
+
rm -f "$rvm_path/gems/cache"
|
476
|
+
ln -nfs "$HOME/.gem/cache" "$rvm_path/gems/cache"
|
474
477
|
binary="$rvm_ruby_home/bin/$binary"
|
478
|
+
elif [[ -x "$rvm_ruby_global_gems_path/bin/$binary" ]] ; then
|
479
|
+
binary="$rvm_ruby_global_gems_path/bin/$binary"
|
475
480
|
elif [[ -x "$rvm_ruby_gem_home/bin/$binary" ]] ; then
|
476
481
|
binary="$rvm_ruby_gem_home/bin/$binary"
|
477
482
|
elif [[ "system" = "$rvm_ruby_string" ]] && [[ -x "$(which $binary)" ]] ; then
|
@@ -771,8 +776,13 @@ __rvm_gems_select() {
|
|
771
776
|
fi
|
772
777
|
rmdir $rvm_path/gems/cache
|
773
778
|
fi
|
774
|
-
|
775
|
-
|
779
|
+
|
780
|
+
# Some sanity checking.
|
781
|
+
if [[ ! -e "$HOME/.gem/cache" ]] ; then mkdir -p $HOME/.gem/cache ; fi
|
782
|
+
chmod u+w "$HOME/.gem"
|
783
|
+
rm -f "$rvm_gems_path/cache"
|
784
|
+
ln -nfs "$HOME/.gem/cache" "$rvm_gems_path/cache"
|
785
|
+
chmod u+w "$HOME/.gem/cache"
|
776
786
|
# /TODO
|
777
787
|
|
778
788
|
# Careful not to nuke system gems cache.
|
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.16
|
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-02-
|
12
|
+
date: 2010-02-18 00:00:00 -05:00
|
13
13
|
default_executable: rvm-install
|
14
14
|
dependencies: []
|
15
15
|
|