diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 21:29:41 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 21:29:41 +0000 |
commit | 95683e5cb2d1ab8351402b09ef853dcdf875bf8d (patch) | |
tree | 44500dba22e9aa94ecc5d4fd348512d0fb236501 /lib/rubygems/specification.rb | |
parent | 81629f05312cc4df2193a17f13c581eda174d9af (diff) | |
download | ruby-95683e5cb2d1ab8351402b09ef853dcdf875bf8d.tar.gz |
* lib/rubygems: Update to RubyGems 2.2.0.preview.1
This brings several new features to RubyGems summarized here:
https://github.com/rubygems/rubygems/blob/v2.2.0.preview.1/History.txt
* test/rubygems: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/specification.rb')
-rw-r--r-- | lib/rubygems/specification.rb | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 12943a3e24..6de8c3bc77 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -327,7 +327,7 @@ class Gem::Specification < Gem::BasicSpecification add_bindir(@executables), @extra_rdoc_files, @extensions, - ].flatten.uniq.compact + ].flatten.sort.uniq.compact end ###################################################################### @@ -1321,9 +1321,7 @@ class Gem::Specification < Gem::BasicSpecification def add_self_to_load_path return if default_gem? - paths = require_paths.map do |path| - File.join full_gem_path, path - end + paths = full_require_paths # gem directories must come after -I and ENV['RUBYLIB'] insert_index = Gem.load_path_insert_index @@ -2017,6 +2015,17 @@ class Gem::Specification < Gem::BasicSpecification end ## + # Full paths in the gem to add to <code>$LOAD_PATH</code> when this gem is + # activated. + # + + def full_require_paths + require_paths.map do |path| + File.join full_gem_path, path + end + end + + ## # The RubyGems version required by this gem def required_rubygems_version= req @@ -2380,6 +2389,11 @@ class Gem::Specification < Gem::BasicSpecification "[\"#{non_files.join "\", \""}\"] are not files" end + if files.include? file_name then + raise Gem::InvalidSpecificationException, + "#{full_name} contains itself (#{file_name}), check your files list" + end + unless specification_version.is_a?(Fixnum) raise Gem::InvalidSpecificationException, 'specification_version must be a Fixnum (did you mean version?)' |