mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
parent
693e4dec23
commit
cbe14cc8e6
3 changed files with 196 additions and 5 deletions
|
@ -201,11 +201,15 @@ class Gem::Command
|
|||
# respectively.
|
||||
def get_all_gem_names_and_versions
|
||||
get_all_gem_names.map do |name|
|
||||
if /\A(.*):(#{Gem::Requirement::PATTERN_RAW})\z/ =~ name
|
||||
[$1, $2]
|
||||
else
|
||||
[name]
|
||||
end
|
||||
extract_gem_name_and_version(name)
|
||||
end
|
||||
end
|
||||
|
||||
def extract_gem_name_and_version(name) # :nodoc:
|
||||
if /\A(.*):(#{Gem::Requirement::PATTERN_RAW})\z/ =~ name
|
||||
[$1, $2]
|
||||
else
|
||||
[name]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue