Module: Diffend::Config::FileFinder
- Defined in:
- lib/diffend/config/file_finder.rb
Overview
Class used to figure out the file from which we should load the settings
Class Method Summary collapse
-
.call(build_path) ⇒ String
Looks for Diffend settings file for a given env.
Class Method Details
.call(build_path) ⇒ String
Looks for Diffend settings file for a given env
27 28 29 30 31 32 33 34 |
# File 'lib/diffend/config/file_finder.rb', line 27 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 |