gemrage 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/Gemfile.lock +5 -0
- data/VERSION +1 -1
- data/gemrage.gemspec +148 -3
- data/lib/rubygems/commands/scan_command.rb +77 -4
- data/vendor/ruby/1.8/bin/rvm-install +19 -0
- data/vendor/ruby/1.8/cache/macaddr-1.0.0.gem +0 -0
- data/vendor/ruby/1.8/cache/rvm-1.0.14.gem +0 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/README +33 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/gemspec.rb +27 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/install.rb +210 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/lib/macaddr.rb +69 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/LICENCE +18 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/README +127 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/bin/rvm-install +5 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm +76 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-auto-ruby +24 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-prompt +204 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-shell +35 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-update-head +35 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-update-latest +27 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvmsudo +24 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/config/db +71 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/config/known +55 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/config/md5 +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/gemset_snapshot +25 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/install-system-wide +191 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/r +44 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/examples/rvmrc +47 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/gemsets/default.gems +1 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/gemsets/global.gems +1 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/alias +46 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/benchmark +17 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/cleanup +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/debug +8 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/disk-usage +15 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/docs +22 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/exec +33 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/fetch +5 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gem +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gemdir +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gemset +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/implode +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/info +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/install +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/list +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/migrate +15 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/monitor +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/notes +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/package +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rake +14 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/remove +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/repair +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/reset +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/ruby +84 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rubygems +11 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rvmrc +34 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/snapshot +15 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/specs +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/srcdir +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/tests +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/tools +22 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/uninstall +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/update +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/upgrade +18 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/use +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/wrapper +41 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/install +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/VERSION.yml +4 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb +45 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/alias.rb +69 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/cleanup.rb +54 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/configuration.rb +60 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/env.rb +52 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/gemset.rb +222 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/info.rb +13 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/list.rb +124 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/rubies.rb +50 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/sets.rb +123 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/tools.rb +68 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/utility.rb +173 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/wrapper.rb +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment.rb +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/errors.rb +31 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/install_command_dumper.rb +51 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/abstract_wrapper.rb +145 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/calculate_rvm_path.sh +26 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/result.rb +42 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/shell_wrapper.sh +10 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/single_shot_wrapper.rb +56 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/utility.rb +37 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell.rb +25 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/version.rb +19 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm.rb +156 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/man/man1/rvm.1 +385 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/man/man1/rvm.1.gz +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/rvm.gemspec +184 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/alias +225 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/aliases +4 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/array +32 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/base +49 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cd +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup +58 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cli +781 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/color +49 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/completion +151 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/db +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/default +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/disk-usage +60 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/docs +115 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/env +46 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/environment-convertor +74 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/fetch +229 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/gemsets +950 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/hash +37 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/help +46 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/hook +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/info +214 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/initialize +29 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/install +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/irbrc +9 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/irbrc.rb +63 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/list +315 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log +38 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/maglev +193 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/manage +2094 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/match +6 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/md5 +22 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/migrate +175 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/monitor +105 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/notes +121 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/override_gem +14 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/package +301 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patches +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/repair +199 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rubygems +157 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rvm +120 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rvm-install +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/selector +818 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/set +301 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/snapshot +262 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools +58 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/update +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/upgrade +144 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/utility +1557 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/version +17 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/wrapper +210 -0
- data/vendor/ruby/1.8/specifications/macaddr-1.0.0.gemspec +27 -0
- data/vendor/ruby/1.8/specifications/rvm-1.0.14.gemspec +42 -0
- metadata +149 -4
@@ -0,0 +1,144 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
unset GREP_OPTIONS
|
4
|
+
source "$rvm_path/scripts/base"
|
5
|
+
|
6
|
+
usage()
|
7
|
+
{
|
8
|
+
printf "
|
9
|
+
|
10
|
+
Usage:
|
11
|
+
|
12
|
+
rvm upgrade [new ruby] [existing ruby]
|
13
|
+
|
14
|
+
Description:
|
15
|
+
|
16
|
+
Upgrades the latest installed ruby with a given ruby string
|
17
|
+
(e.g. ree) to the latest known version or the version specified
|
18
|
+
|
19
|
+
"
|
20
|
+
}
|
21
|
+
|
22
|
+
confirm()
|
23
|
+
{
|
24
|
+
|
25
|
+
local confirmation_response
|
26
|
+
|
27
|
+
printf "$1 (Y/n): "
|
28
|
+
|
29
|
+
read -r confirmation_response
|
30
|
+
|
31
|
+
if [[ -n "$confirmation_response" ]] ; then
|
32
|
+
echo $confirmation_response | \grep -qi '^y\|^Y'
|
33
|
+
fi
|
34
|
+
}
|
35
|
+
|
36
|
+
die_with_error()
|
37
|
+
{
|
38
|
+
"$rvm_path/scripts/log" "fail" "$1"
|
39
|
+
exit "${2:-1}"
|
40
|
+
}
|
41
|
+
|
42
|
+
expand_ruby_name()
|
43
|
+
{
|
44
|
+
"$rvm_path/scripts/tools" strings "$1" \
|
45
|
+
| awk -F"${rvm_gemset_separator:-"@"}" '{print $1}'
|
46
|
+
}
|
47
|
+
|
48
|
+
expand_existing_ruby()
|
49
|
+
{
|
50
|
+
local prefix ruby_name
|
51
|
+
|
52
|
+
prefix="$(expand_ruby_name "$1" | awk -F'-' '{print $1"-"$2}')"
|
53
|
+
|
54
|
+
while read -r ruby_name; do
|
55
|
+
|
56
|
+
if [[ "$ruby_name" != "$expanded_destination"* ]]; then
|
57
|
+
echo "$ruby_name" ; return 0
|
58
|
+
fi
|
59
|
+
|
60
|
+
done < <("$rvm_path/scripts/list" strings | tr ' ' '\n' \
|
61
|
+
| sort -ur | \grep "^$prefix" | \grep -v '-head$' | head -n1)
|
62
|
+
|
63
|
+
return 1
|
64
|
+
}
|
65
|
+
|
66
|
+
upgrade_ruby()
|
67
|
+
{
|
68
|
+
|
69
|
+
if [[ -z "$source_ruby" ]] ; then
|
70
|
+
die_with_error "Unable to find a source ruby. Please manually provide one."
|
71
|
+
fi
|
72
|
+
|
73
|
+
expanded_source="$(expand_ruby_name "$source_ruby")"
|
74
|
+
|
75
|
+
if [[ -z "$expanded_source" ]] ; then
|
76
|
+
die_with_error "The source ruby was not a valid ruby string."
|
77
|
+
fi
|
78
|
+
|
79
|
+
if ! confirm "Are you sure you wish to upgrade from $expanded_source to \
|
80
|
+
$expanded_destination?" ; then
|
81
|
+
die_with_error "Cancelling upgrade."
|
82
|
+
fi
|
83
|
+
|
84
|
+
if [[ ! -d "$rvm_path/rubies/$expanded_destination" ]]; then
|
85
|
+
|
86
|
+
"$rvm_path/scripts/log" "info" \
|
87
|
+
"Installing new ruby $expanded_destination"
|
88
|
+
|
89
|
+
"${rvm_bin_path:-"$rvm_path/bin"}/rvm" install "$expanded_destination"
|
90
|
+
|
91
|
+
result="$?"
|
92
|
+
|
93
|
+
if [[ "$result" -gt 0 ]] ; then
|
94
|
+
die_with_error "Unable to install ruby $expanded_destination. \
|
95
|
+
Please install it manually to continue." "$result"
|
96
|
+
fi
|
97
|
+
|
98
|
+
fi
|
99
|
+
|
100
|
+
"$rvm_path/scripts/log" "info" \
|
101
|
+
"Migrating gems from $expanded_source to $expanded_destination"
|
102
|
+
|
103
|
+
"$rvm_path/scripts/migrate" "$expanded_source" "$expanded_destination"
|
104
|
+
result="$?"
|
105
|
+
|
106
|
+
[[ "$result" -gt 0 ]] && die_with_error "Error migrating gems." "$result"
|
107
|
+
|
108
|
+
"$rvm_path/scripts/log" "info" "Upgrade complete!"
|
109
|
+
}
|
110
|
+
|
111
|
+
args=($*)
|
112
|
+
destination_ruby="${args[$__array_start]}"
|
113
|
+
args[$__array_start]=""
|
114
|
+
args=(${args[@]})
|
115
|
+
|
116
|
+
source_ruby="${args[$__array_start]:-"$(expand_existing_ruby "$destination_ruby")"}"
|
117
|
+
args[$__array_start]=""
|
118
|
+
args=(${args[@]})
|
119
|
+
|
120
|
+
if [[ -z "${source_ruby:-""}" ]] ; then
|
121
|
+
usage >&2
|
122
|
+
exit 1
|
123
|
+
fi
|
124
|
+
|
125
|
+
if [[ "help" = "$source_ruby" ]] ; then
|
126
|
+
usage
|
127
|
+
exit 0
|
128
|
+
fi
|
129
|
+
|
130
|
+
expanded_destination="$(expand_ruby_name "$destination_ruby")"
|
131
|
+
|
132
|
+
if [[ -z "$source_ruby" ]] ; then
|
133
|
+
die_with_error \
|
134
|
+
"Source ruby was either not a recognized ruby string or not installed."
|
135
|
+
fi
|
136
|
+
|
137
|
+
if [[ -z "$expanded_destination" ]] ; then
|
138
|
+
die_with_error \
|
139
|
+
"Destination ruby is not a known ruby string."
|
140
|
+
fi
|
141
|
+
|
142
|
+
upgrade_ruby
|
143
|
+
|
144
|
+
exit $?
|