Module: RuboCop::Cop::Cask::CaskHelp

Included in:
HomepageMatchesUrl, NoDslVersion, OnDescStanza, OnHomepageStanza, StanzaGrouping, StanzaOrder
Defined in:
Library/Homebrew/rubocops/cask/mixin/cask_help.rb

Overview

Common functionality for cops checking casks.

Instance Method Summary collapse

Instance Method Details

#on_block(block_node) ⇒ Object


9
10
11
12
13
14
15
16
17
# File 'Library/Homebrew/rubocops/cask/mixin/cask_help.rb', line 9

def on_block(block_node)
  super if defined? super
  return unless respond_to?(:on_cask)
  return unless block_node.cask_block?

  comments = processed_source.comments
  cask_block = RuboCop::Cask::AST::CaskBlock.new(block_node, comments)
  on_cask(cask_block)
end