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

Included in:
HomepageMatchesUrl, NoDslVersion, OnHomepageStanza, StanzaGrouping, StanzaOrder
Defined in:
brew/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



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

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