Exception: Dependabot::DependencyFileNotParseable

Inherits:
DependabotError
  • Object
show all
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.



97
98
99
100
# File 'lib/dependabot/errors.rb', line 97

def initialize(file_path, msg = nil)
  @file_path = file_path
  super(msg)
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



95
96
97
# File 'lib/dependabot/errors.rb', line 95

def file_path
  @file_path
end

Instance Method Details

#directoryObject



106
107
108
109
# File 'lib/dependabot/errors.rb', line 106

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

#file_nameObject



102
103
104
# File 'lib/dependabot/errors.rb', line 102

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