Class: Bundler::SystemGemSource

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

Instance Attribute Summary

Attributes inherited from Source

#local, #repository

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ SystemGemSource

Returns a new instance of SystemGemSource.



101
102
103
# File 'lib/bundler/source.rb', line 101

def initialize(options)
  @source = Gem::SourceIndex.from_installed_gems
end

Class Method Details

.instanceObject



97
98
99
# File 'lib/bundler/source.rb', line 97

def self.instance
  @instance ||= new({})
end

Instance Method Details

#==(other) ⇒ Object



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

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

#can_be_local?Boolean

Returns:

  • (Boolean)


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

def can_be_local?
  false
end

#download(spec) ⇒ Object



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

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

#gemsObject



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

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

#to_sObject



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

def to_s
  "system"
end