class Pry::Command::ReloadCode

def check_for_reloadability(code_object, identifier)

def check_for_reloadability(code_object, identifier)
  if !code_object || !code_object.source_file
    raise CommandError, "Cannot locate #{identifier}!"
  end
  return if File.exist?(code_object.source_file)
  raise CommandError,
        "Cannot reload #{identifier} as it has no associated file on disk. " \
        "File found was: #{code_object.source_file}"
end