Exception: Dependabot::DependencyFileNotParseable

Inherits:
DependabotError
  • Object
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) ⇒ DependencyFileNotParseable

Returns a new instance of DependencyFileNotParseable.



434
435
436
437
# File 'lib/dependabot/errors.rb', line 434

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

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



431
432
433
# File 'lib/dependabot/errors.rb', line 431

def file_path
  @file_path
end

Instance Method Details

#directoryObject



445
446
447
448
# File 'lib/dependabot/errors.rb', line 445

def directory
  # Directory should always start with a `/`
  T.must(file_path.split("/")[0..-2]).join("/").sub(%r{^/*}, "/")
end

#file_nameObject



440
441
442
# File 'lib/dependabot/errors.rb', line 440

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