Class: RuboCop::RSpec::Guide::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/rspec/guide/plugin.rb

Overview

Plugin integration for RuboCop 1.72+

This class provides the modern plugin API for RuboCop. It allows loading the gem via the plugins: configuration in .rubocop.yml instead of the legacy require: approach.

Examples:

Modern approach (RuboCop 1.72+)

# .rubocop.yml
plugins:
  - rubocop-rspec-guide

Legacy approach (still supported)

# .rubocop.yml
require:
  - rubocop-rspec-guide

Instance Method Summary collapse

Constructor Details

#initialize(config = nil) ⇒ Plugin

Initialize the plugin

Parameters:

  • config (RuboCop::Config, nil) (defaults to: nil)

    the RuboCop configuration



25
26
27
# File 'lib/rubocop/rspec/guide/plugin.rb', line 25

def initialize(config = nil)
  @config = config
end

Instance Method Details

#nameString

Plugin metadata

Returns:

  • (String)

    the plugin name



32
33
34
# File 'lib/rubocop/rspec/guide/plugin.rb', line 32

def name
  "rubocop-rspec-guide"
end

#versionString

Plugin version

Returns:

  • (String)

    the plugin version



39
40
41
# File 'lib/rubocop/rspec/guide/plugin.rb', line 39

def version
  RuboCop::RSpec::Guide::VERSION
end