diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-22 02:52:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-22 02:52:35 +0000 |
commit | b551e8c8b36766651be4e782e09e3b02e7d14a10 (patch) | |
tree | e164a1ef908bd4451568abf05b688f1593915b81 /lib/rubygems/commands/dependency_command.rb | |
parent | 65544f575b25b18dc27f9364f973556ddb48538f (diff) |
* lib/rubygems: update to 1.3.6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/dependency_command.rb')
-rw-r--r-- | lib/rubygems/commands/dependency_command.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb index 44b269bb11..61e3b59fd7 100644 --- a/lib/rubygems/commands/dependency_command.rb +++ b/lib/rubygems/commands/dependency_command.rb @@ -15,6 +15,7 @@ class Gem::Commands::DependencyCommand < Gem::Command add_version_option add_platform_option + add_prerelease_option add_option('-R', '--[no-]reverse-dependencies', 'Include reverse dependencies in the output') do @@ -59,6 +60,7 @@ class Gem::Commands::DependencyCommand < Gem::Command end dependency = Gem::Dependency.new pattern, options[:version] + dependency.prerelease = options[:prerelease] if options[:reverse_dependencies] and remote? and not local? then alert_error 'Only reverse dependencies for local gems are supported.' @@ -75,7 +77,10 @@ class Gem::Commands::DependencyCommand < Gem::Command fetcher = Gem::SpecFetcher.fetcher begin - fetcher.find_matching(dependency).each do |spec_tuple, source_uri| + specs_and_sources = fetcher.find_matching(dependency, false, true, + dependency.prerelease?) + + specs_and_sources.each do |spec_tuple, source_uri| spec = fetcher.fetch_spec spec_tuple, URI.parse(source_uri) source_indexes[source_uri].add_spec spec @@ -120,8 +125,8 @@ class Gem::Commands::DependencyCommand < Gem::Command if options[:pipe_format] then specs.values.sort_by { |_, spec| spec }.each do |_, spec| unless spec.dependencies.empty? - spec.dependencies.each do |dep| - say "#{dep.name} --version '#{dep.version_requirements}'" + spec.dependencies.sort_by { |dep| dep.name }.each do |dep| + say "#{dep.name} --version '#{dep.requirement}'" end end end @@ -147,7 +152,7 @@ class Gem::Commands::DependencyCommand < Gem::Command response = '' response << ' ' * level + "Gem #{spec.full_name}\n" unless spec.dependencies.empty? then - spec.dependencies.each do |dep| + spec.dependencies.sort_by { |dep| dep.name }.each do |dep| response << ' ' * level + " #{dep}\n" end end @@ -163,7 +168,7 @@ class Gem::Commands::DependencyCommand < Gem::Command dep = Gem::Dependency.new(*dep) unless Gem::Dependency === dep if spec.name == dep.name and - dep.version_requirements.satisfied_by?(spec.version) then + dep.requirement.satisfied_by?(spec.version) then result << [sp.full_name, dep] end end |