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 33

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

  # When not using Bundler. Makes the spec available in loaded_specs but does not require it.
  Gem.try_activate(feature_name)
  return false unless (gem = Gem.loaded_specs[feature_name])

  !!gem.['default_lint_roller_plugin']
end