Class: TestChanges::IgnoreExcludedFilesService
- Inherits:
-
Object
- Object
- TestChanges::IgnoreExcludedFilesService
- Defined in:
- lib/test_changes/ignore_excluded_files_service.rb
Instance Attribute Summary collapse
-
#exclusion_patterns ⇒ Object
readonly
Returns the value of attribute exclusion_patterns.
Instance Method Summary collapse
- #call(paths) ⇒ Object
-
#initialize(exclusion_patterns) ⇒ IgnoreExcludedFilesService
constructor
A new instance of IgnoreExcludedFilesService.
Constructor Details
#initialize(exclusion_patterns) ⇒ IgnoreExcludedFilesService
Returns a new instance of IgnoreExcludedFilesService.
5 6 7 |
# File 'lib/test_changes/ignore_excluded_files_service.rb', line 5 def initialize(exclusion_patterns) @exclusion_patterns = exclusion_patterns || [] end |
Instance Attribute Details
#exclusion_patterns ⇒ Object (readonly)
Returns the value of attribute exclusion_patterns.
3 4 5 |
# File 'lib/test_changes/ignore_excluded_files_service.rb', line 3 def exclusion_patterns @exclusion_patterns end |
Instance Method Details
#call(paths) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/test_changes/ignore_excluded_files_service.rb', line 9 def call(paths) matching_paths = exclusion_patterns.flat_map do |pattern| Pathname.glob(pattern) end paths - matching_paths.map(&:to_s) end |