Project

method-ray

0.0
No release in over 3 years
Method-Ray is a static analysis tool that checks the callability of methods in Ruby code. It uses graph-based type inference to detect undefined method calls at analysis time.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 3.0
 Project Readme

Method-Ray

A fast static callable method checker for Ruby code.

No type annotations required, just check callable methods in your Ruby files.

Requirements

Method-Ray supports Ruby 3.4 or later.

Installation

gem install methodray

Quick Start

VSCode Extension (under development)

  1. Install the Method-Ray VSCode extension
  2. Open a Ruby file in VSCode
  3. Errors will be highlighted automatically

CLI

# Check a single file
bundle exec methodray check app/models/user.rb

# Watch mode - auto re-check on file changes
bundle exec methodray watch app/models/user.rb

Example

methodray check <file>: Performs static type checking on the specified Ruby file.

class User
  def greeting
    name = "Alice"
    message = name.abs
    message
  end
end

This will output:

$ bundle exec methodray check app/models/user.rb
app/models/user.rb:4:19: error: undefined method `abs` for String
       message = name.abs
                     ^

Contributing

Bug reports and pull requests are welcome on GitHub at this repository!

License

MIT License. See LICENSE file for details.