Sha256: 5cbf5f669925ef64b1bc2a705df98359e7bb9e7e0bef3dd4ef5a44775060c1af

Contents?: true

Size: 804 Bytes

Versions: 171

Compression:

Stored size: 804 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Legacy
      # Legacy Corrector for v0 API support.
      # See https://docs.rubocop.org/rubocop/v1_upgrade_notes.html
      class Corrector < RuboCop::Cop::Corrector
        # Support legacy second argument
        def initialize(source, corr = [])
          super(source)
          if corr.is_a?(CorrectionsProxy)
            merge!(corr.send(:corrector))
          else
            # warn "Corrector.new with corrections is deprecated." unless corr.empty? TODO
            corr.each { |c| corrections << c }
          end
        end

        def corrections
          # warn "#corrections is deprecated. Open an issue if you have a valid usecase." TODO
          CorrectionsProxy.new(self)
        end
      end
    end
  end
end

Version data entries

171 entries across 166 versions & 17 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rubocop-1.64.1/lib/rubocop/cop/legacy/corrector.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/legacy/corrector.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/legacy/corrector.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/legacy/corrector.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/rubocop-1.64.1/lib/rubocop/cop/legacy/corrector.rb
rubocop-1.64.1 lib/rubocop/cop/legacy/corrector.rb
rubocop-1.63.4 lib/rubocop/cop/legacy/corrector.rb
rubocop-1.63.3 lib/rubocop/cop/legacy/corrector.rb
rubocop-1.63.2 lib/rubocop/cop/legacy/corrector.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/cop/legacy/corrector.rb
rubocop-1.63.1 lib/rubocop/cop/legacy/corrector.rb
rubocop-1.63.0 lib/rubocop/cop/legacy/corrector.rb
bison-0.1.0 vendor/bundle/ruby/3.2.0/gems/rubocop-1.62.1/lib/rubocop/cop/legacy/corrector.rb
rubocop-1.62.1 lib/rubocop/cop/legacy/corrector.rb
rubocop-1.62.0 lib/rubocop/cop/legacy/corrector.rb
rubocop-1.61.0 lib/rubocop/cop/legacy/corrector.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.2/lib/rubocop/cop/legacy/corrector.rb
rubocop-1.60.2 lib/rubocop/cop/legacy/corrector.rb
study_line-0.2.7 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/legacy/corrector.rb
study_line-0.2.6 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/legacy/corrector.rb