Exception: Dependabot::DependencyFileNotFound

Inherits:
DependabotError show all
Extended by:
T::Sig
Defined in:
lib/dependabot/errors.rb

Constant Summary

Constants inherited from DependabotError

Dependabot::DependabotError::BASIC_AUTH_REGEX, Dependabot::DependabotError::FURY_IO_PATH_REGEX

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path, msg = nil) ⇒ DependencyFileNotFound

Returns a new instance of DependencyFileNotFound.



406
407
408
409
# File 'lib/dependabot/errors.rb', line 406

def initialize(file_path, msg = nil)
  @file_path = file_path
  super(msg || "#{file_path} not found")
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



403
404
405
# File 'lib/dependabot/errors.rb', line 403

def file_path
  @file_path
end

Instance Method Details

#directoryObject



419
420
421
422
423
424
# File 'lib/dependabot/errors.rb', line 419

def directory
  # Directory should always start with a `/`
  return unless file_path

  T.must(T.must(file_path).split("/")[0..-2]).join("/").sub(%r{^/*}, "/")
end

#file_nameObject



412
413
414
415
416
# File 'lib/dependabot/errors.rb', line 412

def file_name
  return unless file_path

  T.must(file_path).split("/").last
end