class RuboCop::TargetRuby

The kind of Ruby that code inspected by RuboCop is written in. @api private

Constants

DEFAULT_VERSION
KNOWN_RUBIES
OBSOLETE_RUBIES
SOURCES

Public Class Methods

new(config) click to toggle source
# File lib/rubocop/target_ruby.rb, line 248
def initialize(config)
  @config = config
end
supported_versions() click to toggle source
# File lib/rubocop/target_ruby.rb, line 233
def self.supported_versions
  KNOWN_RUBIES
end

Public Instance Methods

rubocop_version_with_support() click to toggle source
# File lib/rubocop/target_ruby.rb, line 264
def rubocop_version_with_support
  if supported?
    RuboCop::Version.version
  else
    OBSOLETE_RUBIES[version]
  end
end
source() click to toggle source
# File lib/rubocop/target_ruby.rb, line 252
def source
  @source ||= SOURCES.each.lazy.map { |c| c.new(@config) }.detect(&:version)
end
supported?() click to toggle source
# File lib/rubocop/target_ruby.rb, line 260
def supported?
  KNOWN_RUBIES.include?(version)
end
version() click to toggle source
# File lib/rubocop/target_ruby.rb, line 256
def version
  source.version
end