diff --git a/script/functions.sh b/script/functions.sh index f836a9044..9ea3d08ff 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -16,6 +16,11 @@ if is_mri_192_plus; then export RUBYOPT="--disable=gem" fi +if is_ruby_34_plus; then + export RUBYOPT="$RUBYOPT -W:deprecated" + export RUBYOPT="$RUBYOPT --enable=frozen-string-literal --debug=frozen-string-literal" +fi + function clone_repo { if [ ! -d $1 ]; then # don't clone if the dir is already there if [ -z "$2" ]; then diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 844d94c20..8a6e8d795 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -111,6 +111,14 @@ function is_ruby_31_plus { fi } +function is_ruby_34_plus { + if ruby -e "exit(RUBY_VERSION.to_f >= 3.4)"; then + return 0 + else + return 1 + fi +} + function rspec_rails_compatible { if is_ruby_25_plus; then # TODO remove when RSpec-Rails build is 3.1 safe by default