Class: Bundler::SystemGemSource

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

Instance Attribute Summary

Attributes inherited from Source

#bundle

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SystemGemSource.



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

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

Class Method Details

.instanceObject



104
105
106
# File 'lib/bundler08/source.rb', line 104

def self.instance
  @instance
end

.new(*args) ⇒ Object



108
109
110
# File 'lib/bundler08/source.rb', line 108

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

Instance Method Details

#==(other) ⇒ Object



125
126
127
# File 'lib/bundler08/source.rb', line 125

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

#download(spec) ⇒ Object



133
134
135
136
137
# File 'lib/bundler08/source.rb', line 133

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

#gemsObject



121
122
123
# File 'lib/bundler08/source.rb', line 121

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

#local?Boolean

Returns:

  • (Boolean)


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

def local?
  false
end

#to_sObject



129
130
131
# File 'lib/bundler08/source.rb', line 129

def to_s
  "system"
end