Skip to content

Commit a94db64

Browse files
committed
(PUP-11634) Call exist? instead of exists?
File.exists? and Dir.exists? were removed in Ruby 3.2
1 parent b84fc77 commit a94db64

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Guardfile.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ notification(:terminal_notifier, app_name: "Puppet ::", group: `pwd`.chomp) if `
1616

1717
## Uncomment and set this to only include directories you want to watch
1818
# directories %w(app lib config test spec features) \
19-
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
19+
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
2020

2121
## Note: if you are using the `directories` clause above and you are not
2222
## watching the project directory ('.'), then you will want to move

acceptance/Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ group(:test) do
3030
gem "mocha", "~> 0.10.5", :require => false
3131
end
3232

33-
if File.exists? "#{__FILE__}.local"
33+
if File.exist? "#{__FILE__}.local"
3434
eval(File.read("#{__FILE__}.local"), binding)
3535
end

acceptance/tests/environment/custom_type_provider_from_same_environment.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def destroy
5353
File.unlink(@resource[:name])
5454
end
5555
def exists?
56-
File.exists?(@resource[:name])
56+
File.exist?(@resource[:name])
5757
end
5858
end
5959
PROVIDER

ext/windows/service/daemon.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def service_main(*argsv)
4848
#
4949
# Example code to register an event source;
5050
# eventlogdll = File.expand_path(File.join(basedir, 'puppet', 'ext', 'windows', 'eventlog', 'puppetres.dll'))
51-
# if (File.exists?(eventlogdll))
51+
# if (File.exist?(eventlogdll))
5252
# Win32::EventLog.add_event_source(
5353
# 'source' => "Application",
5454
# 'key_name' => "Puppet Agent",

spec/integration/application/agent_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def with_another_agent_running(&block)
527527
}
528528

529529
# ensure file is written before yielding
530-
until File.exists?(path) && File.size(path) > 0 do
530+
until File.exist?(path) && File.size(path) > 0 do
531531
sleep 0.1
532532
end
533533

0 commit comments

Comments
 (0)