Module: Reviewer::Setup
- Defined in:
- lib/reviewer/setup.rb,
lib/reviewer/setup/catalog.rb,
lib/reviewer/setup/detector.rb,
lib/reviewer/setup/formatter.rb,
lib/reviewer/setup/generator.rb,
lib/reviewer/setup/tool_block.rb,
lib/reviewer/setup/gemfile_lock.rb
Overview
Handles first-run setup: detecting tools and generating .reviewer.yml
Defined Under Namespace
Modules: Catalog Classes: Detector, Formatter, GemfileLock, Generator, ToolBlock
Constant Summary collapse
- CONFIG_URL =
URL to the configuration documentation for setup output messages
'https://github.com/garrettdimon/reviewer/blob/main/docs/configuration.md'- DEPRECATION_WARNING =
'Warning: rvw init is deprecated. ' \ 'Run rvw doctor to inspect project discoveries before creating .reviewer.yml.'
Class Method Summary collapse
-
.run(configuration:, project_dir: Pathname.pwd, output: Output.new) ⇒ void
Runs the full setup flow: detect tools, generate config, display results.
Class Method Details
.run(configuration:, project_dir: Pathname.pwd, output: Output.new) ⇒ void
This method returns an undefined value.
Runs the full setup flow: detect tools, generate config, display results
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/reviewer/setup.rb', line 22 def self.run(configuration:, project_dir: Pathname.pwd, output: Output.new) warn DEPRECATION_WARNING config_file = configuration.file formatter = Formatter.new(output) if config_file.exist? formatter.setup_already_exists(config_file) return end results = Detector.new(project_dir).detect if results.empty? formatter.setup_no_tools_detected return end yaml = Generator.new(results.map(&:key), project_dir: project_dir).generate config_file.write(yaml) formatter.setup_success(results) end |