Class: RailsAiBridge::Doctor::Checkers::RipgrepChecker

Inherits:
BaseChecker
  • Object
show all
Defined in:
lib/rails_ai_bridge/doctor/checkers/ripgrep_checker.rb

Overview

Verifies +rg+ is available on +PATH+ for fast code search.

Instance Attribute Summary

Attributes inherited from BaseChecker

#app

Instance Method Summary collapse

Methods inherited from BaseChecker

#initialize

Constructor Details

This class inherits a constructor from RailsAiBridge::Doctor::Checkers::BaseChecker

Instance Method Details

#callDoctor::Check

Returns +:pass+ when +rg+ is found; +:warn+ otherwise.

Returns:

  • (Doctor::Check)

    +:pass+ when +rg+ is found; +:warn+ otherwise



9
10
11
12
13
14
15
16
17
# File 'lib/rails_ai_bridge/doctor/checkers/ripgrep_checker.rb', line 9

def call
  check(
    'ripgrep',
    system('which rg > /dev/null 2>&1'),
    pass: { message: 'rg available for code search' },
    fail: { status: :warn, message: 'ripgrep not installed (code search will use slower Ruby fallback)',
            fix: 'Install with `brew install ripgrep` or `apt install ripgrep`' }
  )
end