Skip to content

Instantly share code, notes, and snippets.

@LeFnord
Created May 18, 2020 15:17
Show Gist options
  • Save LeFnord/1100fc2b6839de97ba5c1141c8fee869 to your computer and use it in GitHub Desktop.
Save LeFnord/1100fc2b6839de97ba5c1141c8fee869 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
# since ruby 2.7.1 is out, also a bunch of deprecation warnings pos up,
# this makes sense, but in day-to-day it is annoying
#
# this snippet is then be loaded on my .zshrc and sets the stuff dependeing on ruby version
#!/usr/bin/env sh
set -e
command="ruby -v"
ruby_version=$(eval "$command")
if [[ "$ruby_version" == "ruby 2.6"* ]]; then
echo $ruby_version
# this exists only to ensure all is fine
unset RUBYOPT
elif [[ "$ruby_version" == "ruby 2.7"* ]]; then
echo $ruby_version
export RUBYOPT='-W:no-deprecated -W:no-experimental'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment