Sha256: e4e445c75efc0d7e387213b9c43f894a7b71c9f0e90aba48be67ea74b8a39080
Contents?: true
Size: 989 Bytes
Versions: 47
Compression:
Stored size: 989 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Legacy # Legacy support for Corrector#corrections # See https://docs.rubocop.org/rubocop/cop_api_v1_changelog.html class CorrectionsProxy def initialize(corrector) @corrector = corrector end def <<(callable) suppress_clobbering { @corrector.transaction { callable.call(@corrector) } } end def empty? @corrector.empty? end def concat(corrections) if corrections.is_a?(CorrectionsProxy) suppress_clobbering { corrector.merge!(corrections.corrector) } else corrections.each { |correction| self << correction } end end protected attr_reader :corrector private def suppress_clobbering yield rescue ::Parser::ClobberingError # ignore Clobbering errors end end end end end
Version data entries
47 entries across 45 versions & 6 rubygems