Module: MethodRay::Commands

Defined in:
lib/methodray/commands.rb

Constant Summary collapse

COMMANDS_DIR =
__dir__

Class Method Summary collapse

Class Method Details

.check(args) ⇒ Object



29
30
31
# File 'lib/methodray/commands.rb', line 29

def check(args)
  exec_rust_cli('check', args)
end

.clear_cache(args) ⇒ Object



37
38
39
# File 'lib/methodray/commands.rb', line 37

def clear_cache(args)
  exec_rust_cli('clear-cache', args)
end

.helpObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/methodray/commands.rb', line 8

def help
  puts <<~HELP
    MethodRay v#{MethodRay::VERSION} - A fast static analysis tool for Ruby methods.

    Usage:
      methodray help                    # Show this help
      methodray version                 # Show version
      methodray check [FILE] [OPTIONS]  # Type check a Ruby file
      methodray watch FILE              # Watch file for changes and auto-check
      methodray clear-cache             # Clear RBS method cache

    Examples:
      methodray check app/models/user.rb
      methodray watch app/models/user.rb
  HELP
end

.versionObject



25
26
27
# File 'lib/methodray/commands.rb', line 25

def version
  puts "MethodRay v#{MethodRay::VERSION}"
end

.watch(args) ⇒ Object



33
34
35
# File 'lib/methodray/commands.rb', line 33

def watch(args)
  exec_rust_cli('watch', args)
end