aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/specification.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-06 05:13:08 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-06 05:13:08 +0000
commitafae107a4c969845c58985159a0ce51f80e920ca (patch)
treec09681f9e9d9fcb1ef014d6783b2ac41a034a86e /lib/rubygems/specification.rb
parent5ffc1a3aaa5f63465fb210d08070e380c67916dc (diff)
downloadruby-afae107a4c969845c58985159a0ce51f80e920ca.tar.gz
* lib/rubygems/package.rb: Set rubygems_version before validation.
Fixes issue with bundler. * test/rubygems/test_gem_package.rb: Test for above. * lib/rubygems/remote_fetcher.rb: Only update the cache when we have permission. [ruby-trunk - Bug #7509] * lib/rubygems/source.rb (class Gem): ditto * test/rubygems/test_gem_remote_fetcher.rb: Test for above. * lib/rubygems/test_utilities.rb: ditto * lib/rubygems/specification.rb: Derive base_dir properly for default gems. [ruby-trunk - Bug #7496] * test/rubygems/test_gem_specification.rb: Test for above. * lib/rubygems.rb: Untaint Dir.pwd when searching for gemdeps files for operation under $SAFE=1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/specification.rb')
-rw-r--r--lib/rubygems/specification.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 23393f2025..ad87e997a4 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1283,7 +1283,11 @@ class Gem::Specification
def base_dir
return Gem.dir unless loaded_from
- @base_dir ||= File.dirname File.dirname loaded_from
+ @base_dir ||= if default_gem? then
+ File.dirname File.dirname File.dirname loaded_from
+ else
+ File.dirname File.dirname loaded_from
+ end
end
##
@@ -2486,17 +2490,17 @@ class Gem::Specification
# Checks to see if the files to be packaged are world-readable.
def validate_permissions
+ return if Gem.win_platform?
+
files.each do |file|
- next if File.stat(file).world_readable?
+ next if File.stat(file).mode & 0444 == 0444
alert_warning "#{file} is not world-readable"
end
- unless Gem.win_platform?
- executables.each do |name|
- exec = File.join @bindir, name
- next if File.stat(exec).executable?
- alert_warning "#{exec} is not executable"
- end
+ executables.each do |name|
+ exec = File.join @bindir, name
+ next if File.stat(exec).executable?
+ alert_warning "#{exec} is not executable"
end
end
@@ -2562,7 +2566,6 @@ class Gem::Specification
# deprecate :has_rdoc=, :none, 2011, 10
# deprecate :default_executable, :none, 2011, 10
# deprecate :default_executable=, :none, 2011, 10
- # deprecate :spec_name, :spec_file, 2011, 10
# deprecate :file_name, :cache_file, 2011, 10
# deprecate :full_gem_path, :cache_file, 2011, 10
end