Class: Bundler::RemoteSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler08/remote_specification.rb

Overview

Represents a lazily loaded gem specification, where the full specification is on the source server in rubygems’ “quick” index. The proxy object is to be seeded with what we’re given from the source’s abbreviated index - the full specification will only be fetched when necesary.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version, platform, source_uri) ⇒ RemoteSpecification

Returns a new instance of RemoteSpecification.



10
11
12
13
14
15
# File 'lib/bundler08/remote_specification.rb', line 10

def initialize(name, version, platform, source_uri)
  @name     = name
  @version  = version
  @platform = platform
  @source_uri = source_uri
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &blk) ⇒ Object (private)



49
50
51
# File 'lib/bundler08/remote_specification.rb', line 49

def method_missing(method, *args, &blk)
  _remote_specification.send(method, *args, &blk)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/bundler08/remote_specification.rb', line 7

def name
  @name
end

#platformObject (readonly)

Returns the value of attribute platform.



7
8
9
# File 'lib/bundler08/remote_specification.rb', line 7

def platform
  @platform
end

#sourceObject

Returns the value of attribute source.



8
9
10
# File 'lib/bundler08/remote_specification.rb', line 8

def source
  @source
end

#versionObject (readonly)

Returns the value of attribute version.



7
8
9
# File 'lib/bundler08/remote_specification.rb', line 7

def version
  @version
end

Instance Method Details

#__swap__(spec) ⇒ Object

Because Rubyforge cannot be trusted to provide valid specifications once the remote gem is donwloaded, the backend specification will be swapped out.



28
29
30
# File 'lib/bundler08/remote_specification.rb', line 28

def __swap__(spec)
  @specification = spec
end

#full_nameObject



17
18
19
20
21
22
23
# File 'lib/bundler08/remote_specification.rb', line 17

def full_name
  if platform == Gem::Platform::RUBY or platform.nil? then
    "#{@name}-#{@version}"
  else
    "#{@name}-#{@version}-#{platform}"
  end
end