-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alex Evanczuk
committed
Oct 27, 2022
1 parent
7a4c18c
commit 53c259e
Showing
7 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
module Packwerk | ||
# This class handles loading extensions to packwerk using the `require` directive | ||
# in the `packwerk.yml` configuration. | ||
class ExtensionLoader | ||
class << self | ||
extend T::Sig | ||
sig { params(require_directive: String, config_dir_path: String).void } | ||
def load(require_directive, config_dir_path) | ||
# 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(config_dir_path, require_directive) | ||
else | ||
require require_directive | ||
end | ||
end | ||
end | ||
end | ||
|
||
private_constant :ExtensionLoader | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module MySpecialExtension | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ include: | |
exclude: | ||
- "**/temp.rb" | ||
parallel: false | ||
require: | ||
- ./config/my_extension.rb | ||
- pathname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters