Class: Pronto::Punchlist::PatchInspector
- Inherits:
-
Object
- Object
- Pronto::Punchlist::PatchInspector
- Defined in:
- lib/pronto/punchlist/patch_inspector.rb
Overview
Inspects a patch and reports any relevant offenses
Instance Method Summary collapse
-
#initialize(punchlist_driver:, offense_matcher_class: OffenseMatcher) ⇒ PatchInspector
constructor
A new instance of PatchInspector.
- #inspect_patch(patch) ⇒ Object
Constructor Details
#initialize(punchlist_driver:, offense_matcher_class: OffenseMatcher) ⇒ PatchInspector
Returns a new instance of PatchInspector.
10 11 12 13 14 |
# File 'lib/pronto/punchlist/patch_inspector.rb', line 10 def initialize(punchlist_driver:, offense_matcher_class: OffenseMatcher) @punchlist_driver = punchlist_driver @offense_matcher_class = offense_matcher_class end |
Instance Method Details
#inspect_patch(patch) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pronto/punchlist/patch_inspector.rb', line 16 def inspect_patch(patch) path = patch.new_file_full_path offenses = @punchlist_driver.inspect_filename(path) = [] offenses.each do |offense| offense_matcher = @offense_matcher_class.new(offense) = offense_matcher.inspect_patch(patch) << unless .nil? end end |