123456789_123456789_123456789_123456789_123456789_

Module: RuboCop::Plugin Private

Overview

Provides a plugin for RuboCop extensions that conform to lint_roller. https://github.com/standardrb/lint_roller

Constant Summary

Class Method Summary

Class Method Details

.integrate_plugins(rubocop_config, plugins)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubocop/plugin.rb', line 37

def integrate_plugins(rubocop_config, plugins)
  plugins = Plugin::Loader.load(plugins)

  ConfigurationIntegrator.integrate_plugins_into_rubocop_config(rubocop_config, plugins)

  plugins
end

.plugin_capable?(feature_name) ⇒ Boolean

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubocop/plugin.rb', line 22

def plugin_capable?(feature_name)
  return true if BUILTIN_INTERNAL_PLUGINS.key?(feature_name)
  return true if feature_name == OBSOLETE_INTERNAL_AFFAIRS_PLUGIN_NAME

  begin
    # When not using Bundler. Makes the spec available but does not require it.
    gem feature_name
  rescue Gem::LoadError
    # The user requested a gem that they do not have installed
  end
  return false unless (spec = Gem.loaded_specs[feature_name])

  !!spec.['default_lint_roller_plugin']
end