Class: Dependabot::Bazel::FileFetcher::PathConverter

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/bazel/file_fetcher/path_converter.rb

Overview

Converts Bazel label syntax to filesystem paths

Class Method Summary collapse

Class Method Details

.label_to_path(label, context_dir: nil) ⇒ Object



15
16
17
18
19
20
# File 'lib/dependabot/bazel/file_fetcher/path_converter.rb', line 15

def self.label_to_path(label, context_dir: nil)
  path = strip_external_repo_prefix(label)
  return resolve_relative_path(path, context_dir) if relative_path?(path)

  convert_absolute_label_to_path(path)
end

.normalize_path(path) ⇒ Object



28
29
30
# File 'lib/dependabot/bazel/file_fetcher/path_converter.rb', line 28

def self.normalize_path(path)
  remove_leading_dot_slash(path)
end

.should_filter_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/dependabot/bazel/file_fetcher/path_converter.rb', line 23

def self.should_filter_path?(path)
  absolute_path_or_url?(path)
end