rvm 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/binscripts/rvm +24 -0
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +2 -2
- data/scripts/alias +67 -18
- data/scripts/base +11 -1
- data/scripts/cli +9 -13
- data/scripts/db +57 -12
- data/scripts/gemsets +77 -27
- data/scripts/manage +83 -37
- data/scripts/package +1 -2
- data/scripts/repair +1 -1
- data/scripts/rvm +4 -3
- data/scripts/selector +3 -2
- data/scripts/set +93 -10
- data/scripts/utility +79 -75
- metadata +4 -4
data/scripts/manage
CHANGED
@@ -15,8 +15,6 @@ __rvm_check_for_clang() {
|
|
15
15
|
|
16
16
|
# Checks for bison, returns zero iff it is found
|
17
17
|
__rvm_check_for_bison() {
|
18
|
-
local result
|
19
|
-
|
20
18
|
if [[ ${rvm_head_flag:-0} -gt 0 ]]; then
|
21
19
|
command -v bison > /dev/null
|
22
20
|
result=$?
|
@@ -26,7 +24,7 @@ __rvm_check_for_bison() {
|
|
26
24
|
fi
|
27
25
|
fi
|
28
26
|
|
29
|
-
return $result
|
27
|
+
return ${result:-0}
|
30
28
|
}
|
31
29
|
|
32
30
|
# Emits a number of patches to STDOUT, each on a new name
|
@@ -59,7 +57,7 @@ __rvm_current_patch_names() {
|
|
59
57
|
|
60
58
|
__rvm_apply_patches() {
|
61
59
|
|
62
|
-
local
|
60
|
+
local patches patch_name patch_level_separator patch_fuzziness patch_level source_directory full_patch_path
|
63
61
|
|
64
62
|
result=0
|
65
63
|
patch_level_separator="%"
|
@@ -107,12 +105,12 @@ __rvm_apply_patches() {
|
|
107
105
|
done
|
108
106
|
)
|
109
107
|
|
110
|
-
return $result
|
108
|
+
return ${result:-0}
|
111
109
|
}
|
112
110
|
|
113
111
|
__rvm_install_source() {
|
114
112
|
|
115
|
-
local
|
113
|
+
local directory configure_parameters db_configure_flags
|
116
114
|
|
117
115
|
[[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] && __rvm_select
|
118
116
|
|
@@ -259,23 +257,23 @@ __rvm_install_source() {
|
|
259
257
|
export BUNDLE_PATH="$rvm_ruby_gem_home"
|
260
258
|
|
261
259
|
__rvm_rubygems_setup
|
260
|
+
result=$?
|
262
261
|
|
263
262
|
__rvm_bin_script
|
264
263
|
|
265
264
|
__rvm_run "chmod.bin" "chmod +x $rvm_ruby_home/bin/*"
|
266
265
|
|
267
266
|
__rvm_post_install
|
267
|
+
result=$?
|
268
268
|
|
269
269
|
"$rvm_path/scripts/log" "info" \
|
270
270
|
"Install of $rvm_ruby_string - #complete "
|
271
271
|
|
272
|
-
return 0
|
272
|
+
return ${result:-0}
|
273
273
|
}
|
274
274
|
|
275
275
|
__rvm_install_ruby() {
|
276
276
|
|
277
|
-
local result
|
278
|
-
|
279
277
|
if [[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] ; then __rvm_select ; fi
|
280
278
|
|
281
279
|
if [[ -n "${RUBYOPT:-""}" ]] ; then ruby_options="$RUBYOPT" ; fi
|
@@ -726,7 +724,7 @@ RubyWrapper
|
|
726
724
|
|
727
725
|
"$rvm_path/scripts/log" "info" "Copying across included gems"
|
728
726
|
|
729
|
-
cp -R "$rvm_ruby_home/lib/ruby/gems/1.8/" "$
|
727
|
+
cp -R "$rvm_ruby_home/lib/ruby/gems/1.8/" "$rvm_ruby_gem_home/"
|
730
728
|
fi
|
731
729
|
;;
|
732
730
|
|
@@ -1121,12 +1119,10 @@ RubyWrapper
|
|
1121
1119
|
export RUBYOPT
|
1122
1120
|
fi
|
1123
1121
|
|
1124
|
-
return $result
|
1122
|
+
return ${result:-0}
|
1125
1123
|
}
|
1126
1124
|
|
1127
1125
|
__rvm_fetch_from_github() {
|
1128
|
-
local result
|
1129
|
-
|
1130
1126
|
rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
1131
1127
|
|
1132
1128
|
if [[ ! -d "${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string/.git" ]] ; then
|
@@ -1157,11 +1153,10 @@ __rvm_fetch_from_github() {
|
|
1157
1153
|
|
1158
1154
|
builtin cd "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
1159
1155
|
|
1160
|
-
return
|
1156
|
+
return ${result:-0}
|
1161
1157
|
}
|
1162
1158
|
|
1163
1159
|
__rvm_fetch_ruby() {
|
1164
|
-
local result
|
1165
1160
|
|
1166
1161
|
[[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] && __rvm_select
|
1167
1162
|
|
@@ -1242,7 +1237,7 @@ __rvm_fetch_ruby() {
|
|
1242
1237
|
fi
|
1243
1238
|
;;
|
1244
1239
|
tar.bz2)
|
1245
|
-
__rvm_run "extract" "bunzip2 <
|
1240
|
+
__rvm_run "extract" "bunzip2 < '${rvm_archives_path:-"$rvm_path/archives"}/$rvm_ruby_package_file.$rvm_archive_extension' | tar xf - -C /tmp/rvm_src_$$" "$rvm_ruby_string - #extracting $rvm_ruby_package_file to ${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
1246
1241
|
result=$?
|
1247
1242
|
|
1248
1243
|
if [[ "$result" -gt 0 ]] ; then
|
@@ -1318,7 +1313,8 @@ __rvm_fetch_ruby() {
|
|
1318
1313
|
|
1319
1314
|
rvm_ruby_repo_http_url="${rvm_ruby_repo_url//git:/http:/}"
|
1320
1315
|
|
1321
|
-
"$rvm_path/scripts/log" "info"
|
1316
|
+
"$rvm_path/scripts/log" "info" \
|
1317
|
+
"Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
|
1322
1318
|
|
1323
1319
|
git clone --depth 1 "$rvm_ruby_repo_url" "${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string"
|
1324
1320
|
result=$?
|
@@ -1386,7 +1382,9 @@ __rvm_fetch_ruby() {
|
|
1386
1382
|
else
|
1387
1383
|
rm -rf "${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string"
|
1388
1384
|
|
1389
|
-
__rvm_run "svn.checkout"
|
1385
|
+
__rvm_run "svn.checkout" \
|
1386
|
+
"svn checkout -q ${rvm_rev/-r/-r } $rvm_ruby_url ${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string" \
|
1387
|
+
"Downloading source from ${rvm_ruby_url}."
|
1390
1388
|
fi
|
1391
1389
|
result=$?
|
1392
1390
|
|
@@ -1403,39 +1401,57 @@ __rvm_fetch_ruby() {
|
|
1403
1401
|
|
1404
1402
|
cp -R "${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string" "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
1405
1403
|
fi
|
1404
|
+
|
1405
|
+
return ${result:-0}
|
1406
1406
|
}
|
1407
1407
|
|
1408
1408
|
__rvm_check_default() {
|
1409
1409
|
|
1410
|
-
local default_ruby_interpreter
|
1410
|
+
local default_ruby_interpreter current_ruby_interpreter
|
1411
1411
|
|
1412
|
-
|
1412
|
+
default_ruby_interpreter="$(rvm alias show default 2>/dev/null | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')"
|
1413
|
+
|
1414
|
+
current_ruby_interpreter="$(echo "$rvm_ruby_string" | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')"
|
1413
1415
|
|
1414
1416
|
if [[ -n "$current_ruby_interpreter" && "$current_ruby_interpreter" = "$default_ruby_interpreter" ]]; then
|
1417
|
+
|
1415
1418
|
__rvm_run_with_env 'default.restore' 'system' 'rvm use system --default' 'Removing default ruby interpreter'
|
1419
|
+
|
1416
1420
|
fi
|
1421
|
+
|
1422
|
+
return $?
|
1417
1423
|
}
|
1418
1424
|
|
1419
1425
|
__rvm_uninstall_ruby() {
|
1420
1426
|
|
1427
|
+
local dir
|
1428
|
+
|
1421
1429
|
if [[ ${rvm_ruby_selected_flag} -eq 0 ]] ; then __rvm_select ; fi
|
1422
1430
|
|
1423
1431
|
if [[ -n "${rvm_ruby_string:-""}" ]] ; then
|
1424
1432
|
|
1425
1433
|
for dir in "$rvm_path/rubies" ; do
|
1434
|
+
|
1426
1435
|
if [[ -d "$dir/$rvm_ruby_string" ]] ; then
|
1436
|
+
|
1427
1437
|
"$rvm_path/scripts/log" "info" "Removing $dir/$rvm_ruby_string..."
|
1428
1438
|
|
1429
1439
|
rm -rf $dir/$rvm_ruby_string
|
1440
|
+
|
1430
1441
|
else
|
1442
|
+
|
1431
1443
|
"$rvm_path/scripts/log" "info" \
|
1432
1444
|
"$dir/$rvm_ruby_string has already been removed."
|
1445
|
+
|
1433
1446
|
fi
|
1434
1447
|
|
1435
1448
|
if [[ -e "${rvm_bin_path:-"$rvm_path/bin"}/$rvm_ruby_string" ]] ; then
|
1449
|
+
|
1436
1450
|
rm -f "${rvm_bin_path:-"$rvm_path/bin"}/$rvm_ruby_string"
|
1451
|
+
|
1437
1452
|
fi
|
1438
|
-
|
1453
|
+
|
1454
|
+
done
|
1439
1455
|
|
1440
1456
|
__rvm_remove_install_record "$rvm_ruby_string"
|
1441
1457
|
|
@@ -1444,8 +1460,10 @@ __rvm_uninstall_ruby() {
|
|
1444
1460
|
__rvm_check_default
|
1445
1461
|
|
1446
1462
|
else
|
1463
|
+
|
1447
1464
|
"$rvm_path/scripts/log" "fail" \
|
1448
1465
|
"Cannot uninstall unknown package '$rvm_ruby_string'"
|
1466
|
+
|
1449
1467
|
fi
|
1450
1468
|
|
1451
1469
|
unset rvm_uninstall_flag
|
@@ -1454,6 +1472,9 @@ __rvm_uninstall_ruby() {
|
|
1454
1472
|
}
|
1455
1473
|
|
1456
1474
|
__rvm_remove_ruby() {
|
1475
|
+
|
1476
|
+
local dir
|
1477
|
+
|
1457
1478
|
if [[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] ; then __rvm_select ; fi
|
1458
1479
|
|
1459
1480
|
if [[ -n "${rvm_ruby_string:-""}" ]] ; then
|
@@ -1461,20 +1482,26 @@ __rvm_remove_ruby() {
|
|
1461
1482
|
for dir in ${rvm_src_path:-"$rvm_path/src"} $rvm_path/rubies ; do
|
1462
1483
|
|
1463
1484
|
if [[ -d $dir/$rvm_ruby_string ]] ; then
|
1485
|
+
|
1464
1486
|
"$rvm_path/scripts/log" "info" "Removing $dir/$rvm_ruby_string..."
|
1465
|
-
|
1487
|
+
|
1488
|
+
rm -rf "$dir/$rvm_ruby_string"
|
1466
1489
|
|
1467
1490
|
else
|
1491
|
+
|
1468
1492
|
"$rvm_path/scripts/log" "info" "it seems that $dir/$rvm_ruby_string is already non existent."
|
1493
|
+
|
1469
1494
|
fi
|
1470
1495
|
|
1471
1496
|
if [[ -e "${rvm_bin_path:-"$rvm_path/bin"}/$rvm_ruby_string" ]] ; then
|
1497
|
+
|
1472
1498
|
rm -f "${rvm_bin_path:-"$rvm_path/bin"}/$rvm_ruby_string"
|
1499
|
+
|
1473
1500
|
fi
|
1474
1501
|
|
1475
1502
|
__rvm_check_default
|
1476
1503
|
|
1477
|
-
done
|
1504
|
+
done
|
1478
1505
|
|
1479
1506
|
__rvm_remove_install_record "$rvm_ruby_string"
|
1480
1507
|
__rvm_remove_gemsets
|
@@ -1483,9 +1510,19 @@ __rvm_remove_ruby() {
|
|
1483
1510
|
__rvm_remove_wrappers
|
1484
1511
|
__rvm_remove_environments
|
1485
1512
|
__rvm_remove_binaries
|
1513
|
+
|
1486
1514
|
else
|
1487
|
-
|
1488
|
-
|
1515
|
+
|
1516
|
+
"$rvm_path/scripts/log" "fail" \
|
1517
|
+
"Cannot remove unknown package '$rvm_ruby_string'"
|
1518
|
+
|
1519
|
+
return 1
|
1520
|
+
|
1521
|
+
fi
|
1522
|
+
|
1523
|
+
unset rvm_remove_flag
|
1524
|
+
|
1525
|
+
return 0
|
1489
1526
|
}
|
1490
1527
|
|
1491
1528
|
__rvm_remove_gemsets() {
|
@@ -1585,7 +1622,7 @@ __rvm_post_install() {
|
|
1585
1622
|
fi
|
1586
1623
|
|
1587
1624
|
"$rvm_path/scripts/log" "info" \
|
1588
|
-
"$rvm_ruby_string adjusting #shebangs for ($binaries)."
|
1625
|
+
"$rvm_ruby_string - adjusting #shebangs for ($binaries)."
|
1589
1626
|
|
1590
1627
|
for binary in "${binaries[@]}" ; do
|
1591
1628
|
|
@@ -1612,7 +1649,9 @@ __rvm_post_install() {
|
|
1612
1649
|
fi
|
1613
1650
|
|
1614
1651
|
# Import the initial gemsets.
|
1615
|
-
__rvm_run_with_env "gemsets.initial" "$rvm_ruby_string"
|
1652
|
+
__rvm_run_with_env "gemsets.initial" "$rvm_ruby_string" \
|
1653
|
+
"'$rvm_path/scripts/gemsets' initial" \
|
1654
|
+
"$rvm_ruby_string - #importing default gemsets ($rvm_path/gemsets/)"
|
1616
1655
|
|
1617
1656
|
__rvm_irbrc
|
1618
1657
|
|
@@ -1644,9 +1683,9 @@ __rvm_generate_default_docs() {
|
|
1644
1683
|
|
1645
1684
|
__rvm_rubygems_setup() {
|
1646
1685
|
|
1647
|
-
local
|
1686
|
+
local home path dir directory_name version_number ruby_lib_gem_path
|
1648
1687
|
|
1649
|
-
if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.9/')"
|
1688
|
+
if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.9/')" || -n "$(echo "$rvm_ruby_interpreter" | awk '/^mput/')" ]] ; then
|
1650
1689
|
install=0
|
1651
1690
|
|
1652
1691
|
elif [[ "$rvm_ruby_string" = "ruby-head" ]] ; then
|
@@ -1708,13 +1747,16 @@ __rvm_rubygems_setup() {
|
|
1708
1747
|
|
1709
1748
|
# Hands off rubygems for rbx & jruby
|
1710
1749
|
if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then
|
1711
|
-
"$rvm_path/scripts/log" "debug"
|
1750
|
+
"$rvm_path/scripts/log" "debug" \
|
1751
|
+
"Skipping rubygems update for $rvm_ruby_version"
|
1712
1752
|
fi
|
1713
1753
|
|
1714
1754
|
ruby_lib_gem_path="$rvm_ruby_home/lib/ruby/gems/jruby"
|
1715
1755
|
|
1716
1756
|
else
|
1717
|
-
|
1757
|
+
|
1758
|
+
"$rvm_path/scripts/log" "info" \
|
1759
|
+
"$rvm_ruby_string - #rubygems installing to $rvm_ruby_string"
|
1718
1760
|
|
1719
1761
|
rvm_rubygems_version="$(__rvm_db "${rvm_ruby_interpreter}_rubygems_version")"
|
1720
1762
|
rvm_rubygems_version="${rvm_rubygems_version:-"$(__rvm_db "rubygems_version")"}"
|
@@ -1751,8 +1793,9 @@ __rvm_rubygems_setup() {
|
|
1751
1793
|
builtin cd "${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name"
|
1752
1794
|
|
1753
1795
|
__rvm_run "rubygems.install" \
|
1754
|
-
"GEM_PATH=
|
1796
|
+
"GEM_PATH='$rvm_ruby_gem_path:$rvm_ruby_global_gems_path' GEM_HOME='$rvm_ruby_gem_home' BUNDLE_PATH='$rvm_ruby_gem_home' $rvm_ruby_home/bin/ruby ${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name/setup.rb"
|
1755
1797
|
result=$?
|
1798
|
+
|
1756
1799
|
if [[ $result -gt 0 ]] ; then
|
1757
1800
|
"$rvm_path/scripts/log" "warning" \
|
1758
1801
|
"$rvm_ruby_string - #warning Installation of rubygems $rvm_ruby_package_name did not complete successfully."
|
@@ -1788,7 +1831,7 @@ __rvm_rubygems_setup() {
|
|
1788
1831
|
__rvm_inject_ruby_shebang "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/bin/rake"
|
1789
1832
|
fi
|
1790
1833
|
|
1791
|
-
return $result
|
1834
|
+
return ${result:-0}
|
1792
1835
|
}
|
1793
1836
|
|
1794
1837
|
__rvm_inject_ruby_shebang() {
|
@@ -1810,13 +1853,13 @@ __rvm_inject_gem_env() {
|
|
1810
1853
|
|
1811
1854
|
__rvm_actual_file $1
|
1812
1855
|
|
1813
|
-
if [[ -
|
1856
|
+
if [[ -s "$actual_file" ]] ; then
|
1814
1857
|
|
1815
|
-
if [[ -n "$(head -n 1 $actual_file | awk '/[j]*ruby/')" ]] ; then
|
1858
|
+
if [[ -n "$(head -n 1 "$actual_file" | awk '/[j]*ruby/')" ]] ; then
|
1816
1859
|
|
1817
1860
|
string="ENV['GEM_HOME']=ENV['GEM_HOME'] || '$rvm_ruby_gem_home'\nENV['GEM_PATH']=ENV['GEM_PATH'] || '$rvm_ruby_gem_path'\nENV['PATH']='$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin:$rvm_ruby_home/bin:' + ENV['PATH']\nENV['BUNDLE_PATH']=ENV['BUNDLE_PATH'] || '$rvm_ruby_gem_home'\n"
|
1818
1861
|
|
1819
|
-
elif [[ -n "$(head -n 1 $actual_file | awk '/bash/')" ]] ; then
|
1862
|
+
elif [[ -n "$(head -n 1 "$actual_file" | awk '/bash/')" ]] ; then
|
1820
1863
|
|
1821
1864
|
string="GEM_HOME=\${GEM_HOME:-'$rvm_ruby_gem_home'}\nGEM_PATH=\${GEM_PATH:-'$rvm_ruby_gem_home:$rvm_ruby_global_gems_path'}\nPATH=$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin:$rvm_ruby_home/bin:\$PATH\nBUNDLE_PATH=\${BUNDLE_PATH:-'$rvm_ruby_gem_home'}\n"
|
1822
1865
|
|
@@ -1830,11 +1873,13 @@ __rvm_inject_gem_env() {
|
|
1830
1873
|
|
1831
1874
|
fi
|
1832
1875
|
fi
|
1876
|
+
|
1877
|
+
return 0
|
1833
1878
|
}
|
1834
1879
|
|
1835
1880
|
__rvm_actual_file() {
|
1836
1881
|
|
1837
|
-
if [[ -L $1 ]] ; then
|
1882
|
+
if [[ -L "$1" ]] ; then # If the file is a symlink,
|
1838
1883
|
|
1839
1884
|
actual_file="$(readlink $1)" # read the link target so we can preserve it.
|
1840
1885
|
|
@@ -1844,6 +1889,7 @@ __rvm_actual_file() {
|
|
1844
1889
|
|
1845
1890
|
fi
|
1846
1891
|
|
1892
|
+
return 0
|
1847
1893
|
}
|
1848
1894
|
|
1849
1895
|
__rvm_manage_rubies() {
|
data/scripts/package
CHANGED
@@ -12,7 +12,6 @@ library="${args[1]:-""}"
|
|
12
12
|
args="$(echo ${args[@]:2})"
|
13
13
|
|
14
14
|
install_package() {
|
15
|
-
local result
|
16
15
|
|
17
16
|
__rvm_db "${package}_url" "package_url"
|
18
17
|
|
@@ -72,7 +71,7 @@ install_package() {
|
|
72
71
|
)
|
73
72
|
result=$?
|
74
73
|
|
75
|
-
return $result
|
74
|
+
return ${result:-0}
|
76
75
|
}
|
77
76
|
|
78
77
|
readline() {
|
data/scripts/repair
CHANGED
@@ -70,7 +70,7 @@ repair_archives() {
|
|
70
70
|
|
71
71
|
if [[ -n "$stored_md5sum" ]] ; then
|
72
72
|
|
73
|
-
if
|
73
|
+
if ! "$rvm_path/scripts/md5" "${rvm_archives_path:-"$rvm_path/archives"}/$archive_file" "$stored_md5sum" ; then
|
74
74
|
|
75
75
|
"$rvm_path/scripts/log" "info" "Removing archive for '$archive_file' - Incorrect md5 checksum."
|
76
76
|
|
data/scripts/rvm
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
# http://github.com/wayneeseguin/rvm
|
6
6
|
|
7
7
|
if [[ ${rvm_loaded_flag:-0} -eq 0 || ${rvm_reload_flag:-0} -eq 1 ]] ; then
|
8
|
+
|
8
9
|
unset rvm_reload_flag
|
9
10
|
|
10
11
|
if [[ -z "$rvm_ignore_rvmrc" ]]; then
|
@@ -68,8 +69,6 @@ if [[ ${rvm_loaded_flag:-0} -eq 0 || ${rvm_reload_flag:-0} -eq 1 ]] ; then
|
|
68
69
|
fi
|
69
70
|
done
|
70
71
|
|
71
|
-
rvm_loaded_flag=1
|
72
|
-
|
73
72
|
rvm_version="$(awk '/:/{printf $NF"."}' "$rvm_path/lib/VERSION.yml")"
|
74
73
|
|
75
74
|
export rvm_version="${rvm_version/%.}"
|
@@ -94,5 +93,7 @@ if [[ ${rvm_loaded_flag:-0} -eq 0 || ${rvm_reload_flag:-0} -eq 1 ]] ; then
|
|
94
93
|
fi
|
95
94
|
|
96
95
|
unset rvm_prefix_needs_trailing_slash rvm_bin_path rvm_man_path rvm_rc_files rvm_gems_path rvm_gems_cache_path rvm_selfcontained rvm_interactive_flag rvm_gems_path rvm_project_rvmrc_default rvm_gemset_separator
|
97
|
-
fi
|
98
96
|
|
97
|
+
rvm_loaded_flag=1
|
98
|
+
|
99
|
+
fi
|
data/scripts/selector
CHANGED
@@ -243,7 +243,7 @@ __rvm_select() {
|
|
243
243
|
\mkdir -p "${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string"
|
244
244
|
fi
|
245
245
|
|
246
|
-
export rvm_head_flag
|
246
|
+
export rvm_action rvm_alias_expanded rvm_archflags rvm_archive_extension rvm_bin_flag rvm_bin_path rvm_clang_flag rvm_configure_flags rvm_debug_flag rvm_default_flag rvm_delete_flag rvm_docs_type rvm_dump_environment_flag rvm_error_message rvm_expanding_aliases rvm_file_name rvm_gemdir_flag rvm_gemset_name rvm_gemstone_package_file rvm_gemstone_url rvm_head_flag rvm_hook rvm_install_arguments rvm_install_on_use_flag rvm_interactive_flag rvm_llvm_flag rvm_loaded_flag rvm_make_flags rvm_niceness rvm_nightly_flag rvm_only_path_flag rvm_parse_break rvm_patch_names rvm_patch_original_pwd rvm_pretty_print_flag rvm_prior_cc rvm_proxy rvm_quiet_flag rvm_ree_options rvm_reload_flag rvm_remove_flag rvm_ruby_alias rvm_ruby_aliases rvm_ruby_args rvm_ruby_binary rvm_ruby_bits rvm_ruby_configure rvm_ruby_file rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_global_gems_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_load_path rvm_ruby_major_version rvm_ruby_make rvm_ruby_make_install rvm_ruby_minor_version rvm_ruby_mode rvm_ruby_name rvm_ruby_package_file rvm_ruby_package_name rvm_ruby_patch rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_require rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_sha rvm_ruby_string rvm_ruby_strings rvm_ruby_tag rvm_ruby_url rvm_ruby_user_tag rvm_ruby_version rvm_script_name rvm_sdk rvm_silent_flag rvm_sticky_flag rvm_system_flag rvm_token rvm_trace_flag rvm_use_flag rvm_user_flag rvm_verbose_flag rvm_wrapper_name
|
247
247
|
|
248
248
|
else
|
249
249
|
rvm_ruby_interpreter="${rvm_ruby_interpreter:-system}"
|
@@ -253,7 +253,8 @@ __rvm_select() {
|
|
253
253
|
__rvm_use() {
|
254
254
|
local new_path binary full_binary_path rvm_ruby_gem_home
|
255
255
|
|
256
|
-
if [[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] ; then __rvm_select "$@" ; fi
|
256
|
+
#if [[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] ; then __rvm_select "$@" ; fi
|
257
|
+
__rvm_select "$@"
|
257
258
|
|
258
259
|
if [[ -z "${rvm_ruby_interpreter:-""}" ]] ; then rvm_ruby_interpreter="system" ; fi
|
259
260
|
|
data/scripts/set
CHANGED
@@ -24,30 +24,45 @@ __rvm_ruby_do() {
|
|
24
24
|
|
25
25
|
else
|
26
26
|
binary="$(echo $action | sed 's#do$##')"
|
27
|
+
|
27
28
|
if [[ -x "$rvm_ruby_home/bin/$binary" ]] ; then
|
29
|
+
|
28
30
|
binary="$rvm_ruby_home/bin/$binary"
|
29
31
|
|
32
|
+
|
30
33
|
elif [[ -x "$rvm_ruby_global_gems_path/bin/$binary" ]] ; then
|
34
|
+
|
31
35
|
binary="$rvm_ruby_global_gems_path/bin/$binary"
|
32
36
|
|
33
37
|
elif [[ -x "$rvm_ruby_gem_home/bin/$binary" ]] ; then
|
38
|
+
|
34
39
|
binary="$rvm_ruby_gem_home/bin/$binary"
|
35
40
|
|
36
41
|
elif [[ "system" = "$rvm_ruby_string" ]] && [[ -x "$(command -v $binary)" ]] ; then
|
42
|
+
|
37
43
|
binary="$(basename $(command -v $binary) 2>/dev/null)"
|
38
44
|
|
39
45
|
else
|
40
|
-
|
46
|
+
|
47
|
+
"$rvm_path/scripts/log" "warn" \
|
48
|
+
"'$binary not found for $rvm_ruby_string' either does not exist or is not executable? :("
|
49
|
+
|
41
50
|
__rvm_unset_ruby_variables
|
51
|
+
|
42
52
|
return 1
|
53
|
+
|
43
54
|
fi
|
44
55
|
|
45
56
|
if [[ ! -z "$rvm_ruby_mode" ]] ; then
|
57
|
+
|
46
58
|
rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_mode}"
|
59
|
+
|
47
60
|
rvm_ruby_mode="--$(echo "$rvm_ruby_mode" | sed 's/^m//')"
|
61
|
+
|
48
62
|
fi
|
49
63
|
|
50
64
|
load_path="$(dirname $(command -v $binary) 2>/dev/null):$rvm_ruby_load_path"
|
65
|
+
|
51
66
|
# TODO: the else case below should be run if $args =~ /\.rb$/
|
52
67
|
if [[ "ruby" = "$(basename $binary)" && "$rvm_benchmark_flag" -ne 1 ]] ; then
|
53
68
|
|
@@ -56,27 +71,43 @@ __rvm_ruby_do() {
|
|
56
71
|
if [[ -z "$prefix" ]] ; then prefix="-S" ; fi
|
57
72
|
|
58
73
|
if ! "$rvm_path/scripts/match" "$args" "$prefix" ; then
|
74
|
+
|
59
75
|
args="$prefix $args"
|
76
|
+
|
60
77
|
fi
|
61
78
|
fi
|
62
|
-
|
79
|
+
|
80
|
+
rvm_command="$(printf "$binary $rvm_ruby_mode $rvm_ruby_require -I$load_path $args")"
|
81
|
+
|
63
82
|
else
|
64
|
-
|
83
|
+
|
84
|
+
rvm_command="$(printf "$binary $rvm_ruby_mode $args")"
|
85
|
+
|
65
86
|
fi
|
87
|
+
|
66
88
|
fi
|
67
89
|
|
68
|
-
if [[
|
69
|
-
|
70
|
-
|
90
|
+
if [[ -n "$rvm_json_flag" || -n "$rvm_yaml_flag" || -n "$rvm_summary_flag" ]] ; then
|
91
|
+
|
92
|
+
mkdir -p ./log/$rvm_ruby_string/
|
93
|
+
|
94
|
+
touch ./log/$rvm_ruby_string/$action.log ./log/$rvm_ruby_string/$action.error.log
|
95
|
+
|
71
96
|
eval "$rvm_command" >> ./log/$rvm_ruby_string/$action.log 2>> ./log/$rvm_ruby_string/$action.error.log
|
72
97
|
|
73
98
|
else
|
74
99
|
if [[ ${rvm_verbose_flag:-0} -gt 0 ]] ; then
|
100
|
+
|
75
101
|
current_env="$(__rvm_environment_identifier)"
|
102
|
+
|
76
103
|
if [[ "$current_env" != "$current_set_ruby" ]]; then
|
104
|
+
|
77
105
|
current_env="$current_set_ruby ($current_env)"
|
106
|
+
|
78
107
|
fi
|
108
|
+
|
79
109
|
"$rvm_path/scripts/log" "info" "$current_env: $(ruby -v $rvm_ruby_mode | \tr "\n" ' ')\n"
|
110
|
+
|
80
111
|
unset current_env
|
81
112
|
fi
|
82
113
|
eval "$rvm_command"
|
@@ -85,52 +116,84 @@ __rvm_ruby_do() {
|
|
85
116
|
|
86
117
|
string=$(basename $rvm_ruby_gem_home)
|
87
118
|
if [[ $result -eq 0 ]]; then
|
119
|
+
|
88
120
|
eval "successes=(${successes[*]} $string)"
|
121
|
+
|
89
122
|
else
|
123
|
+
|
90
124
|
eval "errors=(${errors[*]} $string)"
|
125
|
+
|
91
126
|
fi
|
92
127
|
|
93
128
|
eval "rubies=(${rubies[*]} $string)"
|
129
|
+
|
94
130
|
eval "statuses=(${statuses[*]} $result)"
|
95
131
|
|
96
132
|
unset string
|
133
|
+
|
97
134
|
__rvm_unset_ruby_variables
|
98
135
|
}
|
99
136
|
|
100
137
|
# Output the summary in a human readable format.
|
101
138
|
__rvm_summary() {
|
102
139
|
export successes errors statuses
|
140
|
+
|
103
141
|
summary="\nSummary:\n\n"
|
142
|
+
|
104
143
|
if [[ ${#successes[*]} -gt 0 ]] ; then
|
144
|
+
|
105
145
|
summary="$summary \033[0;32m${#successes[*]} successful: $(echo "${successes[*]}" | sed 's# #, #g')\033[0m\n"
|
146
|
+
|
106
147
|
fi
|
148
|
+
|
107
149
|
if [[ ${#errors[*]} -gt 0 ]] ; then
|
150
|
+
|
108
151
|
summary="$summary \033[0;31m${#errors[*]} errors: $(echo "${errors[*]}" | sed 's# #, #g')\033[0m\n"
|
152
|
+
|
109
153
|
fi
|
154
|
+
|
110
155
|
total=${#rubies[*]}
|
156
|
+
|
111
157
|
if [[ -n "${ZSH_VERSION:-""}" ]] ; then array_start=1 ; else array_start=0 ; fi
|
112
158
|
|
113
159
|
printf "$summary" | tee -a log/summary.log
|
160
|
+
|
114
161
|
return ${#errors[*]}
|
162
|
+
|
115
163
|
}
|
116
164
|
|
117
165
|
# Output the summary in a yaml format.
|
118
166
|
__rvm_yaml() {
|
119
167
|
export successes errors statuses
|
168
|
+
|
120
169
|
yaml="totals:\n rubies: ${#rubies[*]}\n successes: ${#successes[*]}\n errors: ${#errors[*]}\nsuccesses:"
|
170
|
+
|
121
171
|
for var in ${successes[*]} ; do yaml="$yaml\n - $var" ; done
|
172
|
+
|
122
173
|
yaml="$yaml\nerrors:"
|
174
|
+
|
123
175
|
for var in ${errors[*]} ; do yaml="$yaml\n - $var" ; done
|
176
|
+
|
124
177
|
yaml="$yaml\nrubies:"
|
178
|
+
|
125
179
|
total=${#rubies[*]}
|
180
|
+
|
126
181
|
if [[ -n "${ZSH_VERSION:-""}" ]] ; then array_start=1 ; else array_start=0 ; fi
|
182
|
+
|
127
183
|
for (( index = $array_start ; index < $total + $array_start ; index++ )) ; do
|
184
|
+
|
128
185
|
if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then
|
186
|
+
|
129
187
|
"$rvm_path/scripts/log" "debug" "${rubies[$index]}: ${statuses[$index]}"
|
188
|
+
|
130
189
|
fi
|
190
|
+
|
131
191
|
yaml="$yaml\n \"${rubies[$index]}\": ${statuses[$index]}"
|
192
|
+
|
132
193
|
done ; unset index array_start
|
194
|
+
|
133
195
|
\mkdir -p log
|
196
|
+
|
134
197
|
printf "$yaml" | tee -a log/summary.yaml
|
135
198
|
|
136
199
|
return ${#errors[*]}
|
@@ -148,12 +211,20 @@ __rvm_json() {
|
|
148
211
|
if [[ -n "${ZSH_VERSION:-""}" ]] ; then array_start=1 ; else array_start=0 ; fi
|
149
212
|
|
150
213
|
for (( index = $array_start ; index < $total + $array_start ; index++ )) ; do
|
214
|
+
|
151
215
|
if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then
|
216
|
+
|
152
217
|
"$rvm_path/scripts/log" "debug" "${rubies[$index]}: ${statuses[$index]}"
|
218
|
+
|
153
219
|
fi
|
220
|
+
|
154
221
|
json="$json\n {\"${rubies[$index]}\": ${statuses[$index]}}"
|
222
|
+
|
155
223
|
if (( $index + 1 < $total + $array_start )) ; then json="$json, " ; fi
|
156
|
-
|
224
|
+
|
225
|
+
done
|
226
|
+
unset index array_start
|
227
|
+
|
157
228
|
json="$json\n }\n}"
|
158
229
|
|
159
230
|
mkdir -p log
|
@@ -172,16 +243,26 @@ action="${args[0]}"
|
|
172
243
|
args=${args[@]:1}
|
173
244
|
|
174
245
|
if [[ -z "$action" ]] ; then
|
175
|
-
|
246
|
+
|
247
|
+
"$rvm_path/scripts/log" "error" \
|
248
|
+
"Action must be specified."
|
249
|
+
|
176
250
|
exit 1
|
251
|
+
|
177
252
|
fi
|
178
253
|
|
179
254
|
if [[ "$action" == "ruby" ]] && echo "$args" | \grep -q "^'--[^[:space:]]*'$" ; then
|
180
|
-
|
181
|
-
"$rvm_path/scripts/log" "warn"
|
255
|
+
|
256
|
+
"$rvm_path/scripts/log" "warn" \
|
257
|
+
"You called rvm ruby with the arguments $args which look like use options."
|
258
|
+
|
259
|
+
"$rvm_path/scripts/log" "warn" \
|
260
|
+
"Please note that 'rvm ruby' invokes set operations instead."
|
261
|
+
|
182
262
|
fi
|
183
263
|
|
184
264
|
rvm_ruby_strings=$(__rvm_expand_ruby_string "$rvm_ruby_strings")
|
265
|
+
|
185
266
|
rvm_ruby_strings=(${rvm_ruby_strings//default}) # No quotes here is intentional.
|
186
267
|
|
187
268
|
# Check for a single ruby && exec if present.
|
@@ -192,7 +273,9 @@ for current_set_ruby in ${rvm_ruby_strings[@]} ; do
|
|
192
273
|
done
|
193
274
|
|
194
275
|
if [[ ! -z "$rvm_summary_flag" ]] ; then __rvm_summary ; fi
|
276
|
+
|
195
277
|
if [[ ! -z "$rvm_yaml_flag" ]] ; then __rvm_yaml ; fi
|
278
|
+
|
196
279
|
if [[ ! -z "$rvm_json_flag" ]] ; then __rvm_json ; fi
|
197
280
|
|
198
281
|
rvm_hook="after_do" ; source "$rvm_path/scripts/hook"
|