mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Changes deprecated ‘File.exists’ to ‘File.exist’
This commit is contained in:
parent
c47d566390
commit
86154b4965
3 changed files with 3 additions and 3 deletions
|
@ -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"
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue