Class: Mutineer::Project
- Inherits:
-
Object
- Object
- Mutineer::Project
- Defined in:
- lib/mutineer/project.rb
Overview
Subject discovery: parse each path and walk its AST for method definitions, tracking the enclosing class/module namespace.
Defined Under Namespace
Classes: SubjectVisitor
Class Method Summary collapse
-
.discover(paths, only: nil) ⇒ Object
Returns Array
.
Class Method Details
.discover(paths, only: nil) ⇒ Object
Returns Arrayonly filters by qualified name (string equality).
12 13 14 15 16 17 18 19 20 |
# File 'lib/mutineer/project.rb', line 12 def self.discover(paths, only: nil) subjects = Array(paths).flat_map do |path| result = Parser.parse_file(path) visitor = SubjectVisitor.new(path) visitor.visit(result.value) visitor.subjects end only ? subjects.select { |s| s.qualified_name == only } : subjects end |