Exception: Dependabot::DependencyFileNotFound

Inherits:
DependabotError show all
Defined in:
lib/dependabot/errors.rb

Overview

File level errors #

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.



82
83
84
85
# File 'lib/dependabot/errors.rb', line 82

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.



80
81
82
# File 'lib/dependabot/errors.rb', line 80

def file_path
  @file_path
end

Instance Method Details

#directoryObject



91
92
93
94
# File 'lib/dependabot/errors.rb', line 91

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

#file_nameObject



87
88
89
# File 'lib/dependabot/errors.rb', line 87

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