mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems/command.rb (Gem::Command#get_all_gem_names_and_versions):
who assumes that the pathname of a gem never contains ':' ? yes, on Unixen pathnames can contain ':', and on Windows they almost certainly contain ':'. see [ruby-core:50388]. * lib/rubygems/requirement.rb (Gem::Requirement::PATTERN_RAW): extract the regexp to match the version specifier from PATTERN to use in above method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4bb1bfa0ed
commit
952beb5ff4
4 changed files with 22 additions and 3 deletions
|
@ -5,6 +5,7 @@
|
|||
#++
|
||||
|
||||
require 'optparse'
|
||||
require 'rubygems/requirement'
|
||||
require 'rubygems/user_interaction'
|
||||
|
||||
##
|
||||
|
@ -186,7 +187,13 @@ class Gem::Command
|
|||
# An argument in the form gem:ver is pull apart into the gen name and version,
|
||||
# respectively.
|
||||
def get_all_gem_names_and_versions
|
||||
get_all_gem_names.map { |name| name.split(":", 2) }
|
||||
get_all_gem_names.map do |name|
|
||||
if /\A(.*):(#{Gem::Requirement::PATTERN_RAW})\z/ =~ name
|
||||
[$1, $2]
|
||||
else
|
||||
[name]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue