mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
[rubygems/rubygems] standardize pretty-print output for Gem::Source and subclasses
6d5fbf82f1
This commit is contained in:
parent
767d0a1716
commit
675529b9c6
9 changed files with 52 additions and 20 deletions
|
@ -157,12 +157,14 @@ class Gem::Source::Git < Gem::Source
|
|||
end
|
||||
|
||||
def pretty_print(q) # :nodoc:
|
||||
q.group 2, "[Git: ", "]" do
|
||||
q.breakable
|
||||
q.text @repository
|
||||
q.object_group(self) do
|
||||
q.group 2, "[Git: ", "]" do
|
||||
q.breakable
|
||||
q.text @repository
|
||||
|
||||
q.breakable
|
||||
q.text @reference
|
||||
q.breakable
|
||||
q.text @reference
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ class Gem::Source::Installed < Gem::Source
|
|||
end
|
||||
|
||||
def pretty_print(q) # :nodoc:
|
||||
q.text "[Installed]"
|
||||
q.object_group(self) do
|
||||
q.text "[Installed]"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -117,10 +117,14 @@ class Gem::Source::Local < Gem::Source
|
|||
end
|
||||
|
||||
def pretty_print(q) # :nodoc:
|
||||
q.group 2, "[Local gems:", "]" do
|
||||
q.breakable
|
||||
q.seplist @specs.keys do |v|
|
||||
q.text v.full_name
|
||||
q.object_group(self) do
|
||||
q.group 2, "[Local gems:", "]" do
|
||||
q.breakable
|
||||
if @specs
|
||||
q.seplist @specs.keys do |v|
|
||||
q.text v.full_name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -42,9 +42,11 @@ class Gem::Source::SpecificFile < Gem::Source
|
|||
end
|
||||
|
||||
def pretty_print(q) # :nodoc:
|
||||
q.group 2, "[SpecificFile:", "]" do
|
||||
q.breakable
|
||||
q.text @path
|
||||
q.object_group(self) do
|
||||
q.group 2, "[SpecificFile:", "]" do
|
||||
q.breakable
|
||||
q.text @path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue