Module: Diffend::Configs::Fetcher

Defined in:
lib/diffend/configs/fetcher.rb

Overview

Class responsible for fetching the config from .diffend.yml

Class Method Summary collapse

Class Method Details

.call(logger, plugin_path, build_path) ⇒ Hash

Returns details from configuration file.

Examples:

details = Fetcher.new.call('./')
details.build_path #=> './'

Parameters:

  • logger (Diffend::Logger)
  • plugin_path (String)

    path of the plugin

  • build_path (String)

    path of the current build

Returns:

  • (Hash)

    details from configuration file



23
24
25
26
27
28
29
30
# File 'lib/diffend/configs/fetcher.rb', line 23

def call(logger, plugin_path, build_path)
  build(plugin_path, build_path)
rescue Errors::MalformedConfigurationFile
  build_malformed_error_message(build_path)
    .tap(&logger.method(:fatal))

  raise Diffend::Errors::HandledException
end