- Remove trailing slashes from ruby directories when iterating over
RUBIES. (@halostatue) - Ensure all temporary variables are local or unset.
- Ensure that
chruby_autocan read.ruby-versionfiles that do not end with a new-line. (@hosiawak)
- Install ruby-install 0.3.3.
- Print
$HOME,$RUBY_AUTO_VERSION. - Print
trap -p,$preexec_functionsand$precmd_functions. - Print env variables even when they are empty.
- Multiple style changes and optimizations. (@zendeavor)
- Safely glob the contents of
/opt/rubiesand~/.rubies. This prevents nullglob errors under zsh and.rbxdirectories from being added toRUBIES. - Unset
GEM_PATHinchruby_resetif it has become empty. Allows the RubyGems to use the defaultGEM_PATH. - Safely quote
RUBIES[@]to prevent implicit word-splitting when listingRUBIES. - Map
-Vto--versioninchruby. (@havenwood) - Added benchmarks.
- Unset
RUBY_AUTO_VERSIONwhen loaded. Forces sub-shells to re-detect any.ruby-versionfile. (@KevinSjoberg) - No longer export
RUBY_AUTO_VERSION. Allows new windows in tmux to detect the.ruby-versionfile. - Set
RUBY_AUTO_VERSIONeven if.ruby-versioncontains an unknown Ruby. Preventschrubyfrom printing errors after every command. - Fixed a typo where
RUBY_VERSION_FILEwas still being used. (@KevinSjoberg)
- If stdin is a TTY, then spawn an interactive shell.
chruby_useno longer echos the selected Ruby.
- Now runs under bash.
- Load
chruby.shforCHRUBY_VERSION.
- Record and compare the contents of
.ruby-versionfiles in order to detect modifications, such as when switching between branches.
- Added a RPM spec.
- Respect
PREFIXwhen auto-detecting/opt/rubies/*. - Do not set
GEM_ROOTif rubygems is not installed (Charlie Somerville). chruby_usenow echos the select ruby and the version, only if the shell is in interactive mode (Brian D. Burns).chruby_resetno longer accidentally removes/binifGEM_HOMEorGEM_ROOTare empty (David Grayson).chrubynow selects the last lexical match for the given ruby.
-
Ensure that auto-switching works in non-interactive mode:
- zsh: use
preexec_functionswhich runs in both interactive and non-interactive sessions. - bash: use
trap DEBUGwhich runs before every command, in both interactive and non-interactive mode.PROMPT_COMMANDonly runs in interactive mode.
- zsh: use
-
Fixed a serious design flaw, where
chruby_autopassed the contents of.ruby-versionas multiple arguments to thechrubyfunction. Originally, this allowed for.ruby-versionfiles to specify additionalRUBYOPToptions (ex:jruby --1.8). However, an attacker could craft a malicious.ruby-versionfile that would require arbitrary code (ex:1.9.3 -r./evil.rb). The./evil.rbfile would then be required whenrubyis invoked bychruby_usein order to determineRUBY_ENGINE,RUBY_VERSION,GEM_ROOT.In order to prevent the abuse of this feature,
chruby_autonow passes the entire contents of.ruby-versionas a first and only argument to thechrubyfunction.If you have
auto.shenabled, it is recommended that you upgrade. If you cannot upgrade, consider disablingauto.sh. If you want to scan your entire system for malicious.ruby-versionfiles:find / -name .ruby-version 2>/dev/null | xargs -i{} grep -H " " {}Thanks to David Grayson for reporting this flaw.
- Do not assume bash is installed at
/bin/bash(Shannon Skipper).
- Prepend the new gem paths to
GEM_PATHinchruby_use, instead of overriding the variable. This allows users to add common gem paths toGEM_PATHin~/.bashrc. - Only remove the gem paths used by the Ruby in
chruby_reset.
- Detect when
PROMPT_COMMAND=" "before checking ifPROMPT_COMMANDis an empty String. This appears to only happen on OSX Mountain Lion.
- Include
CHRUBY_VERSIONin the output.
- Added
-v--versionoptions tochrubyandchruby-exec. - Added
scripts/bug_report.shfor collecting environment information for bug reports. - Initialize
RUBIESto()to avoid double-loadingchruby.sh. - Invoke
rubyusing the absolute path to avoid shell aliases. This fixes a bug caused by ohmyzsh aliases.
- Unset
RUBY_VERSION_FILEon initial load for tmux. - Remove trailing
;and whitespace fromPROMPT_COMMANDbefore appending; chruby_auto.
- Bump MRI version to 1.9.3-p385.
- Use
\x1binstead of\efor OSX.
- Prevent
auto.shfrom being loaded more than once. - Recommend using
~/.bash_profileand~/.zprofile. - Use
cpandmkdirinstead ofinstallin theMakefile.
- Run under bash, to avoid the dash shell.
- Invoke
$SHELLwith the-ioption, so zsh will load shell configuration.
- Install JRuby 1.7.2.
- Use special
./configureoptions for homebrew. - Also install openssl and readline via homebrew.
- Fixed the auto-detection of
~/.rubies/*. - Check if
bin/rubyexists and is executable before switching to a Ruby. - Prevent
export=""from accidentally being set under zsh. - Prevent
script/setup.shfrom exiting if abrew installfails because all packages are already installed. - Updated the example
/etc/profile.d/chruby.shto only load under bash and zsh.
- Added the
chruby-executility for use incrontabor with Continuous Integration (CI). - Added support for auto-detecting Rubies installed into
/opt/rubies/or~/.rubies/. - Added
share/chruby/auto.sh, which provides support for auto-switching to Rubies specified in the .ruby-version file. - Removed the "short circuit" check in
chruby_use, to allow forcibly switching to the current Ruby, in casePATHorGEM_PATHbecome corrupted.
- Forcibly switch to system Ruby when loading
share/chruby/chruby.sh. This fixes switching issues for tmux users.
- Renamed the
RUBYenvironment variable toRUBY_ROOTto avoid breaking theFileUtils#rubymethod in rake. - Do not unset
GEM_HOME,GEM_PATH,GEM_ROOTif running under root.
- Added a
Vagrantfilefor testing chruby in various environments. - Changed all code and examples to reference
/opt/rubies/. - Ensure all error messages are printed to stderr.
- Refactored
scripts/setup.shto manually install all Rubies and install any dependencies via the System Package Manager. - PGP signatures are now stored in
pkg/.
- Updated the
Makefileto be compatible with BSD automake. - Do not override
PREFIX. - Added a
testtask.
- Use
HOMEBREW_PREFIX. - Use
sha1instead ofmd5(deprecated). - No longer dynamically generate the example configuration.
- Updated the
Makefileto be compatible with the dash shell. - Use inline substring substitutions instead of
sed.
- Use
typesetto declareRUBIESas an indexed Array. - Use the correct globbed Array syntax for both zsh and bash.
- Improved the post-installation message in the homebrew recipe to auto-detect RVM, rbenv and rbfu.
- Fixed
make installto work on OS X. - Added a homebrew recipe.
- Install
chruby.shinto$PREFIX/share/chruby/.
- Check if
$RUBYand$RUBYOPTare different from the arguments passed tochruby_use. - Fixed a spelling error in the README (thanks Ian Barnett).
- Added unit-tests using shunit2
- Improved sanitation of
$PATHinchruby_reset. (thanks mpapis) - If the desired Ruby is already in use, immediately return from
chruby_use. - Export
$RUBY_ENGINE,$RUBY_VERSION,$GEM_ROOTinchruby_use.
- Added support for zsh.
- Renamed the
$RUBY_PATHvariable to$RUBY. - Set the
$RUBY_ENGINEvariable. - Set the
$GEM_ROOTvariable toGem.default_dir. This supports the custom RubyGems directory used by Rubinius. - Only initialize the
$RUBIESvariable if it does not have a value.
- Added a
LICENSE.txt. - Added a
ChangeLog.md. - Updated the
Makefileto generate proper tar archives.
- Initial release.