rubocop
https://github.com/bbatsov/rubocop
Ruby
A Ruby static code analyzer, based on the community Ruby style guide.
RuboCop::NodePattern::Macros#def_node_search
Define a method which recurses over the descendants of an AST node, checking whether any of them match the provided pattern If the method name ends with '?', the new method will return `true` as soon as it finds a descendant which matches. Otherwise, it will yield all descendants which match.
Edit
git clone [email protected]:bbatsov/rubocop.git
cd rubocop
open lib/rubocop/node_pattern.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-RuboCop--NodePattern--Macros-def_node_search-for-pr
# Commit to gitgit add lib/rubocop/node_pattern.rbgit commit -m "better docs for RuboCop::NodePattern::Macros#def_node_search"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-RuboCop--NodePattern--Macros-def_node_search-for-pr
hub pull-request
# Celebrate!