diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/source.rb | 16 | ||||
-rw-r--r-- | lib/rubygems/source/git.rb | 12 | ||||
-rw-r--r-- | lib/rubygems/source/installed.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/source/local.rb | 12 | ||||
-rw-r--r-- | lib/rubygems/source/specific_file.rb | 8 |
5 files changed, 32 insertions, 20 deletions
diff --git a/lib/rubygems/source.rb b/lib/rubygems/source.rb index d90e311b65..4e5545982d 100644 --- a/lib/rubygems/source.rb +++ b/lib/rubygems/source.rb @@ -213,14 +213,16 @@ class Gem::Source end def pretty_print(q) # :nodoc: - q.group 2, "[Remote:", "]" do - q.breakable - q.text @uri.to_s - - if api = uri + q.object_group(self) do + q.group 2, "[Remote:", "]" do q.breakable - q.text "API URI: " - q.text api.to_s + q.text @uri.to_s + + if api = uri + q.breakable + q.text "API URI: " + q.text api.to_s + end end end end diff --git a/lib/rubygems/source/git.rb b/lib/rubygems/source/git.rb index bda63c6844..34f6851bc4 100644 --- a/lib/rubygems/source/git.rb +++ b/lib/rubygems/source/git.rb @@ -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 diff --git a/lib/rubygems/source/installed.rb b/lib/rubygems/source/installed.rb index cbe12a0516..f5c96fee51 100644 --- a/lib/rubygems/source/installed.rb +++ b/lib/rubygems/source/installed.rb @@ -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 diff --git a/lib/rubygems/source/local.rb b/lib/rubygems/source/local.rb index d81d8343a8..ba6eea1f9a 100644 --- a/lib/rubygems/source/local.rb +++ b/lib/rubygems/source/local.rb @@ -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 diff --git a/lib/rubygems/source/specific_file.rb b/lib/rubygems/source/specific_file.rb index e9b2753646..dde1d48a21 100644 --- a/lib/rubygems/source/specific_file.rb +++ b/lib/rubygems/source/specific_file.rb @@ -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 |