https://github.com/rmosolgo/ripper_locals
Find local variables in a method using Ripper
https://github.com/rmosolgo/ripper_locals
Last synced: 3 months ago
JSON representation
Find local variables in a method using Ripper
- Host: GitHub
- URL: https://github.com/rmosolgo/ripper_locals
- Owner: rmosolgo
- Created: 2018-05-21T14:29:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-21T14:30:17.000Z (over 7 years ago)
- Last Synced: 2025-10-06T14:49:44.647Z (3 months ago)
- Language: Ruby
- Size: 1000 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Ripper Locals
A Ripper-based parser to determine the local variables in a method. Find locals from:
- Method parameters
- Local assigns
- Exclude block-scoped locals
## Example
```ruby
# locals: a, b, c, d, e, f
def do_stuff(a, *b)
c = a + b
x.each { |y| z = y }
d = c + 1
e, *f = d
end
```
See `test.rb` for more.
## Develop
- Deps: `gem install minitest`
- Tests: `ruby test.rb`