Class: Gem::Source::Lock
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
::Gem::Source
|
|
|
Instance Chain:
self,
::Gem::Source,
::Gem::Text,
Comparable
|
|
| Inherits: |
Gem::Source
|
| Defined in: | lib/rubygems/source/lock.rb |
Overview
A Lock source wraps an installed gem’s source and sorts before other sources during dependency resolution. This allows RubyGems to prefer gems from dependency lock files.
Constant Summary
::Gem::Source - Inherited
Class Method Summary
-
.new(source) ⇒ Lock
constructor
Creates a new
Locksource that wrapssourceand moves it earlier in the sort list.
::Gem::Source - Inherited
| .new | Creates a new |
Instance Attribute Summary
-
#wrapped
readonly
The wrapped
::Gem::Source
::Gem::Source - Inherited
| #update_cache? | Returns true when it is possible and safe to update the cache directory. |
| #uri | The URI this source will fetch gems from. |
Instance Method Summary
-
#fetch_spec(name_tuple)
Delegates to the wrapped source’s fetch_spec method.
- #<=>(other) Internal use only
- #==(other) Internal use only
- #hash Internal use only
- #uri Internal use only
::Gem::Source - Inherited
| #<=> | Sources are ordered by installation preference. |
| #cache_dir | Returns the local directory to write #uri to. |
| #download | Downloads |
| #fetch_spec | Fetches a specification for the given |
| #load_specs | Loads |
| #typo_squatting?, #enforce_trailing_slash, #==, | |
| #dependency_resolver_set | Returns a Set that can fetch specifications from this source. |
| #eql? | Alias for #==. |
| #hash, #pretty_print | |
::Gem::Text - Included
| #clean_text | Remove any non-printable characters and make the text suitable for printing. |
| #format_text | Wraps |
| #levenshtein_distance | This code is based directly on the |
| #truncate_text, #min3 | |
Constructor Details
.new(source) ⇒ Lock
Creates a new Lock source that wraps source and moves it earlier in the sort list.
# File 'lib/rubygems/source/lock.rb', line 17
def initialize(source) @wrapped = source end
Instance Attribute Details
#wrapped (readonly)
The wrapped ::Gem::Source
# File 'lib/rubygems/source/lock.rb', line 11
attr_reader :wrapped
Instance Method Details
#<=>(other)
#==(other)
# File 'lib/rubygems/source/lock.rb', line 32
def ==(other) # :nodoc: 0 == (self <=> other) end
#fetch_spec(name_tuple)
Delegates to the wrapped source’s fetch_spec method.
# File 'lib/rubygems/source/lock.rb', line 43
def fetch_spec(name_tuple) @wrapped.fetch_spec name_tuple end
#hash
# File 'lib/rubygems/source/lock.rb', line 36
def hash # :nodoc: @wrapped.hash ^ 3 end
#uri
# File 'lib/rubygems/source/lock.rb', line 47
def uri # :nodoc: @wrapped.uri end