summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/commands/contents_command.rb4
-rw-r--r--lib/rubygems/commands/setup_command.rb4
-rw-r--r--lib/rubygems/indexer.rb4
-rw-r--r--lib/rubygems/installer.rb4
-rw-r--r--lib/rubygems/s3_uri_signer.rb2
-rw-r--r--lib/rubygems/source.rb4
-rw-r--r--lib/rubygems/util/licenses.rb4
-rw-r--r--lib/rubygems/validator.rb2
8 files changed, 14 insertions, 14 deletions
@@ -94,7 +94,7 @@ prefix or only the files that are requireable.
gem_path = spec.full_gem_path
extra = "/{#{spec.require_paths.join ","}}" if options[:lib_only]
glob = "#{gem_path}#{extra}/**/*"
- prefix_re = /#{Regexp.escape(gem_path)}\//
Dir[glob].map do |file|
[gem_path, file.sub(prefix_re, "")]
@@ -104,7 +104,7 @@ prefix or only the files that are requireable.
def files_in_default_gem(spec)
spec.files.map do |file|
case file
- when /\A#{spec.bindir}\//
# $' is POSTMATCH
[RbConfig::CONFIG["bindir"], $']
when /\.so\z/
@@ -7,8 +7,8 @@ require_relative "../command"
# RubyGems checkout or tarball.
class Gem::Commands::SetupCommand < Gem::Command
- HISTORY_HEADER = /^#\s*[\d.a-zA-Z]+\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze
- VERSION_MATCHER = /^#\s*([\d.a-zA-Z]+)\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze
ENV_PATHS = %w[/usr/bin/env /bin/env].freeze
@@ -309,7 +309,7 @@ class Gem::Indexer
end
files = files.map do |path|
- path.sub(/^#{Regexp.escape @directory}\/?/, "") # HACK?
end
files.each do |file|
@@ -390,7 +390,7 @@ class Gem::Indexer
files << "#{@prerelease_specs_index}.gz"
files = files.map do |path|
- path.sub(/^#{Regexp.escape @directory}\/?/, "") # HACK?
end
files.each do |file|
@@ -239,14 +239,14 @@ class Gem::Installer
next unless io.gets.to_s.include?("This file was generated by RubyGems")
ruby_executable = true
- existing = io.read.slice(%r{
^\s*(
gem \s |
load \s Gem\.bin_path\( |
load \s Gem\.activate_bin_path\(
)
(['"])(.*?)(\2),
- }x, 3)
end
return if spec.name == existing
@@ -136,7 +136,7 @@ class Gem::S3URISigner
end
def base64_uri_escape(str)
- str.gsub(/[\+\/=\n]/, BASE64_URI_TRANSLATE)
end
def ec2_metadata_credentials_json
@@ -100,7 +100,7 @@ class Gem::Source
def cache_dir(uri)
# Correct for windows paths
- escaped_path = uri.path.sub(/^\/([a-z]):\//i, '/\\1-/')
escaped_path.tap(&Gem::UNTAINT)
File.join Gem.spec_cache_dir, "#{uri.host}%#{uri.port}", File.dirname(escaped_path)
@@ -231,7 +231,7 @@ class Gem::Source
private
def enforce_trailing_slash(uri)
- uri.merge(uri.path.gsub(/\/+$/, "") + "/")
end
end
@@ -565,7 +565,7 @@ class Gem::Licenses
x11vnc-openssl-exception
].freeze
- REGEXP = %r{
\A
(?:
#{Regexp.union(LICENSE_IDENTIFIERS)}
@@ -575,7 +575,7 @@ class Gem::Licenses
| #{LICENSE_REF}
)
\Z
- }ox.freeze
def self.match?(license)
!REGEXP.match(license).nil?
@@ -25,7 +25,7 @@ class Gem::Validator
installed_files = []
Find.find gem_directory do |file_name|
- fn = file_name[gem_directory.size..file_name.size - 1].sub(/^\//, "")
installed_files << fn unless
fn.empty? || fn.include?("CVS") || File.directory?(file_name)
end