Skip to content

Commit

Permalink
refactor: simply replace usage of File.exists? by File.exist?
Browse files Browse the repository at this point in the history
  • Loading branch information
matmorel authored and AaronC81 committed May 2, 2023
1 parent 552cc35 commit 2ece5ab
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/sord/resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ def self.load_gem_objects(hash)
end
add_rbs_objects_to_paths(all_decls, hash)

file_exist = RUBY_VERSION[0].to_i > 2 ? :exist? : :exists?
gem_paths = Bundler.load.specs.map(&:full_gem_path)
gem_paths.each do |path|
next unless File.method(file_exist).call("#{path}/rbi")
next unless File.exist?("#{path}/rbi")

Dir["#{path}/rbi/**/*.rbi"].each do |sigfile|
tree = Parlour::TypeLoader.load_file(sigfile)
Expand Down

0 comments on commit 2ece5ab

Please sign in to comment.