rvm 0.1.39 → 0.1.40
Sign up to get free protection for your applications and to get access to all the features.
- data/config/db +17 -1
- data/config/known +1 -1
- data/config/md5 +4 -4
- data/install +10 -0
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +4 -2
- data/scripts/alias +4 -8
- data/scripts/base +14 -0
- data/scripts/cd +15 -3
- data/scripts/cleanup +31 -0
- data/scripts/cli +8 -3
- data/scripts/db +2 -2
- data/scripts/docs +2 -7
- data/scripts/env +1 -7
- data/scripts/fetch +2 -3
- data/scripts/gemsets +71 -13
- data/scripts/help +2 -6
- data/scripts/info +4 -7
- data/scripts/install +10 -0
- data/scripts/list +45 -2
- data/scripts/manage +76 -46
- data/scripts/monitor +1 -5
- data/scripts/notes +1 -1
- data/scripts/package +11 -37
- data/scripts/rubygems +3 -7
- data/scripts/rvm-install +10 -0
- data/scripts/selector +1 -1
- data/scripts/set +11 -11
- data/scripts/update +10 -0
- data/scripts/utility +91 -11
- data/scripts/wrapper +1 -7
- metadata +6 -4
data/config/db
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
#General
|
1
2
|
niceness=0
|
3
|
+
# Rubies
|
2
4
|
interpreter=ruby
|
3
5
|
ruby_version=1.8.7
|
4
6
|
ruby_configure_flags=--enable-shared
|
@@ -44,10 +46,24 @@ macruby_version=0.6
|
|
44
46
|
macruby_url=http://www.macruby.org/files
|
45
47
|
macruby_repo_url=git://git.macruby.org/macruby/MacRuby.git
|
46
48
|
macruby_nightly_url=http://www.macruby.org/files/nightlies/macruby_nightly-latest.pkg
|
47
|
-
maglev_version=
|
49
|
+
maglev_version=23673
|
48
50
|
maglev_url=http://glass-downloads.gemstone.com/maglev
|
49
51
|
maglev_repo_url=git://github.com/MagLev/maglev.git
|
50
52
|
shyouhei_repo_url=git://github.com/shyouhei/ruby.git
|
51
53
|
ironruby_version=1.0
|
52
54
|
ironruby_repo_url=git://github.com/ironruby/ironruby.git
|
53
55
|
ironruby_1.0_url=http://rubyforge.org/frs/download.php/70179/
|
56
|
+
# Packages
|
57
|
+
readline_url=ftp://ftp.gnu.org/gnu/readline
|
58
|
+
iconv_url=http://ftp.gnu.org/pub/gnu/libiconv
|
59
|
+
curl_url=http://curl.haxx.se/download
|
60
|
+
openssl_url=http://www.openssl.org/source
|
61
|
+
zlib_url=http://www.zlib.net
|
62
|
+
autoconf_url=ftp.gnu.org/gnu/autoconf
|
63
|
+
ncurses_url=http://ftp.gnu.org/pub/gnu/ncurses
|
64
|
+
pkgconfig_url=http://pkgconfig.freedesktop.org/releases
|
65
|
+
gettext_url=ftp://ftp.gnu.org/pub/gnu/gettext
|
66
|
+
libxml2_url=ftp://xmlsoft.org/libxml2/
|
67
|
+
glib_url=http://ftp.gnome.org/pub/gnome/sources/glib/2.23
|
68
|
+
mono_url=http://ftp.novell.com/pub/mono/sources/mono/
|
69
|
+
llvm_url=https://llvm.org/svn/llvm-project/llvm/trunk
|
data/config/known
CHANGED
data/config/md5
CHANGED
@@ -45,7 +45,7 @@ zlib-1.2.3.tar.gz=debc62758716a169df9f62e6ab2bc634
|
|
45
45
|
curl-7.19.7.tar.gz=ecb2e37e45c9933e2a963cabe03670ab
|
46
46
|
pkg-config-0.23.tar.gz=d922a88782b64441d06547632fd85744
|
47
47
|
ironruby-1.0.zip=7a92888837b3507355ed391dbfc0ab83
|
48
|
-
GemStone-
|
49
|
-
GemStone-
|
50
|
-
MagLev-
|
51
|
-
MagLev-
|
48
|
+
GemStone-23673.Darwin-i386.tar.gz=651ae34c80e45467f43f06fc63b5de65
|
49
|
+
GemStone-23673.Linux-x86_64.tar.gz=2989946a575ca59c5b7591c0f3d256aa
|
50
|
+
MagLev-23673.Darwin-i386.tar.gz=50ad4e1e4c9b3f8d2156f812beb9a7ed
|
51
|
+
MagLev-23673.Linux-x86_64.tar.gz=8a63271554de58412eb0e5668072ef70
|
data/install
CHANGED
@@ -23,6 +23,13 @@ usage() {
|
|
23
23
|
"
|
24
24
|
}
|
25
25
|
|
26
|
+
check_rubyopt_conditions() {
|
27
|
+
if [[ -n "$RUBYOPT" ]]; then
|
28
|
+
printf "\n\nWARNING: You have RUBYOPT set in your current environment. This may interfere with normal rvm"
|
29
|
+
printf "\n operation. If errors show up, please try unsetting RUBYOPT first.\n"
|
30
|
+
fi
|
31
|
+
}
|
32
|
+
|
26
33
|
spinner_counter=0
|
27
34
|
spinner() {
|
28
35
|
array=('/' '-' '\\' '|' '/' '-' '\\' '|')
|
@@ -282,12 +289,14 @@ if [[ "$upgrade_flag" -eq 1 ]] ; then
|
|
282
289
|
printf "\n * 1.8.7 default patchlevel is p174, override ~/.rvm/config/db in ~/.rvm/config/user"
|
283
290
|
printf "\n * Gemset separator is '@' and will remain unless any rubies error using it."
|
284
291
|
printf "\n$(tput sgr0)\n"
|
292
|
+
check_rubyopt_conditions
|
285
293
|
printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
|
286
294
|
else
|
287
295
|
if [[ "root" != "$(whoami)" ]] ; then
|
288
296
|
printf "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
|
289
297
|
printf "\n1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
|
290
298
|
printf "\n [[ -s \$HOME/.rvm/scripts/rvm ]] && source \$HOME/.rvm/scripts/rvm"
|
299
|
+
printf "\n Please note that this must only occur once - so, you only need to add it the first time you install rvm."
|
291
300
|
printf "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
|
292
301
|
printf "\n This means that if you see '[ -z "$PS1" ] && return' then you must change this line to:"
|
293
302
|
printf "\n if [[ ! -z "$PS1" ]] ; then"
|
@@ -309,6 +318,7 @@ else
|
|
309
318
|
printf "\nEven if you use zsh you should still adjust the .bashrc as above."
|
310
319
|
printf "\nIf you have any questions about this please visit #rvm on irc.freenode.net.\n"
|
311
320
|
fi
|
321
|
+
check_rubyopt_conditions
|
312
322
|
printf "\nInstallation of RVM to $rvm_path/ is complete.\n\n"
|
313
323
|
fi
|
314
324
|
|
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.40"
|
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-06-
|
12
|
+
s.date = %q{2010-06-22}
|
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}
|
@@ -69,7 +69,9 @@ Gem::Specification.new do |s|
|
|
69
69
|
"scripts/alias",
|
70
70
|
"scripts/aliases",
|
71
71
|
"scripts/array",
|
72
|
+
"scripts/base",
|
72
73
|
"scripts/cd",
|
74
|
+
"scripts/cleanup",
|
73
75
|
"scripts/cli",
|
74
76
|
"scripts/color",
|
75
77
|
"scripts/completion",
|
data/scripts/alias
CHANGED
@@ -2,15 +2,11 @@
|
|
2
2
|
|
3
3
|
unset rvm_default_flag rvm_wrapper_name
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
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
|
8
|
-
|
9
|
-
source $rvm_scripts_path/initialize
|
10
|
-
source $rvm_scripts_path/utility
|
11
|
-
source $rvm_scripts_path/selector
|
5
|
+
source $rvm_scripts_path/base
|
12
6
|
|
13
7
|
alias_conflicts_with_ruby() {
|
8
|
+
# If default exists, we should return true.
|
9
|
+
[[ "$1" == "default" && ! -L "$rvm_rubies_path/default" ]] && return 1
|
14
10
|
# Open for suggestions to a better way of doing this...
|
15
11
|
alias_check_result="$(
|
16
12
|
. $rvm_scripts_path/initialize
|
@@ -93,7 +89,7 @@ alias_list() {
|
|
93
89
|
if [[ -L "$item" ]] ; then
|
94
90
|
echo "$(basename $item) => $($rvm_scripts_path/db "$rvm_config_path/alias" "$(basename "$item")")"
|
95
91
|
fi
|
96
|
-
done
|
92
|
+
done; unset item
|
97
93
|
}
|
98
94
|
|
99
95
|
action="$1"
|
data/scripts/base
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Base is a collection general files + commonely included
|
2
|
+
# setup functions.
|
3
|
+
|
4
|
+
# Load the general scripts.
|
5
|
+
# Use rvm_base_except="" to override the except.
|
6
|
+
for script_name in initialize utility selector; do
|
7
|
+
if echo "$rvm_base_except" | grep -vq "$script_name" ; then
|
8
|
+
source $rvm_scripts_path/$script_name
|
9
|
+
fi
|
10
|
+
done; unset script_name rvm_base_except
|
11
|
+
|
12
|
+
# Setup hooks etc.
|
13
|
+
__rvm_inherit_trace_flag
|
14
|
+
__rvm_cleanup_temp_on_exit
|
data/scripts/cd
CHANGED
@@ -8,18 +8,30 @@ if [[ "$rvm_project_rvmrc" -ne 0 ]] ; then
|
|
8
8
|
local cwd ; cwd=$(pwd)
|
9
9
|
while : ; do
|
10
10
|
if [[ -z "$cwd" ]] || [[ "$HOME" = "$cwd" ]] || [[ "/" = "$cwd" ]] ; then
|
11
|
-
if [[ "$
|
12
|
-
|
11
|
+
if [[ ! -z "$rvm_rvmrc_cwd" ]] ; then
|
12
|
+
if [[ -z "$rvm_previous_environment" ]] ; then
|
13
|
+
rvm default 1>/dev/null 2>&1
|
14
|
+
else
|
15
|
+
rvm "$rvm_previous_environment" 1>/dev/null 2>&1
|
16
|
+
fi
|
17
|
+
unset rvm_rvmrc_cwd rvm_previous_environment
|
13
18
|
fi
|
14
19
|
break
|
15
20
|
else
|
16
21
|
if [[ -f "$cwd/.rvmrc" ]] ; then
|
17
|
-
|
22
|
+
if [[ "$rvm_rvmrc_cwd" != "$cwd" ]] ; then
|
23
|
+
if [[ -z "$rvm_previous_environment" ]] ; then
|
24
|
+
rvm_previous_environment="$(__rvm_environment_identifier)"
|
25
|
+
fi
|
26
|
+
rvm_rvmrc_cwd="$cwd"
|
27
|
+
source "$cwd/.rvmrc"
|
28
|
+
fi
|
18
29
|
break
|
19
30
|
else
|
20
31
|
cwd=$(dirname "$cwd")
|
21
32
|
fi
|
22
33
|
fi
|
23
34
|
done
|
35
|
+
|
24
36
|
}
|
25
37
|
fi
|
data/scripts/cleanup
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
rvm_base_except="selector"
|
3
|
+
source "$rvm_scripts_path/base"
|
4
|
+
|
5
|
+
usage() {
|
6
|
+
printf "Usage: 'rvm cleanup {all,archives,repos,sources,logs}'\n"
|
7
|
+
printf " Cleans up the directory tree for the specified item.\n"
|
8
|
+
exit 1
|
9
|
+
}
|
10
|
+
|
11
|
+
cleanup() {
|
12
|
+
for cleanup_type in $1; do
|
13
|
+
eval "current_path=\"\$rvm_${cleanup_type}_path\""
|
14
|
+
if [[ -n "$current_path" && -d "$current_path" && "$current_path" != "/" ]]; then
|
15
|
+
$rvm_scripts_path/log "info" "Cleaning up rvm directory '$current_path'"
|
16
|
+
rm -rf "$current_path"/* >/dev/null 2>&1
|
17
|
+
fi
|
18
|
+
done; unset cleanup_type current_path
|
19
|
+
}
|
20
|
+
|
21
|
+
# Exit when there is no argument.
|
22
|
+
[[ -z "$1" ]] && usage
|
23
|
+
|
24
|
+
case "$1" in
|
25
|
+
all) cleanup "archives repo src log" ;;
|
26
|
+
archives) cleanup "archives" ;;
|
27
|
+
repos) cleanup "repo" ;;
|
28
|
+
sources) cleanup "src" ;;
|
29
|
+
logs) cleanup "log" ;;
|
30
|
+
*) usage ;;
|
31
|
+
esac
|
data/scripts/cli
CHANGED
@@ -121,8 +121,8 @@ __rvm_parse_args() {
|
|
121
121
|
rvm_parse_break=1
|
122
122
|
;;
|
123
123
|
|
124
|
-
exec)
|
125
|
-
rvm_action="
|
124
|
+
exec|cleanup)
|
125
|
+
rvm_action="$rvm_token"
|
126
126
|
rvm_ruby_args="$(__rvm_quote_args "$@")"
|
127
127
|
rvm_parse_break=1
|
128
128
|
;;
|
@@ -441,7 +441,7 @@ rvm() {
|
|
441
441
|
# Check that this is the current version.
|
442
442
|
disk_version=$(cat "${rvm_path:-$HOME/.rvm}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')
|
443
443
|
if [[ "${rvm_version}" != "${disk_version}" ]] && [[ "reload" != "$1" ]]; then
|
444
|
-
printf "\nA
|
444
|
+
printf "\nA RVM version ${disk_version} is installed yet ${rvm_version} is loaded.\n Please do one of the following:\n * 'rvm reload'\n * open a new shell\n * source your shell init scripts"
|
445
445
|
return 1
|
446
446
|
fi
|
447
447
|
|
@@ -514,6 +514,11 @@ rvm() {
|
|
514
514
|
unset old_rvm_ruby_string
|
515
515
|
;;
|
516
516
|
|
517
|
+
cleanup)
|
518
|
+
eval "$rvm_scripts_path/cleanup $rvm_ruby_args"
|
519
|
+
result=$?
|
520
|
+
;;
|
521
|
+
|
517
522
|
gemset)
|
518
523
|
#if $rvm_scripts_path/match $rvm_ruby_args use ; then
|
519
524
|
if [[ "$rvm_use_flag" -eq 1 ]] ; then
|
data/scripts/db
CHANGED
@@ -25,10 +25,10 @@ if [[ -z "$key" ]] ; then
|
|
25
25
|
else
|
26
26
|
value="$*"
|
27
27
|
if [[ "unset" = "$value" ]] || [[ "delete" = "$value" ]] ; then
|
28
|
-
sed -i.tmp "s#^$key=.*\$##" $database_file
|
28
|
+
sed -i.tmp -e "s#^$key=.*\$##" -e '/^$/d' $database_file
|
29
29
|
else
|
30
30
|
if [[ -z "$value" ]] ; then # get
|
31
|
-
awk -F= '/^'"$key"'=/' $database_file | sed "s#^$key=##"
|
31
|
+
awk -F= '/^'"$key"'=/' $database_file | sed -e "s#^$key=##" -e '/^$/d'
|
32
32
|
else # set
|
33
33
|
if [[ -z "$(awk -F= "/^'"$key"'=/{print $2}" $database_file)" ]] ; then # append
|
34
34
|
echo "$key=$value" >> $database_file
|
data/scripts/docs
CHANGED
@@ -1,11 +1,6 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
|
4
|
-
|
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
|
-
|
7
|
-
source $rvm_scripts_path/initialize
|
8
|
-
source $rvm_scripts_path/utility
|
2
|
+
rvm_base_except="selector"
|
3
|
+
source "$rvm_scripts_path/base"
|
9
4
|
|
10
5
|
rvm_docs_ruby_string="$(__rvm_environment_identifier | awk -F"$rvm_gemset_separator" '{print $1}')"
|
11
6
|
if [[ "$rvm_docs_ruby_string" = "system" || -z "$rvm_docs_ruby_string" ]]; then
|
data/scripts/env
CHANGED
@@ -3,13 +3,7 @@
|
|
3
3
|
# Recursive loops, oh my!
|
4
4
|
unset rvm_default_flag
|
5
5
|
|
6
|
-
source $rvm_scripts_path/
|
7
|
-
source $rvm_scripts_path/utility
|
8
|
-
source $rvm_scripts_path/selector
|
9
|
-
|
10
|
-
if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
|
11
|
-
|
12
|
-
trap "if [[ -d $rvm_tmp_path/ ]] && [[ -s $rvm_tmp_path/$$ ]] ; then rm -f $rvm_tmp_path/$$ > /dev/null 2>&1 ; fi ; exit" 0 1 2 3 15
|
6
|
+
source "$rvm_scripts_path/base"
|
13
7
|
|
14
8
|
usage() {
|
15
9
|
printf "Usage: rvm env [ruby_string] [--path]\n"
|
data/scripts/fetch
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
|
4
|
-
|
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
|
3
|
+
rvm_base_except="selector"
|
4
|
+
source "$rvm_scripts_path/base"
|
6
5
|
|
7
6
|
record_md5() {
|
8
7
|
if [[ "Darwin" = "$(uname)" ]] || [[ "FreeBSD" = "$(uname)" ]]; then
|
data/scripts/gemsets
CHANGED
@@ -1,14 +1,61 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
source $rvm_scripts_path/
|
4
|
-
source $rvm_scripts_path/selector
|
3
|
+
source "$rvm_scripts_path/base"
|
5
4
|
|
6
|
-
if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
|
7
5
|
rvm_ruby_gem_home="${rvm_ruby_gem_home:-$GEM_HOME}"
|
8
|
-
|
9
6
|
if [[ ! -d "$rvm_ruby_gem_home" ]] && command -v gem > /dev/null 2>&1; then rvm_ruby_gem_home="$(gem env home)" ; fi
|
10
7
|
|
11
|
-
|
8
|
+
usage() {
|
9
|
+
printf "Usage: 'rvm gemset action'\n"
|
10
|
+
printf " where action is one of: {import,export,create,copy,empty,delete,name,dir,list,gemdir,install,pristine,clear,use,update,globalcache}\n"
|
11
|
+
printf "\n"
|
12
|
+
printf " Tools for working with and manipulating gemsets within rvm.\n"
|
13
|
+
exit 1
|
14
|
+
}
|
15
|
+
|
16
|
+
gemset_update() {
|
17
|
+
if [[ -z "$rvm_ruby_strings" ]]; then
|
18
|
+
$rvm_scripts_path/log "info" "Running gem update for all rubies and gemsets."
|
19
|
+
rvm_ruby_strings="$(\ls "$rvm_gems_path" | grep -v '^\(doc\|cache\|@\|system\)' | tr '\n' ',')"
|
20
|
+
else
|
21
|
+
$rvm_scripts_path/log "info" "Running gem update for the specified rubies."
|
22
|
+
fi
|
23
|
+
export rvm_ruby_strings
|
24
|
+
$rvm_scripts_path/set "gem" "update"
|
25
|
+
return $?
|
26
|
+
}
|
27
|
+
|
28
|
+
gemset_globalcache() {
|
29
|
+
if [[ "$1" == "disable" ]]; then
|
30
|
+
$rvm_scripts_path/log "info" "Removing the global cache (note: this will empty the caches)"
|
31
|
+
for directory_name in $(\ls "$rvm_gems_path"); do
|
32
|
+
current_cache_path="$rvm_gems_path/$directory_name/cache"
|
33
|
+
if [[ -L "$current_cache_path" && "$(readlink "$current_cache_path")" == "$rvm_gems_cache_path" ]]; then
|
34
|
+
$rvm_scripts_path/log "info" "Reverting the gem cache for $directory_name to an empty directory."
|
35
|
+
rm -f "$current_cache_path" 2>/dev/null
|
36
|
+
mkdir -p "$current_cache_path" 2>/dev/null
|
37
|
+
fi
|
38
|
+
done; unset full_directory_path directory_name
|
39
|
+
$rvm_scripts_path/db "$rvm_config_path/user" "use_gemset_globalcache" "delete"
|
40
|
+
elif [[ "$1" == "enable" ]]; then
|
41
|
+
$rvm_scripts_path/log "info" "Enabling global cache for gems."
|
42
|
+
mkdir -p "$rvm_gems_cache_path"
|
43
|
+
for directory_name in $(\ls "$rvm_gems_path"); do
|
44
|
+
current_cache_path="$rvm_gems_path/$directory_name/cache"
|
45
|
+
if [[ -d "$current_cache_path" && ! -L "$current_cache_path" ]]; then
|
46
|
+
$rvm_scripts_path/log "info" "Moving the gem cache for $directory_name to the global cache."
|
47
|
+
mv "$current_cache_path/"*.gem "$rvm_gems_cache_path/" 2>/dev/null
|
48
|
+
rm -rf "$current_cache_path"
|
49
|
+
ln -nfs "$rvm_gems_cache_path" "$current_cache_path"
|
50
|
+
fi
|
51
|
+
done; unset full_directory_path directory_name
|
52
|
+
$rvm_scripts_path/db "$rvm_config_path/user" "use_gemset_globalcache" "true"
|
53
|
+
else
|
54
|
+
printf "Usage: 'rvm gemset globalcache {enable,disable}\n"
|
55
|
+
printf " Enable / Disable the use of a global gem cachedir.\n"
|
56
|
+
return 1
|
57
|
+
fi
|
58
|
+
}
|
12
59
|
|
13
60
|
gemset_name() {
|
14
61
|
gemset_dir | awk -F${rvm_gemset_separator} '{print $2}'
|
@@ -23,6 +70,14 @@ gemset_create() {
|
|
23
70
|
for gemset in $(echo $gems_args) ; do
|
24
71
|
gem_home="${rvm_ruby_gem_prefix}${rvm_gemset_separator}${gems_args/ /}"
|
25
72
|
mkdir -p $gem_home
|
73
|
+
# When the globalcache is enabled, we need to ensure we setup the cache directory correctly.
|
74
|
+
if __rvm_using_gemset_globalcache; then
|
75
|
+
if [[ -d "$gem_home/cache" && ! -L "$gem_home/cache" ]]; then
|
76
|
+
mv "$gem_home/cache"/*.gem "$rvm_gems_cache_path/" 2>/dev/null
|
77
|
+
rm -rf "$gem_home/cache"
|
78
|
+
fi
|
79
|
+
ln -nfs "$rvm_gems_cache_path" "$gem_home/cache"
|
80
|
+
fi
|
26
81
|
$rvm_scripts_path/log "info" "Gemset '$gemset' created."
|
27
82
|
done ; unset gem_home
|
28
83
|
}
|
@@ -176,7 +231,7 @@ gemset_import() {
|
|
176
231
|
return 1
|
177
232
|
fi
|
178
233
|
|
179
|
-
mkdir -p "$
|
234
|
+
mkdir -p "$rvm_gems_cache_path" # Ensure the base cache dir is initialized.
|
180
235
|
|
181
236
|
if [[ -s "$rvm_file_name" ]] ; then
|
182
237
|
echo "Importing $rvm_file_name file..."
|
@@ -237,10 +292,10 @@ gem_install() {
|
|
237
292
|
else
|
238
293
|
if [[ -s "$gem" ]] ; then
|
239
294
|
cache_file="$gem"
|
240
|
-
elif [[ -s "$
|
241
|
-
cache_file="$
|
295
|
+
elif [[ -s "$(__rvm_current_gemcache_dir)/${gem_file_name}" ]] ; then
|
296
|
+
cache_file="$(__rvm_current_gemcache_dir)/${gem_file_name}"
|
242
297
|
else
|
243
|
-
cache_file="${cache_file:-$(\ls $
|
298
|
+
cache_file="${cache_file:-$(\ls "$(__rvm_current_gemcache_dir)/${gem_file_name}" 2> /dev/null | sort | head -n1)}"
|
244
299
|
fi
|
245
300
|
|
246
301
|
if [[ ! -s "$cache_file" ]] ; then
|
@@ -259,9 +314,9 @@ gem_install() {
|
|
259
314
|
unset gem # already installed, not forcing reinstall.
|
260
315
|
$rvm_scripts_path/log "info" "$gem_name $gem_version exists, skipping (--force to re-install)"
|
261
316
|
else
|
262
|
-
if [[ -s "$
|
317
|
+
if [[ -s "$(__rvm_current_gemcache_dir)/$(basename $gem_file_name)" ]] ; then
|
263
318
|
mkdir -p "$rvm_tmp_path/$$/"
|
264
|
-
mv "$
|
319
|
+
mv "$(__rvm_current_gemcache_dir)/$gem_file_name" "$rvm_tmp_path/$$/$gem_file_name"
|
265
320
|
gem="$rvm_tmp_path/$$/$gem_file_name -f -l"
|
266
321
|
else
|
267
322
|
gem="$cache_file"
|
@@ -276,7 +331,6 @@ gem_install() {
|
|
276
331
|
if [[ "rvm_make_flags_flag" -eq 1 ]] ; then __rvm_make_flags ; fi
|
277
332
|
|
278
333
|
if [[ ! -z "$rvm_ruby_gem_home" ]] && [[ "$rvm_ruby_gem_home" != "$rvm_gems_path" ]] ; then
|
279
|
-
#command="GEM_HOME='$rvm_ruby_gem_home' GEM_PATH='$rvm_ruby_gem_home/bin:$rvm_gems_path/${rvm_ruby_string}${rvm_gemset_separator}global/bin' BUNDLE_PATH='${rvm_ruby_gem_home}' ${gem_prefix} gem install --ignore-dependencies $gems_args $rvm_gem_options $gem_postfix $vars"
|
280
334
|
command="GEM_HOME='$rvm_ruby_gem_home' GEM_PATH='$rvm_ruby_gem_home/bin:$rvm_gems_path/${rvm_ruby_string}${rvm_gemset_separator}global/bin' BUNDLE_PATH='${rvm_ruby_gem_home}' ${gem_prefix} gem install $gems_args $rvm_gem_options $gem_postfix $vars"
|
281
335
|
else
|
282
336
|
#--ignore-dependencies
|
@@ -405,11 +459,15 @@ elif [[ "initial" = "$action" ]] ; then
|
|
405
459
|
gemset_initial
|
406
460
|
elif [[ "prune" = "$action" ]] ; then
|
407
461
|
gemset_prune
|
462
|
+
elif [[ "update" = "$action" ]]; then
|
463
|
+
gemset_update
|
464
|
+
elif [[ "globalcache" = "$action" ]]; then
|
465
|
+
gemset_globalcache $2
|
408
466
|
elif [[ "clear" = "$action" ]] ; then
|
409
467
|
$rvm_scripts_path/log "info" "gemset cleared."
|
410
468
|
exit 0
|
411
469
|
else
|
412
|
-
|
470
|
+
usage
|
413
471
|
fi
|
414
472
|
|
415
473
|
exit $?
|