module Bundler::Security::Config::Fetcher

Class responsible for fetching the config from .coditsu.yml

Public Class Methods

call(build_path) click to toggle source

@param build_path [String] path of the current build @return [OpenStruct] open struct with config details @example

details = Fetcher.new.call('./')
details.build_path #=> './'
# File lib/bundler/security/config/fetcher.rb, line 15
def call(build_path)
  FileFinder
    .call(build_path)
    .then(&File.method(:read))
    .then(&ERB.method(:new))
    .then(&:result)
    .then(&YAML.method(:load))
    .then { |data| data.merge(build_path: build_path) }
    .then(&OpenStruct.method(:new))
end