Class: RuboCop::AST::Node Private
- Includes:
- Cask::Constants
- Defined in:
- rubocops/cask/extend/node.rb,
rubocops/cask/extend/node.rbi
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Direct Known Subclasses
Constant Summary
Constants included from Cask::Constants
Cask::Constants::ON_SYSTEM_METHODS, Cask::Constants::ON_SYSTEM_METHODS_STANZA_ORDER, Cask::Constants::STANZA_GROUPS, Cask::Constants::STANZA_GROUP_HASH, Cask::Constants::STANZA_ORDER, Cask::Constants::UNINSTALL_METHODS_ORDER
Instance Method Summary collapse
- #arch_variable? ⇒ Boolean private
- #begin_block? ⇒ Boolean private
- #block_body ⇒ RuboCop::AST::Node? private
- #cask_block? ⇒ Boolean private
- #cask_on_system_block? ⇒ Boolean private
- #heredoc? ⇒ Boolean private
- #location_expression ⇒ Parser::Source::Range private
- #method_node ⇒ RuboCop::AST::SendNode? private
- #on_system_block? ⇒ Boolean private
- #stanza? ⇒ Boolean private
- #system_variable? ⇒ Boolean private
Instance Method Details
#arch_variable? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
17 |
# File 'rubocops/cask/extend/node.rbi', line 17 def arch_variable?; end |
#begin_block? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
23 |
# File 'rubocops/cask/extend/node.rbi', line 23 def begin_block?; end |
#block_body ⇒ RuboCop::AST::Node?
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
8 |
# File 'rubocops/cask/extend/node.rbi', line 8 def block_body; end |
#cask_block? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
11 |
# File 'rubocops/cask/extend/node.rbi', line 11 def cask_block?; end |
#cask_on_system_block? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
20 21 22 |
# File 'rubocops/cask/extend/node.rb', line 20 def cask_on_system_block? (on_system_block? && each_ancestor.any?(&:cask_block?)) || false end |
#heredoc? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
37 38 39 |
# File 'rubocops/cask/extend/node.rb', line 37 def heredoc? loc.is_a?(Parser::Source::Map::Heredoc) end |
#location_expression ⇒ Parser::Source::Range
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
42 43 44 45 46 47 |
# File 'rubocops/cask/extend/node.rb', line 42 def location_expression base_expression = loc.expression descendants.select(&:heredoc?).reduce(base_expression) do |expr, node| expr.join(node.loc.heredoc_end) end end |
#method_node ⇒ RuboCop::AST::SendNode?
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
5 |
# File 'rubocops/cask/extend/node.rbi', line 5 def method_node; end |
#on_system_block? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
14 |
# File 'rubocops/cask/extend/node.rbi', line 14 def on_system_block?; end |
#stanza? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
25 26 27 28 29 30 31 32 33 34 |
# File 'rubocops/cask/extend/node.rb', line 25 def stanza? return true if arch_variable? return true if system_variable? case self when RuboCop::AST::BlockNode, RuboCop::AST::SendNode ON_SYSTEM_METHODS.include?(method_name) || STANZA_ORDER.include?(method_name) else false end end |
#system_variable? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
20 |
# File 'rubocops/cask/extend/node.rbi', line 20 def system_variable?; end |