-
Notifications
You must be signed in to change notification settings - Fork 117
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 28, 2022
1 parent
2438399
commit 8c0691f
Showing
7 changed files
with
55 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