Class: ASTUtils::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/ast_utils/cli.rb

Instance Method Summary collapse

Instance Method Details

#label(*scripts) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/ast_utils/cli.rb', line 6

def label(*scripts)
  scripts.map {|script| Pathname(script) }.each do |path|
    puts "Parsing #{path}..."
    node = Parser::Ruby25.parse(path.read, path.to_s)
    puts "Translating node..."
    labeled = Labeling.translate(node: node)
    puts "#{labeled.inspect}"
  end
end