summaryrefslogtreecommitdiff
path: root/lib/rubygems/basic_specification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/basic_specification.rb')
-rw-r--r--lib/rubygems/basic_specification.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb
index 347f8c3318..c6d63ac473 100644
--- a/lib/rubygems/basic_specification.rb
+++ b/lib/rubygems/basic_specification.rb
@@ -98,7 +98,7 @@ class Gem::BasicSpecification
# Returns full path to the directory where gem's extensions are installed.
def extension_dir
- @extension_dir ||= File.expand_path(File.join(extensions_dir, full_name)).untaint
+ @extension_dir ||= File.expand_path(File.join(extensions_dir, full_name)).tap(&Gem::UNTAINT)
end
##
@@ -113,7 +113,7 @@ class Gem::BasicSpecification
def find_full_gem_path # :nodoc:
# TODO: also, shouldn't it default to full_name if it hasn't been written?
path = File.expand_path File.join(gems_dir, full_name)
- path.untaint
+ path.tap(&Gem::UNTAINT)
path
end
@@ -135,9 +135,9 @@ class Gem::BasicSpecification
def full_name
if platform == Gem::Platform::RUBY or platform.nil?
- "#{name}-#{version}".dup.untaint
+ "#{name}-#{version}".dup.tap(&Gem::UNTAINT)
else
- "#{name}-#{version}-#{platform}".dup.untaint
+ "#{name}-#{version}-#{platform}".dup.tap(&Gem::UNTAINT)
end
end
@@ -149,7 +149,7 @@ class Gem::BasicSpecification
@full_require_paths ||=
begin
full_paths = raw_require_paths.map do |path|
- File.join full_gem_path, path.untaint
+ File.join full_gem_path, path.tap(&Gem::UNTAINT)
end
full_paths << extension_dir if have_extensions?
@@ -163,7 +163,7 @@ class Gem::BasicSpecification
def datadir
# TODO: drop the extra ", gem_name" which is uselessly redundant
- File.expand_path(File.join(gems_dir, full_name, "data", name)).untaint
+ File.expand_path(File.join(gems_dir, full_name, "data", name)).tap(&Gem::UNTAINT)
end
##
@@ -277,7 +277,7 @@ class Gem::BasicSpecification
# TODO: do we need these?? Kill it
glob = File.join(self.lib_dirs_glob, glob)
- Dir[glob].map { |f| f.untaint } # FIX our tests are broken, run w/ SAFE=1
+ Dir[glob].map { |f| f.tap(&Gem::UNTAINT) } # FIX our tests are broken, run w/ SAFE=1
end
##
@@ -295,7 +295,7 @@ class Gem::BasicSpecification
"lib" # default value for require_paths for bundler/inline
end
- "#{self.full_gem_path}/#{dirs}".dup.untaint
+ "#{self.full_gem_path}/#{dirs}".dup.tap(&Gem::UNTAINT)
end
##
@@ -328,7 +328,7 @@ class Gem::BasicSpecification
def have_file?(file, suffixes)
return true if raw_require_paths.any? do |path|
- base = File.join(gems_dir, full_name, path.untaint, file).untaint
+ base = File.join(gems_dir, full_name, path.tap(&Gem::UNTAINT), file).tap(&Gem::UNTAINT)
suffixes.any? { |suf| File.file? base + suf }
end