Module: Bundler::Security::Config::FileFinder

Defined in:
lib/bundler/security/config/file_finder.rb

Overview

Class used to figure out the file from which we should load the settings

Class Method Summary collapse

Class Method Details

.call(build_path) ⇒ String

Looks for coditsu settings file for a given env

Parameters:

  • build_path (String)

    path of the current build

Returns:

  • (String)

    path to the file from which we should load all the settings



31
32
33
34
35
36
37
38
# File 'lib/bundler/security/config/file_finder.rb', line 31

def call(build_path)
  FILE_NAMES
    .map { |name| File.join(build_path, name) }
    .map { |name| Dir[name] }
    .find { |selection| !selection.empty? }
    .tap { |path| path || raise(Errors::MissingConfigurationFile) }
    .first
end