Module: CodeOwnership::Private::ExtensionLoader

Extended by:
T::Sig
Defined in:
lib/code_ownership/private/extension_loader.rb

Overview

This class handles loading extensions to code_ownership using the ‘require` directive in the `code_ownership.yml` configuration.

Class Method Summary collapse

Class Method Details

.load(require_directive) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/code_ownership/private/extension_loader.rb', line 12

def load(require_directive)
  # We want to transform the require directive to behave differently
  # if it's a specific local file being required versus a gem
  if require_directive.start_with?('.')
    require File.join(Pathname.pwd, require_directive)
  else
    require require_directive
  end
end