Sha256: f87c61b3bf25966393e5f87aa14a325ad2da0d77e245834ec613cded02b95c5a

Contents?: true

Size: 603 Bytes

Versions: 1

Compression:

Stored size: 603 Bytes

Contents

require "pry"
require "parser/current"

require "ast_search/version"
require "ast_search/name_path"
require "ast_search/node"
require "ast_search/queries/class_defs"
require "ast_search/queries/const_occurrences"
require "ast_search/queries/external_classes"

module AstSearch
  def self.parse(src)
    Parser::CurrentRuby.parse(src)
  end

  #
  # Public API
  #

  def self.find_external_classes(src)
    ast = parse(src)
    AstSearch::Queries::ExternalClasses.new.call(ast)
  end

  def self.find_class_definitions(src)
    ast = parse(src)
    AstSearch::Queries::ClassDefs.new.call(ast)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ast_search-0.2.0 lib/ast_search.rb