-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User can use
include: []
instead of modules
- Loading branch information
Showing
9 changed files
with
114 additions
and
124 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 was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
lib/diver_down/trace/module_set/const_source_location_module_set.rb
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,28 @@ | ||
# frozen_string_literal: true | ||
|
||
module DiverDown | ||
module Trace | ||
class ModuleSet | ||
class ConstSourceLocationModuleSet | ||
# @param [Array<String>, Set<String>] include | ||
def initialize(include: []) | ||
@include = include.to_set | ||
end | ||
|
||
# @param [Module] mod | ||
# @return [Boolean] | ||
def include?(mod) | ||
module_name = DiverDown::Helper.normalize_module_name(mod) | ||
|
||
path, = begin | ||
Object.const_source_location(module_name) | ||
rescue NameError, TypeError | ||
nil | ||
end | ||
|
||
path && @include.include?(path) | ||
end | ||
end | ||
end | ||
end | ||
end |
43 changes: 0 additions & 43 deletions
43
lib/diver_down/trace/module_set/const_source_location_strategy.rb
This file was deleted.
Oops, something went wrong.
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