diff options
author | David RodrÃguez <[email protected]> | 2023-10-26 22:17:09 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-11-13 11:06:10 +0900 |
commit | a4d80eee179cf4d0b126aa8c61888b7e08795a85 () | |
tree | 33bfed98764f21b8b497a93f9d924fc483cecd51 | |
parent | 50482cd1e5542f210565440bed7586821f774a29 (diff) |
[rubygems/rubygems] Let RuboCop target Ruby 3.0
https://.com/rubygems/rubygems/commit/70243b1d72
-rw-r--r-- | lib/bundler/cli/doctor.rb | 4 | ||||
-rw-r--r-- | lib/bundler/dsl.rb | 2 | ||||
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 4 | ||||
-rw-r--r-- | lib/bundler/ruby_version.rb | 2 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 2 | ||||
-rw-r--r-- | lib/bundler/yaml_serializer.rb | 4 | ||||
-rw-r--r-- | lib/rubygems.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/requirement.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/specification_policy.rb | 10 | ||||
-rw-r--r-- | lib/rubygems/util/licenses.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/version.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/yaml_serializer.rb | 4 | ||||
-rw-r--r-- | spec/bundler/commands/version_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/support/artifice/vcr.rb | 4 | ||||
-rw-r--r-- | spec/bundler/support/helpers.rb | 2 |
17 files changed, 32 insertions, 32 deletions
@@ -6,8 +6,8 @@ require "fiddle" module Bundler class CLI::Doctor - DARWIN_REGEX = /\s+(.+) \(compatibility /.freeze - LDD_REGEX = /\t\S+ => (\S+) \(\S+\)/.freeze attr_reader :options @@ -18,7 +18,7 @@ module Bundler VALID_KEYS = %w[group groups git path glob name branch ref tag require submodules platform platforms type source install_if gemfile force_ruby_platform].freeze - _PULL_REQUEST_URL = %r{\Ahttps://\.com/([A-Za-z0-9_\-\.]+/[A-Za-z0-9_\-\.]+)/pull/(\d+)\z}.freeze attr_reader :gemspecs attr_accessor :dependencies @@ -36,7 +36,7 @@ module Bundler PATH = "PATH" PLUGIN = "PLUGIN SOURCE" SPECS = " specs:" - OPTIONS = /^ ([a-z]+): (.*)$/i.freeze SOURCE = [GIT, GEM, PATH, PLUGIN].freeze SECTIONS_BY_VERSION_INTRODUCED = { @@ -183,7 +183,7 @@ module Bundler (!)? # Optional pinned marker (?:#{space}([^ ]+))? # Optional checksum $ # Line end - /xo.freeze def parse_dependency(line) return unless line =~ NAME_VERSION @@ -49,7 +49,7 @@ module Bundler (\d+\.\d+\.\d+(?:\.\S+)?) # ruby version (?:p(-?\d+))? # optional level (?:\s\((\S+)\s(.+)\))? # optional engine info - /xo.freeze # Returns a RubyVersion from the given string. # @param [String] the version string to match. @@ -509,7 +509,7 @@ module Bundler (https?.*?) # URI (\.#{Regexp.union(PER_URI_OPTIONS)})? # optional suffix key \z - /ix.freeze def self.key_for(key) key = normalize_uri(key).to_s if key.is_a?(String) && key.start_with?("http", "mirror.http") @@ -36,7 +36,7 @@ module Bundler (.*) # value \1 # matching closing quote $ - /xo.freeze HASH_REGEX = / ^ @@ -48,7 +48,7 @@ module Bundler (.*) # value \3 # matching closing quote $ - /xo.freeze def load(str) res = {} @@ -1287,7 +1287,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} ## # Location of Marshal quick gemspecs on remote repositories - MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/" autoload :ConfigFile, File.expand_path("rubygems/config_file", __dir__) autoload :Dependency, File.expand_path("rubygems/dependency", __dir__) @@ -7,8 +7,8 @@ require_relative "../command" # RubyGems checkout or tarball. class Gem::Commands::SetupCommand < Gem::Command - HISTORY_HEADER = %r{^#\s*[\d.a-zA-Z]+\s*/\s*\d{4}-\d{2}-\d{2}\s*$}.freeze - VERSION_MATCHER = %r{^#\s*([\d.a-zA-Z]+)\s*/\s*\d{4}-\d{2}-\d{2}\s*$}.freeze ENV_PATHS = %w[/usr/bin/env /bin/env].freeze @@ -23,12 +23,12 @@ class Gem::Requirement SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc: quoted = OPS.keys.map {|k| Regexp.quote k }.join "|" - PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*" # :nodoc: ## # A regular expression that matches a requirement - PATTERN = /\A#{PATTERN_RAW}\z/.freeze ## # The default requirement matches any non-prerelease version @@ -108,7 +108,7 @@ class Gem::Specification < Gem::BasicSpecification @load_cache = {} # :nodoc: @load_cache_mutex = Thread::Mutex.new - VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/.freeze # :nodoc: # :startdoc: @@ -1756,7 +1756,7 @@ class Gem::Specification < Gem::BasicSpecification /\A (\d{4})-(\d{2})-(\d{2}) (\s+ \d{2}:\d{2}:\d{2}\.\d+ \s* (Z | [-+]\d\d:\d\d) )? - \Z/x.freeze ## # The date this gem was created @@ -5,11 +5,11 @@ require_relative "user_interaction" class Gem::SpecificationPolicy include Gem::UserInteraction - VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/.freeze # :nodoc: - SPECIAL_CHARACTERS = /\A[#{Regexp.escape('.-_')}]+/.freeze # :nodoc: - VALID_URI_PATTERN = %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z}.freeze # :nodoc: METADATA_LINK_KEYS = %w[ bug_tracker_uri @@ -400,8 +400,8 @@ or set it to nil if you don't want to specify a license. end LAZY = '"FIxxxXME" or "TOxxxDO"'.gsub(/xxx/, "") - LAZY_PATTERN = /\AFI XME|\ATO DO/x.freeze - HOMEPAGE_URI_PATTERN = /\A[a-z][a-z\d+.-]*:/i.freeze def validate_lazy_metadata unless @specification.authors.grep(LAZY_PATTERN).empty? @@ -697,7 +697,7 @@ class Gem::Licenses | #{LICENSE_REF} ) \Z - /ox.freeze DEPRECATED_LICENSE_REGEXP = / \A @@ -705,7 +705,7 @@ class Gem::Licenses \+? (?:\s WITH \s .+?)? \Z - /ox.freeze DEPRECATED_EXCEPTION_REGEXP = / \A @@ -713,7 +713,7 @@ class Gem::Licenses \+? (?:\s WITH \s #{Regexp.union(DEPRECATED_EXCEPTION_IDENTIFIERS)}) \Z - /ox.freeze def self.match?(license) VALID_REGEXP.match?(license) @@ -156,7 +156,7 @@ class Gem::Version include Comparable VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc: - ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/.freeze # :nodoc: ## # A string representation of this Version. @@ -36,7 +36,7 @@ module Gem (.*) # value \1 # matching closing quote $ - /xo.freeze HASH_REGEX = / ^ @@ -48,7 +48,7 @@ module Gem (.*) # value \3 # matching closing quote $ - /xo.freeze def load(str) res = {} @@ -4,9 +4,9 @@ require_relative "../support/path" RSpec.describe "bundle version" do if Spec::Path.ruby_core? - COMMIT_HASH = /unknown|[a-fA-F0-9]{7,}/.freeze else - COMMIT_HASH = /[a-fA-F0-9]{7,}/.freeze end context "with -v" do @@ -3,8 +3,8 @@ require "net/http" require_relative "../path" -CASSETTE_PATH = "#{Spec::Path.spec_dir}/support/artifice/vcr_cassettes" -USED_CASSETTES_PATH = "#{Spec::Path.spec_dir}/support/artifice/used_cassettes.txt" CASSETTE_NAME = ENV.fetch("BUNDLER_SPEC_VCR_CASSETTE_NAME") { "realworld" } class BundlerVCRHTTP < Net::HTTP @@ -43,7 +43,7 @@ module Spec last_command.stderr end - MAJOR_DEPRECATION = /^\[DEPRECATED\]\s*/.freeze def err_without_deprecations err.gsub(/#{MAJOR_DEPRECATION}.+[\n]?/, "") |