Project

rvnc

0.0
No commit activity in last 3 years
No release in over 3 years
Collect variable names
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0

Runtime

 Project Readme

RVNC

Ruby Variable Name Collector.

RVNC collects variable name by using RubyVM::AST.

Argument names don't supported.

require 'RUBY_VERSION >= 2.6.0preview2'

Installation

gem 'rvnc'

Or install it yourself as:

$ gem install rvnc

Usage

example.rb

$global = 'global'
foo = 1
bar = 'hi'
BAZ = :baz
a, *b = [1, 2, 3]

class A
  @@test = 'test'

  def initialize
    @name = 'test'
  end
end

run rvnc command

$ rvnc example.rb

result

+---------+---------------+
| Name    | Location      |
+---------+---------------+
| $global | example.rb:1  |
| foo     | example.rb:2  |
| bar     | example.rb:3  |
| BAZ     | example.rb:4  |
| a       | example.rb:5  |
| b       | example.rb:5  |
| @@test  | example.rb:8  |
| @name   | example.rb:11 |
+---------+---------------+

If you specify a directory path, it collects recursively.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Rvnc project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.