Class: Bundler::GemSource
Defined Under Namespace
Classes: RubygemsRetardation
Instance Attribute Summary collapse
Attributes inherited from Source
#local, #repository
Instance Method Summary
collapse
Constructor Details
#initialize(options) ⇒ GemSource
Returns a new instance of GemSource.
26
27
28
29
30
|
# File 'lib/bundler/source.rb', line 26
def initialize(options)
@uri = options[:uri]
@uri = URI.parse(@uri) unless @uri.is_a?(URI)
raise ArgumentError, "The source must be an absolute URI" unless @uri.absolute?
end
|
Instance Attribute Details
#uri ⇒ Object
Returns the value of attribute uri.
24
25
26
|
# File 'lib/bundler/source.rb', line 24
def uri
@uri
end
|
Instance Method Details
#==(other) ⇒ Object
40
41
42
|
# File 'lib/bundler/source.rb', line 40
def ==(other)
uri == other.uri
end
|
#can_be_local? ⇒ Boolean
32
33
34
|
# File 'lib/bundler/source.rb', line 32
def can_be_local?
false
end
|
#download(spec) ⇒ Object
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/bundler/source.rb', line 50
def download(spec)
Bundler.logger.info "Downloading #{spec.full_name}.gem"
destination = repository.path
unless destination.writable?
raise RubygemsRetardation, "destination: #{destination} is not writable"
end
Gem::RemoteFetcher.fetcher.download(spec, uri, destination)
new_spec = Gem::Format.from_file_by_path(destination.join('cache', "#{spec.full_name}.gem")).spec
spec.__swap__(new_spec)
end
|
#gems ⇒ Object
36
37
38
|
# File 'lib/bundler/source.rb', line 36
def gems
@specs ||= fetch_specs
end
|
#to_s ⇒ Object
44
45
46
|
# File 'lib/bundler/source.rb', line 44
def to_s
@uri.to_s
end
|