diff --git a/vagrant-pr13034-ruby32-object-regex-match-removal.patch b/vagrant-pr13034-ruby32-object-regex-match-removal.patch deleted file mode 100644 index f8af034..0000000 --- a/vagrant-pr13034-ruby32-object-regex-match-removal.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 1dd089fc97e44066982cec62b8264dd03b1df531 Mon Sep 17 00:00:00 2001 -From: Mamoru TASAKA -Date: Tue, 20 Dec 2022 23:27:59 +0900 -Subject: [PATCH] ansible/provisioner_test: fix for ruby32 Kernel#=~ removal - -Kernel#=~ has done nothing and just has returned nil, and -now with ruby3.2 this deprecated method is removed. - -So for $ bundle exec rake under ruby 3.2, check if variable -really accepts =~ method first. - -Fixes #13028 . ---- - test/unit/plugins/provisioners/ansible/provisioner_test.rb | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/test/unit/plugins/provisioners/ansible/provisioner_test.rb b/test/unit/plugins/provisioners/ansible/provisioner_test.rb -index f5828f14340..15fb3bbdcf1 100644 ---- a/test/unit/plugins/provisioners/ansible/provisioner_test.rb -+++ b/test/unit/plugins/provisioners/ansible/provisioner_test.rb -@@ -91,7 +91,7 @@ def self.it_should_set_arguments_and_environment_variables( - expect(args[1]).to eq("--connection=ssh") - expect(args[2]).to eq("--timeout=30") - -- inventory_count = args.count { |x| x =~ /^--inventory-file=.+$/ } -+ inventory_count = args.count { |x| x.respond_to?(:=~) && x =~ /^--inventory-file=.+$/ } - expect(inventory_count).to be > 0 - - expect(args[args.length-2]).to eq("playbook.yml") -@@ -100,9 +100,9 @@ def self.it_should_set_arguments_and_environment_variables( - - it "sets --limit argument" do - expect(Vagrant::Util::Subprocess).to receive(:execute).with('ansible-playbook', any_args) { |*args| -- all_limits = args.select { |x| x =~ /^(--limit=|-l)/ } -+ all_limits = args.select { |x| x.respond_to?(:=~) && x =~ /^(--limit=|-l)/ } - if config.raw_arguments -- raw_limits = config.raw_arguments.select { |x| x =~ /^(--limit=|-l)/ } -+ raw_limits = config.raw_arguments.select { |x| x.respond_to?(:=~) && x =~ /^(--limit=|-l)/ } - expect(all_limits.length - raw_limits.length).to eq(1) - expect(all_limits.last).to eq(raw_limits.last) - else diff --git a/vagrant-pr13043-ruby32-object-regex-match-removal.patch b/vagrant-pr13043-ruby32-object-regex-match-removal.patch new file mode 100644 index 0000000..a78c2a1 --- /dev/null +++ b/vagrant-pr13043-ruby32-object-regex-match-removal.patch @@ -0,0 +1,41 @@ +From 9743c857481556838ee417a0033efdee3fb0c7fc Mon Sep 17 00:00:00 2001 +From: sophia +Date: Tue, 3 Jan 2023 13:20:14 -0800 +Subject: [PATCH 4/5] Only check for arguments matching test string if the + argument is a string + +This issue surfaced in the tests after updating to Ruby 3.2.0 where +the =~ operator has been removed. + +ref: https://github.com/ruby/ruby/blob/cca54c8b1b71072bb07850c9d3f20b261d3b312c/NEWS.md?plain=1#L498 +--- + test/unit/plugins/provisioners/ansible/provisioner_test.rb | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/test/unit/plugins/provisioners/ansible/provisioner_test.rb b/test/unit/plugins/provisioners/ansible/provisioner_test.rb +index f5828f14340..fdf9aa67eaa 100644 +--- a/test/unit/plugins/provisioners/ansible/provisioner_test.rb ++++ b/test/unit/plugins/provisioners/ansible/provisioner_test.rb +@@ -91,7 +91,7 @@ def self.it_should_set_arguments_and_environment_variables( + expect(args[1]).to eq("--connection=ssh") + expect(args[2]).to eq("--timeout=30") + +- inventory_count = args.count { |x| x =~ /^--inventory-file=.+$/ } ++ inventory_count = args.count { |x| x.match(/^--inventory-file=.+$/) if x.is_a?(String) } + expect(inventory_count).to be > 0 + + expect(args[args.length-2]).to eq("playbook.yml") +@@ -100,9 +100,9 @@ def self.it_should_set_arguments_and_environment_variables( + + it "sets --limit argument" do + expect(Vagrant::Util::Subprocess).to receive(:execute).with('ansible-playbook', any_args) { |*args| +- all_limits = args.select { |x| x =~ /^(--limit=|-l)/ } ++ all_limits = args.select { |x| x.match(/^(--limit=|-l)/) if x.is_a?(String) } + if config.raw_arguments +- raw_limits = config.raw_arguments.select { |x| x =~ /^(--limit=|-l)/ } ++ raw_limits = config.raw_arguments.select { |x| x.match(/^(--limit=|-l)/) if x.is_a?(String) } + expect(all_limits.length - raw_limits.length).to eq(1) + expect(all_limits.last).to eq(raw_limits.last) + else + +