Module: Packwerk::RailsLoadPaths

Extended by:
T::Sig
Defined in:
lib/packwerk/rails_load_paths.rb

Overview

Extracts the load paths from the analyzed application so that we can map constant names to paths.

Class Method Summary collapse

Class Method Details

.for(root, environment:) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/packwerk/rails_load_paths.rb', line 15

def for(root, environment:)
  require_application(root, environment)
  all_paths = extract_application_autoload_paths
  relevant_paths = filter_relevant_paths(all_paths)
  assert_load_paths_present(relevant_paths)
  relative_path_strings(relevant_paths)
end