Class: Bundler::SystemGemSource

Inherits:
Source
  • Object
show all
Defined in:
lib/bowline/bundler/source.rb

Instance Attribute Summary

Attributes inherited from Source

#bundle, #local

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bundle, options = {}) ⇒ SystemGemSource

Returns a new instance of SystemGemSource.



113
114
115
116
# File 'lib/bowline/bundler/source.rb', line 113

def initialize(bundle, options = {})
  super
  @source = Gem::SourceIndex.from_installed_gems
end

Class Method Details

.instanceObject



105
106
107
# File 'lib/bowline/bundler/source.rb', line 105

def self.instance
  @instance
end

.new(*args) ⇒ Object



109
110
111
# File 'lib/bowline/bundler/source.rb', line 109

def self.new(*args)
  @instance ||= super
end

Instance Method Details

#==(other) ⇒ Object



126
127
128
# File 'lib/bowline/bundler/source.rb', line 126

def ==(other)
  other.is_a?(SystemGemSource)
end

#can_be_local?Boolean

Returns:

  • (Boolean)


118
119
120
# File 'lib/bowline/bundler/source.rb', line 118

def can_be_local?
  false
end

#download(spec) ⇒ Object



134
135
136
137
138
# File 'lib/bowline/bundler/source.rb', line 134

def download(spec)
  gemfile = Pathname.new(spec.loaded_from)
  gemfile = gemfile.dirname.join('..', 'cache', "#{spec.full_name}.gem")
  bundle.cache(gemfile)
end

#gemsObject



122
123
124
# File 'lib/bowline/bundler/source.rb', line 122

def gems
  @gems ||= process_source_gems(@source.gems)
end

#to_sObject



130
131
132
# File 'lib/bowline/bundler/source.rb', line 130

def to_s
  "system"
end