From 3da8fb49f1ad2648f11a151c5ed901fe97227d94 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 23 Feb 2024 10:10:15 +0000 Subject: [PATCH 1/5] Update Gemfile to point to metagem repo --- Gemfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index bdf4efb9..949b3d0b 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,11 @@ branch = File.read(File.expand_path("../maintenance-branch", __FILE__)).chomp if File.exist?(library_path) && !ENV['USE_GIT_REPOS'] gem lib, :path => library_path else - gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => branch + if lib == 'rspec' + gem 'rspec', :git => "https://github.com/rspec/rspec-metagem.git", :branch => branch + else + gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => branch + end end end From f82d1758ba68abca2b7746d6eee7b0f80088d021 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 23 Feb 2024 09:58:19 +0000 Subject: [PATCH 2/5] Updated ci build scripts (from rspec-dev) main --- .github/dependabot.yml | 2 +- .github/workflows/ci.yml | 2 +- .rubocop_rspec_base.yml | 2 +- script/ci_functions.sh | 30 +++------------------- script/clone_all_rspec_repos | 4 +-- script/cucumber.sh | 2 +- script/functions.sh | 13 +++++++--- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/run_rubocop | 2 +- script/update_rubygems_and_install_bundler | 8 +++--- 12 files changed, 26 insertions(+), 45 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ff653148..80662e54 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,4 @@ -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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. version: 2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0059a91b..22e8d75c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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. name: RSpec CI diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 982d2ff9..bc9feb87 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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. # This file contains defaults for RSpec projects. Individual projects diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 84223aac..5d21e880 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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. # Taken from: @@ -30,41 +30,17 @@ nano_cmd="$(type -p gdate date | head -1)" nano_format="+%s%N" [ "$(uname -s)" != "Darwin" ] || nano_format="${nano_format/%N/000000000}" -travis_time_start() { - travis_timer_id=$(printf %08x $(( RANDOM * RANDOM ))) - travis_start_time=$($nano_cmd -u "$nano_format") - printf "travis_time:start:%s\r\e[0m" $travis_timer_id -} - -travis_time_finish() { - local travis_end_time=$($nano_cmd -u "$nano_format") - local duration=$(($travis_end_time-$travis_start_time)) - printf "travis_time:end:%s:start=%s,finish=%s,duration=%s\r\e[0m" \ - $travis_timer_id $travis_start_time $travis_end_time $duration -} - fold() { local name="$1" local status=0 shift 1 - if [ -n "$TRAVIS" ]; then - printf "travis_fold:start:%s\r\e[0m" "$name" - travis_time_start - else - echo "============= Starting $name ===============" - fi + echo "============= Starting $name ===============" "$@" status=$? - [ -z "$TRAVIS" ] || travis_time_finish - if [ "$status" -eq 0 ]; then - if [ -n "$TRAVIS" ]; then - printf "travis_fold:end:%s\r\e[0m" "$name" - else - echo "============= Ending $name ===============" - fi + echo "============= Ending $name ===============" else STATUS="$status" fi diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index c00d6cb5..cd4589fa 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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 @@ -8,7 +8,7 @@ source script/functions.sh if is_mri; then pushd .. - clone_repo "rspec" + clone_repo "rspec-metagem" "rspec" clone_repo "rspec-core" clone_repo "rspec-expectations" clone_repo "rspec-mocks" diff --git a/script/cucumber.sh b/script/cucumber.sh index 19d04c6e..e4055c4d 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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 diff --git a/script/functions.sh b/script/functions.sh index 6d35deb8..629e1570 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -6,7 +6,6 @@ source $SCRIPT_DIR/ci_functions.sh source $SCRIPT_DIR/predicate_functions.sh # If JRUBY_OPTS isn't set, use these. -# see https://docs.travis-ci.com/user/ci-environment/ export JRUBY_OPTS=${JRUBY_OPTS:-"--server -Xcompile.invokedynamic=false"} SPECS_HAVE_RUN_FILE=specs.out MAINTENANCE_BRANCH=`cat maintenance-branch` @@ -20,12 +19,18 @@ fi function clone_repo { if [ ! -d $1 ]; then # don't clone if the dir is already there if [ -z "$2" ]; then + DIR_TARGET="$1" + else + DIR_TARGET="$2" + fi + + if [ -z "$3" ]; then BRANCH_TO_CLONE="${MAINTENANCE_BRANCH?}"; else - BRANCH_TO_CLONE="$2"; + BRANCH_TO_CLONE="$3"; fi; - ci_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch ${BRANCH_TO_CLONE?}" + ci_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch ${BRANCH_TO_CLONE?} ${DIR_TARGET?}" fi; } diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index 3c0df4f9..c68c3555 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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 diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 96feda38..1178f256 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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 { diff --git a/script/run_build b/script/run_build index 011556d4..a16987b6 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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 diff --git a/script/run_rubocop b/script/run_rubocop index 558e2675..da4cb34d 100755 --- a/script/run_rubocop +++ b/script/run_rubocop @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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 diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 871435f8..0c37e4b3 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,14 +1,14 @@ #!/bin/bash -# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo. +# This file was generated on 2024-02-23T14:21:37+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 if is_ruby_31_plus; then - echo "Installing rubygems 3.3.6 / bundler 2.3.6" - yes | gem update --system '3.3.6' - yes | gem install bundler -v '2.3.6' + echo "Installing most recent rubygems / bundler" + yes | gem update --no-document --system + yes | gem install --no-document bundler elif is_ruby_23_plus; then echo "Installing rubygems 3.2.22 / bundler 2.2.22" yes | gem update --system '3.2.22' From aa1c32daeeead97732ec49bc51c6831f10c55339 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 23 Feb 2024 14:52:00 +0000 Subject: [PATCH 3/5] Explictly add bigdecimal to Gemfile --- Gemfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index 949b3d0b..847643a5 100644 --- a/Gemfile +++ b/Gemfile @@ -31,6 +31,11 @@ else gem 'diff-lcs', '~> 1.4', '>= 1.4.3' end +if RUBY_VERSION >= '3.3.0' + # This is being extracted in Ruby 3.4 and issues a warning on 3.3 + gem 'bigdecimal', :require => false +end + if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/) gem "childprocess", "< 1.0.0" elsif RUBY_VERSION < '2.0.0' From 6fe6ba50da34d16278606505667839550a7b7a05 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 23 Feb 2024 15:12:48 +0000 Subject: [PATCH 4/5] Exclude the new warning require checker from RSpec filter --- lib/rspec/support/caller_filter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec/support/caller_filter.rb b/lib/rspec/support/caller_filter.rb index 0c4b37ce..e54b23aa 100644 --- a/lib/rspec/support/caller_filter.rb +++ b/lib/rspec/support/caller_filter.rb @@ -27,7 +27,7 @@ class CallerFilter # when `CallerFilter.first_non_rspec_line` is called from the top level of a required # file, but it depends on if rubygems is loaded or not. We don't want to have to deal # with this complexity in our `RSpec.deprecate` calls, so we ignore it here. - IGNORE_REGEX = Regexp.union(LIB_REGEX, "rubygems/core_ext/kernel_require.rb", " Date: Fri, 23 Feb 2024 15:32:44 +0000 Subject: [PATCH 5/5] Fix spec for ruby head --- spec/rspec/support/fuzzy_matcher_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/rspec/support/fuzzy_matcher_spec.rb b/spec/rspec/support/fuzzy_matcher_spec.rb index b763bcf7..9bdf14b4 100644 --- a/spec/rspec/support/fuzzy_matcher_spec.rb +++ b/spec/rspec/support/fuzzy_matcher_spec.rb @@ -64,7 +64,7 @@ def ==(other) end before(:context) do - expect { Color.new(0, 0, 0) == Object.new }.to raise_error(NoMethodError, /undefined method `r'/) + expect { Color.new(0, 0, 0) == Object.new }.to raise_error(NoMethodError, /undefined method [`']r'/) end it 'can match against an expected value that matches anything' do @@ -78,7 +78,7 @@ def o.===(*); true; end it 'surfaces the `NoMethodError` when used as the expected value' do expect { FuzzyMatcher.values_match?(Color.new(0, 0, 0), Object.new) - }.to raise_error(NoMethodError, /undefined method `r'/) + }.to raise_error(NoMethodError, /undefined method [`']r'/) end it 'can match against objects of the same type' do