123456789_123456789_123456789_123456789_123456789_

Class: Bundler::Plugin::UnloadedSource

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, API::Source
Inherits: Object
Defined in: lib/bundler/plugin/unloaded_source.rb

Overview

Stands in for a source handled by a plugin that is not loaded yet, so that the lockfile can still be parsed during the plugin install pass, and by external tools reading a lockfile without the plugin installed.

Instance Attribute Summary

API::Source - Included

#checksum_store, #dependency_names,
#installed?

A helper method, not necessary if not used internally.

#name, #options, #uri

Instance Method Summary

  • #==(other) (also: #eql?)

    Unlike real plugin sources, where the handling class encodes the source type, all unloaded sources share this class, so the type must be compared explicitly.

  • #eql?(other)

    Alias for #==.

  • #hash

API::Source - Included

#==

This shall check if two source object represent the same source.

#add_dependency_names

Used by definition.

#app_cache_dirname

Name of directory where plugin the is expected to cache the gems when #cache is called.

#app_cache_path

The full path where the plugin should cache the gem so that it can be installed latter.

#cache

This method is called while caching to save copy of the gems that the source can resolve to path provided by app_cache_appso that they can be reinstalled from the cache without querying the remote (i.e. an alternative to remote).

#cached!

Set internal representation to fetch the gems/specs from app cache.

#can_lock?

NOTE: Do not override if you don't know what you are doing.

#double_check_for

This API on source might not be stable, and for now we expect plugins to download all specs in #specs, so we implement the method for compatibility purposes and leave it undocumented (and don't support) overriding it).

#download

Download the gem specified by the spec at appropriate path.

#eql?

Alias for API::Source#==.

#fetch_gemspec_files

This is used by the default spec method to constructs the Specification objects for the gems and versions that can be installed by this source plugin.

#gem_install_dir

NOTE: Do not override if you don't know what you are doing.

#hash

When overriding #hash please preserve the behaviour as mentioned in docstring for #== method, i.e.

#identifier

Alias for API::Source#to_s.

#include?

NOTE: Do not override if you don't know what you are doing.

#initialize,
#install

Install the gem specified by the spec at appropriate path.

#install_path

A default installation path to install a single gem.

#local!

Set internal representation to fetch the gems/specs locally.

#options_to_lock

Options to be saved in the lockfile so that the source plugin is able to check out same version of gem later.

#post_install

It builds extensions, generates bins and installs them for the spec provided.

#remote!

Set internal representation to fetch the gems/specs from remote.

#root

It is used to obtain the full_gem_path.

#spec_names

Used by definition.

#specs

Parses the gemspec files to find the specs for the gems that can be satisfied by the source.

#to_lock

Generates the content to be entered into the lockfile.

#to_s,
#unlock!

This is called to update the spec and installation.

#unmet_deps

Used by definition.

#uri_hash

Instance Method Details

#==(other) Also known as: #eql?

Unlike real plugin sources, where the handling class encodes the source type, all unloaded sources share this class, so the type must be compared explicitly.

[ GitHub ]

  
# File 'lib/bundler/plugin/unloaded_source.rb', line 14

def ==(other)
  super && options["type"] == other.options["type"]
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'lib/bundler/plugin/unloaded_source.rb', line 18

alias_method :eql?, :==

#hash

[ GitHub ]

  
# File 'lib/bundler/plugin/unloaded_source.rb', line 20

def hash
  [super, options["type"]].hash
end