Sha256: 49f94e7440c1b9e8d63ab30330884d0aec6fd924faed1ad52b123407f6daf8c8

Contents?: true

Size: 505 Bytes

Versions: 1

Compression:

Stored size: 505 Bytes

Contents

# frozen_string_literal: true

require 'rvnc/source_file'
require 'rvnc/version'

module RVNC
  VARIABLE_NODES = %w[
    NODE_CDECL
    NODE_CVASGN
    NODE_DASGN_CURR
    NODE_GASGN
    NODE_IASGN
    NODE_MASGN
  ].freeze

  def self.collect(root)
    if File.directory?(root)
      Dir.glob("#{root}/**/*.rb").map do |path|
        variables(path)
      end.flatten
    else
      variables(root)
    end
  end

  def self.variables(path)
    SourceFile.new(File.expand_path(path)).variables
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rvnc-0.0.1 lib/rvnc.rb