Skip to content

Commit

Permalink
(PUP-11634) Call exist? instead of exists?
Browse files Browse the repository at this point in the history
File.exists? and Dir.exists? were removed in Ruby 3.2
  • Loading branch information
joshcooper committed Dec 8, 2022
1 parent b84fc77 commit a94db64
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Guardfile.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ notification(:terminal_notifier, app_name: "Puppet ::", group: `pwd`.chomp) if `

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

## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
Expand Down
2 changes: 1 addition & 1 deletion acceptance/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ group(:test) do
gem "mocha", "~> 0.10.5", :require => false
end

if File.exists? "#{__FILE__}.local"
if File.exist? "#{__FILE__}.local"
eval(File.read("#{__FILE__}.local"), binding)
end
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def destroy
File.unlink(@resource[:name])
end
def exists?
File.exists?(@resource[:name])
File.exist?(@resource[:name])
end
end
PROVIDER
Expand Down
2 changes: 1 addition & 1 deletion ext/windows/service/daemon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def service_main(*argsv)
#
# Example code to register an event source;
# eventlogdll = File.expand_path(File.join(basedir, 'puppet', 'ext', 'windows', 'eventlog', 'puppetres.dll'))
# if (File.exists?(eventlogdll))
# if (File.exist?(eventlogdll))
# Win32::EventLog.add_event_source(
# 'source' => "Application",
# 'key_name' => "Puppet Agent",
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/application/agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def with_another_agent_running(&block)
}

# ensure file is written before yielding
until File.exists?(path) && File.size(path) > 0 do
until File.exist?(path) && File.size(path) > 0 do
sleep 0.1
end

Expand Down

0 comments on commit a94db64

Please sign in to comment.