Class: SexpCliTools::Cli

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

Instance Method Summary collapse

Instance Method Details

#find(requested_sexp_matcher, *matcher_params) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/sexp_cli_tools/cli.rb', line 13

def find(requested_sexp_matcher, *matcher_params)
  glob = options[:include]
  sexp_matcher = SexpCliTools::MATCHERS[requested_sexp_matcher]
  Pathname.glob(glob).each do |path|
    puts path.to_s if sexp_matcher.satisfy?(RubyParser.new.parse(path.read), *matcher_params)
  end
end