@@ -1010,6 +1010,33 @@ dl_list()
10101010 done
10111011}
10121012
1013+ ruby_update_all ()
1014+ {
1015+ is_root || {
1016+ ui_error_msg ' You must execute this as root'
1017+ return 1
1018+ }
1019+
1020+ ui_debug ' Installing / updating rubygems-update...'
1021+ if gem 1> /dev/null list -i ' ^rubygems-update$' ; then
1022+ gem update rubygems-update || ui_warning ' Failed to update rubygems-update'
1023+ else
1024+ gem install rubygems-update || ui_warning ' Failed to install rubygems-update'
1025+ fi
1026+ ui_debug ' '
1027+
1028+ ui_debug ' Running update_rubygems...'
1029+ update_rubygems 1> /dev/null || ui_warning ' Failed to execute => update_rubygems'
1030+ ui_debug ' Running gem update --system...'
1031+ gem update --system || ui_warning ' Failed to execute => gem update --system'
1032+ ui_debug ' '
1033+ ui_debug ' Running gem update...'
1034+ gem update || ui_warning ' Failed to execute => gem update'
1035+ ui_debug ' '
1036+ ui_debug ' Running gem cleanup...'
1037+ gem cleanup || ui_warning ' Failed to execute => gem cleanup'
1038+ }
1039+
10131040get_32bit_programfiles ()
10141041{
10151042 local _dir
@@ -1214,6 +1241,13 @@ init_path()
12141241 if test -n " ${PATH-} " ; then PATH=" ${PATH% " ${PATHSEP:? } " } " ; fi
12151242
12161243 if test " ${PLATFORM:? } " = ' win' ; then
1244+ # Make some GNU tools available
1245+ local _program_dir_32
1246+ _program_dir_32=" $( get_32bit_programfiles) "
1247+ if test -n " ${_program_dir_32?} " ; then
1248+ add_to_path_env " ${_program_dir_32:? } /GnuWin32/bin"
1249+ fi
1250+
12171251 # On Bash under Windows (for example the one included inside Git for Windows) we need to have '/usr/bin'
12181252 # before 'C:/Windows/System32' otherwise it will use the find/sort/etc. of Windows instead of the Unix compatible ones.
12191253 # ADDITIONAL NOTE: We have to do this even under BusyBox otherwise every external bash/make executed as subshell of BusyBox will be broken.
@@ -1223,13 +1257,6 @@ init_path()
12231257 else
12241258 PATH=" /usr/bin${PATHSEP:? }${PATH:? } "
12251259 fi
1226-
1227- # Make some GNU tools available
1228- local _program_dir_32
1229- _program_dir_32=" $( get_32bit_programfiles) "
1230- if test -n " ${_program_dir_32?} " ; then
1231- add_to_path_env " ${_program_dir_32:? } /GnuWin32/bin"
1232- fi
12331260 fi
12341261
12351262 if test " ${DO_INIT_CMDLINE:- 0} " ! = ' 0' ; then remove_duplicates_from_path_env; fi
@@ -1323,11 +1350,6 @@ init_cmdline()
13231350
13241351 if test " ${PLATFORM:? } " = ' win' ; then unset JAVA_HOME; fi
13251352
1326- # Clean useless directories from the $PATH env
1327- if test " ${PLATFORM?} " = ' win' ; then
1328- remove_from_path_env " ${LOCALAPPDATA-} /Microsoft/WindowsApps"
1329- fi
1330-
13311353 # Set environment variables
13321354 readonly UTILS_DIR=" ${MAIN_DIR:? } /utils"
13331355 readonly UTILS_DATA_DIR=" ${UTILS_DIR:? } /data"
@@ -1459,6 +1481,11 @@ init_cmdline()
14591481 HOME=" ${USER_HOME:- ${HOME:? } } " command -- gpg " ${@ } "
14601482 }
14611483
1484+ gem ()
1485+ {
1486+ HOME=" ${USER_HOME:- ${HOME:? } } " command -- gem " ${@ } "
1487+ }
1488+
14621489 bundle ()
14631490 {
14641491 HOME=" ${USER_HOME:- ${HOME:? } } " command -- bundle " ${@ } "
0 commit comments