Class: RuboCop::Cop::Cask::Variables

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector, Forwardable
Includes:
CaskHelp
Defined in:
rubocops/cask/variables.rb

Overview

This cop audits variables in casks.

Examples:

# bad
cask do
  arch = Hardware::CPU.intel? ? "darwin" : "darwin-arm64"
end

# good
cask 'foo' do
  arch arm: "darwin-arm64", intel: "darwin"
end

Instance Method Summary collapse

Methods included from CaskHelp

#on_block

Instance Method Details

#on_cask(cask_block) ⇒ Object



26
27
28
29
# File 'rubocops/cask/variables.rb', line 26

def on_cask(cask_block)
  @cask_block = cask_block
  add_offenses
end