diff --git a/examples/WhatAQuietStiff.rb b/examples/WhatAQuietStiff.rb index d87da665c059d808676f121638f4a149f0429a90..5b0318dd40a6bca5460857a9a03e48eab002c21d 100755 --- a/examples/WhatAQuietStiff.rb +++ b/examples/WhatAQuietStiff.rb @@ -134,7 +134,7 @@ class WhatAQuietWindow < FXMainWindow saveDialog = FXFileDialog.new(self, "Save Image") saveDialog.filename = @itemList.getItemText(@itemList.currentItem) if saveDialog.execute != 0 - if File.exists? saveDialog.filename + if File.exist? saveDialog.filename if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, "Overwrite Image", "Overwrite existing image?") return 1 diff --git a/examples/imageviewer.rb b/examples/imageviewer.rb index 85ece9b3c63102410b55fe3d2a6c632cf0ca177a..3961e7f3b7d656c858fd9c738c1e47ea0a9505f6 100755 --- a/examples/imageviewer.rb +++ b/examples/imageviewer.rb @@ -326,7 +326,7 @@ class ImageWindow < FXMainWindow def onCmdSave(sender, sel, ptr) saveDialog = FXFileDialog.new(self, "Save Image") if saveDialog.execute != 0 - if File.exists? saveDialog.filename + if File.exist? saveDialog.filename if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, "Overwrite Image", "Overwrite existing image?") return 1 diff --git a/examples/textedit/textedit.rb b/examples/textedit/textedit.rb index 75cf6345eb3596a5d496519da708461b57318563..f503a41a351981a24d2b53fa13ec945a7135ee7f 100755 --- a/examples/textedit/textedit.rb +++ b/examples/textedit/textedit.rb @@ -1025,7 +1025,7 @@ class TextWindow < FXMainWindow return false if (savedialog.execute == 0) setCurrentPattern(savedialog.currentPattern) file = savedialog.filename - if File.exists?(file) + if File.exist?(file) if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, "Overwrite Document", "Overwrite existing document: #{file}?") return false @@ -1092,7 +1092,7 @@ class TextWindow < FXMainWindow if savedialog.execute != 0 setCurrentPattern(savedialog.currentPattern) file = savedialog.filename - if File.exists?(file) + if File.exist?(file) if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, "Overwrite Document", "Overwrite existing document: #{file}?") return 1 @@ -1134,24 +1134,24 @@ class TextWindow < FXMainWindow # Attempt to extract the file name from various forms if string =~ /#include \".*\"/ file = File.expand_path(name, dir) - if !File.exists?(file) + if !File.exist?(file) Find.find(@searchpath) { |f| file = f if (f == name) } end elsif string =~ /#include <.*>/ file = File.expand_path(name, dir) - if !File.exists?(file) + if !File.exist?(file) Find.find(@searchpath) { |f| file = f if (f == name) } end elsif string =~ /.*:.*:.*/ file = File.expand_path(name, dir) - if !File.exists?(file) + if !File.exist?(file) Find.find(@searchpath) { |f| file = f if (f == name) } end else file = File.expand_path(string, dir) end - if File.exists?(file) + if File.exist?(file) # Different from current file? if file != @filename # Save old file first @@ -1213,7 +1213,7 @@ class TextWindow < FXMainWindow if savedialog.execute != 0 setCurrentPattern(savedialog.currentPattern) file = savedialog.filename - if File.exists?(file) + if File.exist?(file) if MBOX_CLICKED_NO == FXMessageBox.question(self, MBOX_YES_NO, "Overwrite Document", "Overwrite existing document: #{file}?") return 1 @@ -1690,7 +1690,7 @@ class TextWindow < FXMainWindow # Update box for readonly display def onCheckFile(sender, sel, ptr) - mtime = File.exists?(@filename) ? File.mtime(@filename) : nil + mtime = File.exist?(@filename) ? File.mtime(@filename) : nil if @filetime && mtime && mtime != @filetime @filetime = mtime if MBOX_CLICKED_OK == FXMessageBox.warning(self, MBOX_OK_CANCEL, diff --git a/test/TC_FXDCPrint.rb b/test/TC_FXDCPrint.rb index 46b2b4d40d17243959ee6cd5ab6e6ce01191cc50..d24af26a2b726004f4a2c8f705a63a75b6caf237 100755 --- a/test/TC_FXDCPrint.rb +++ b/test/TC_FXDCPrint.rb @@ -95,7 +95,7 @@ public end def teardown - if File.exists?("output.ps") + if File.exist?("output.ps") FileUtils.rm_f("output.ps") end end diff --git a/test/TC_FXFileStream.rb b/test/TC_FXFileStream.rb index 0f666b858b045d73926b67f4b71e470633d34b8f..818fc4b1c67e8de1a215f348535b950382c1b70e 100755 --- a/test/TC_FXFileStream.rb +++ b/test/TC_FXFileStream.rb @@ -82,7 +82,7 @@ class TC_FXFileStream < Test::Unit::TestCase end def teardown - if File.exists?("goobers") + if File.exist?("goobers") FileUtils.rm_f("goobers") end end