Navigation Menu

Skip to content

Commit

Permalink
Clean up info display.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarnette committed Nov 20, 2010
1 parent 67c39d0 commit 1b565f5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/rubygems/info.rb
Expand Up @@ -47,10 +47,10 @@ def self.for other, source = nil
# Create a new instance. +platform+ is optional, and defaults to
# +ruby+. If a block is given the new instance is yielded.

def initialize name, version, platform = "ruby", source = nil, &block
def initialize name, version, platform = nil, source = nil, &block
@dependencies = []
@name = name
@platform = platform
@platform = platform || "ruby"
@source = source
@version = Gem::Version.create version

Expand All @@ -61,9 +61,12 @@ def initialize name, version, platform = "ruby", source = nil, &block
# and platform (if not ruby).

def display
@display ||= (d = "#{name}-#{version}"
d << "-#{platform}" unless "ruby" == platform
d)
return @display if defined? @display

@display = "#{name}-#{version}"
@display << "-#{platform}" unless "ruby" == platform

@display
end

# :stopdoc:
Expand Down

0 comments on commit 1b565f5

Please sign in to comment.