Class: RuboCop::TargetRuby::GemspecFile Private

Inherits:
Source
  • Object
show all
Extended by:
Macros
Defined in:
lib/rubocop/target_ruby.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The target ruby version may be found in a .gemspec file.

Instance Attribute Summary

Attributes inherited from Source

#version

Instance Method Summary collapse

Methods inherited from Source

#initialize, #to_s

Constructor Details

This class inherits a constructor from RuboCop::TargetRuby::Source

Instance Method Details

#gem_requirement_versions(node) ⇒ Object



62
63
64
65
66
# File 'lib/rubocop/target_ruby.rb', line 62

def_node_matcher :gem_requirement_versions, <<~PATTERN
  (send (const(const _ :Gem):Requirement) :new
    {$str+ | (send $str :freeze)+ | (array $str+) | (array (send $str :freeze)+)}
  )
PATTERN

#nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



68
69
70
# File 'lib/rubocop/target_ruby.rb', line 68

def name
  "`required_ruby_version` parameter (in #{gemspec_filepath})"
end

#required_ruby_version(node) ⇒ Object



57
58
59
# File 'lib/rubocop/target_ruby.rb', line 57

def_node_search :required_ruby_version, <<~PATTERN
  (send _ :required_ruby_version= $_)
PATTERN