IMGKit icon indicating copy to clipboard operation
IMGKit copied to clipboard

Fix `File.exists?` deprecation warning. Use `File.exist?` instead

Open techeverri opened this issue 3 years ago • 1 comments

Fixes https://github.com/csquared/IMGKit/issues/127

techeverri avatar Jun 02 '22 12:06 techeverri

Also closes https://github.com/csquared/IMGKit/pull/126

techeverri avatar Jun 03 '22 13:06 techeverri

+1

brunohq avatar Mar 16 '23 00:03 brunohq

Hello @techeverri @csquared, is it possible de merge this pull request? Or, is there another version I can use somewhere that fixes the File.exists? deprecation issue? Thanks.

nicolrx avatar Apr 03 '23 11:04 nicolrx

You can monkey patch the File class in your project so that it calls internally File#exist? ^1 instead of File#exists? which should stop the warning. Although monkey patching is not recommended ^2 so use it with caution.


# TODO: remove this monkey patch once https://github.com/csquared/IMGKit/pull/128 is merged
class File
  class << self
    def exists?(file_name)
      exist?(file_name)
    end
  end
end

techeverri avatar Apr 03 '23 15:04 techeverri

Hello @techeverri @csquared, when can we expect this to be merged? TIA

priscilla-diff avatar May 19 '23 16:05 priscilla-diff

1.6.3 has just been published! Thanks :)

csquared avatar May 25 '23 21:05 csquared