Class: Gem::NameTuple

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/rubygems_ext.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, version, platform = Gem::Platform::RUBY) ⇒ NameTuple

Returns a new instance of NameTuple.



419
420
421
422
423
424
425
# File 'lib/bundler/rubygems_ext.rb', line 419

def initialize(name, version, platform=Gem::Platform::RUBY)
  if Gem::Platform === platform
    initialize_with_platform(name, version, platform.to_s)
  else
    initialize_with_platform(name, version, platform)
  end
end

Instance Method Details

#initialize_with_platformObject



417
# File 'lib/bundler/rubygems_ext.rb', line 417

alias_method :initialize_with_platform, :initialize

#lock_nameObject



428
429
430
431
432
433
434
# File 'lib/bundler/rubygems_ext.rb', line 428

def lock_name
  if platform == Gem::Platform::RUBY
    "#{name} (#{version})"
  else
    "#{name} (#{version}-#{platform})"
  end
end