From fa57bf51b3c46a8b2a0267c2bebedd241d062d8a Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Wed, 2 Sep 2020 01:24:48 +0300 Subject: [PATCH] Remove predicates that apply to unsupported Rubies --- script/predicate_functions.sh | 73 +--------------------- script/run_build | 1 + script/update_rubygems_and_install_bundler | 2 - 3 files changed, 4 insertions(+), 72 deletions(-) diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 746a4985f1..9b2dc1efda 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,10 +1,5 @@ -# This file was generated on 2019-12-18T14:01:39+00:00 from the rspec-dev repo. -# DO NOT modify it by hand as your changes will get lost the next time it is generated. - function is_mri { - if ruby -e "exit(!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby')"; then - # RUBY_ENGINE only returns 'ruby' on MRI. - # MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode) + if ruby -e "exit(RUBY_ENGINE == 'ruby')"; then return 0 else return 1 @@ -12,51 +7,13 @@ function is_mri { } function is_jruby { - if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then - # RUBY_ENGINE only returns 'ruby' on MRI. - # MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode) + if ruby -e "exit(RUBY_PLATFORM == 'java')"; then return 0 else return 1 fi; } -function is_mri_192 { - if is_mri; then - if ruby -e "exit(RUBY_VERSION == '1.9.2')"; then - return 0 - else - return 1 - fi - else - return 1 - fi -} - -function is_mri_192_plus { - if is_mri; then - if ruby -e "exit(RUBY_VERSION.to_f > 1.8)"; then - return 0 - else - return 1 - fi - else - return 1 - fi -} - -function is_mri_2plus { - if is_mri; then - if ruby -e "exit(RUBY_VERSION.to_f > 2.0)"; then - return 0 - else - return 1 - fi - else - return 1 - fi -} - function is_ruby_23_plus { if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then return 0 @@ -65,37 +22,13 @@ function is_ruby_23_plus { fi } -function rspec_rails_compatible { - if is_ruby_23_plus; then - return 0 - else - return 1 - fi -} - -function rspec_support_compatible { - if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then - return 0 - else - return 1 - fi -} - function additional_specs_available { type run_additional_specs > /dev/null 2>&1 return $? } function documentation_enforced { - if [ -x ./bin/yard ]; then - if is_mri_2plus; then - return 0 - else - return 1 - fi - else - return 1 - fi + [ -x ./bin/yard ] } function style_and_lint_enforced { diff --git a/script/run_build b/script/run_build index e20840e3ca..d7a36aa888 100755 --- a/script/run_build +++ b/script/run_build @@ -20,6 +20,7 @@ fi fold "cukes" run_cukes +# Yard on JRuby fails with a strange message, skip if documentation_enforced; then fold "doc check" check_documentation_coverage fi diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 3cfe3a4565..5b0a3921dc 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,6 +1,4 @@ #!/bin/bash -# This file was generated on 2019-12-18T14:01:39+00:00 from the rspec-dev repo. -# DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e source script/functions.sh