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 258 def initialize(config) @config = config end
supported_versions()
click to toggle source
# File lib/rubocop/target_ruby.rb, line 244 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 274 def rubocop_version_with_support if supported? RuboCop::Version::STRING else OBSOLETE_RUBIES[version] end end
source()
click to toggle source
# File lib/rubocop/target_ruby.rb, line 262 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 270 def supported? KNOWN_RUBIES.include?(version) end
version()
click to toggle source
# File lib/rubocop/target_ruby.rb, line 266 def version source.version end