From 86154b4965ab7a5048c9e96702312c8479343cde Mon Sep 17 00:00:00 2001 From: Travis Yoder Date: Sun, 10 May 2015 19:58:16 -0600 Subject: [PATCH] =?UTF-8?q?Changes=20deprecated=20=E2=80=98File.exists?= =?UTF-8?q?=E2=80=99=20to=20=E2=80=98File.exist=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pry/commands/gem_readme.rb | 2 +- lib/pry/commands/play.rb | 2 +- lib/pry/repl_file_loader.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pry/commands/gem_readme.rb b/lib/pry/commands/gem_readme.rb index f08b5392..5e1ade40 100644 --- a/lib/pry/commands/gem_readme.rb +++ b/lib/pry/commands/gem_readme.rb @@ -12,7 +12,7 @@ class Pry::Command::GemReadme < Pry::ClassCommand spec = Gem::Specification.find_by_name(name) glob = File.join(spec.full_gem_path, 'README*') readme = Dir[glob][0] - if File.exists?(readme.to_s) + if File.exist?(readme.to_s) _pry_.pager.page File.read(readme) else raise Pry::CommandError, "Gem '#{name}' doesn't appear to have a README" diff --git a/lib/pry/commands/play.rb b/lib/pry/commands/play.rb index 5498d38d..65a66a63 100644 --- a/lib/pry/commands/play.rb +++ b/lib/pry/commands/play.rb @@ -91,7 +91,7 @@ class Pry end def file_content - if default_file && File.exists?(default_file) + if default_file && File.exist?(default_file) @cc.restrict_to_lines(File.read(default_file), @cc.line_range) else raise CommandError, "File does not exist! File was: #{default_file.inspect}" diff --git a/lib/pry/repl_file_loader.rb b/lib/pry/repl_file_loader.rb index cd8de9a1..e4296291 100644 --- a/lib/pry/repl_file_loader.rb +++ b/lib/pry/repl_file_loader.rb @@ -13,7 +13,7 @@ class Pry class REPLFileLoader def initialize(file_name) full_name = File.expand_path(file_name) - raise RuntimeError, "No such file: #{full_name}" if !File.exists?(full_name) + raise RuntimeError, "No such file: #{full_name}" if !File.exist?(full_name) define_additional_commands @content = File.read(full_name)