module Reviewer
Primary interface for the reviewer tools
Constants
- VERSION
Public Class Methods
The collection of arguments that were passed via the command line.
@return [Reviewer::Arguments] exposes tags, files, and keywords from arguments
# File lib/reviewer.rb, line 55 def arguments @arguments ||= Arguments.new end
Exposes the configuration options for Reviewer
.
@return [Reviewer::Configuration] configuration settings instance
# File lib/reviewer.rb, line 85 def configuration @configuration ||= Configuration.new end
Runs the `format` command for the specified tools/files for which it is configured. @param clear_streen [boolean] clears the screen to reduce noise when true
@return [void] Prints output to the console
# File lib/reviewer.rb, line 48 def format(clear_screen: false) perform(:format, clear_screen: clear_screen) end
A file store for sharing information across runs
@return [Reviewer::History] a YAML::Store (or Pstore) containing data on tools
# File lib/reviewer.rb, line 78 def history @history ||= History.new end
The primary output method for Reviewer
to consistently display success/failure details for a unique run of each tool and the collective summary when relevant.
@return [Reviewer::Output] prints formatted output to the console.
# File lib/reviewer.rb, line 71 def output @output ||= Output.new end
Resets the loaded tools
# File lib/reviewer.rb, line 31 def reset! @tools = nil end
Runs the `review` command for the specified tools/files. Reviewer
expects all configured commands that are not disabled to have an entry for the `review` command. @param clear_streen [boolean] clears the screen to reduce noise when true
@return [void] Prints output to the console
# File lib/reviewer.rb, line 40 def review(clear_screen: false) perform(:review, clear_screen: clear_screen) end
An interface for the collection of configured tools for accessing subsets of tools based on enabled/disabled, tags, keywords, etc.
@return [Reviewer::Tools] exposes the set of tools to be run in a given context
# File lib/reviewer.rb, line 63 def tools @tools ||= Tools.new end
Private Class Methods
Provides a consistent approach to running and benchmarking commmands and preventing further execution of later tools if a command fails. @param command_type [Symbol] the specific command to run for each tool
@example Run the `review` command for each relevant tool
perform(:review)
@return [Hash] the exit status (in integer format) for each command run
# File lib/reviewer.rb, line 111 def perform(command_type, clear_screen: false) system('clear') if clear_screen results = Batch.run(command_type, tools.current) # Return the largest exit status exit results.values.max end