Class: Pronto::BigFiles

Inherits:
Runner
  • Object
show all
Defined in:
lib/pronto/bigfiles.rb,
lib/pronto/bigfiles/patch_wrapper.rb,
lib/pronto/bigfiles/message_creator.rb,
lib/pronto/bigfiles/patch_inspector.rb

Overview

Performs incremental quality reporting for the bigfiles gem

Defined Under Namespace

Classes: Error, MessageCreator, PatchInspector, PatchWrapper

Instance Method Summary collapse

Constructor Details

#initialize(patches, commit = nil, bigfiles_config: ::BigFiles::Config.new, bigfiles_inspector: ::BigFiles::Inspector.new, bigfiles_results: bigfiles_inspector.find_and_analyze, patch_wrapper_class: PatchWrapper, patch_inspector: PatchInspector.new(bigfiles_results, bigfiles_config: bigfiles_config)) ⇒ BigFiles

Returns a new instance of BigFiles.



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/pronto/bigfiles.rb', line 13

def initialize(patches, commit = nil,
               bigfiles_config: ::BigFiles::Config.new,
               bigfiles_inspector: ::BigFiles::Inspector.new,
               bigfiles_results: bigfiles_inspector.find_and_analyze,
               patch_wrapper_class: PatchWrapper,
               patch_inspector: PatchInspector.new(bigfiles_results,
                                                   bigfiles_config:
                                                     bigfiles_config))
  super(patches, commit)
  @patch_inspector = patch_inspector
  @patch_wrapper_class = patch_wrapper_class
end

Instance Method Details

#inspect_patch(patch) ⇒ Object



31
32
33
# File 'lib/pronto/bigfiles.rb', line 31

def inspect_patch(patch)
  @patch_inspector.inspect_patch(@patch_wrapper_class.new(patch))
end

#runObject



27
28
29
# File 'lib/pronto/bigfiles.rb', line 27

def run
  @patches.flat_map { |patch| inspect_patch(patch) }
end