Class: Rubygems::Await::PrereleaseIndexAwaiter

Inherits:
Awaiter
  • Object
show all
Defined in:
lib/rubygems/await.rb

Instance Attribute Summary

Attributes inherited from Awaiter

#deadline, #gems, #name_indent, #source, #source_uri

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Awaiter

#call, call, #compact_index_client, #downloader, #expired?, #format_element, #gem_remote_fetcher, #index_fetcher, #inherited, #initialize, #log, #log_error, #log_found, #process_element, #safe_load_marshal, subclasses

Constructor Details

This class inherits a constructor from Rubygems::Await::Awaiter

Class Method Details

.awaiter_name ⇒ Object



373
374
375
# File 'lib/rubygems/await.rb', line 373

def self.awaiter_name
  "pre index"
end

Instance Method Details

#collection ⇒ Object



358
359
360
# File 'lib/rubygems/await.rb', line 358

def collection
  super.keep_if { |t| /[a-z]/i.match?(t.version.to_s) }
end

#process_collection(missing) ⇒ Object



362
363
364
365
366
367
368
369
370
371
# File 'lib/rubygems/await.rb', line 362

def process_collection(missing)
  path = source_uri + "prerelease_specs.#{Gem.marshal_version}.gz"
  contents = gem_remote_fetcher.fetch_path(path)
  idx = safe_load_marshal(contents)

  idx.each do |found|
    tuple = Gem::NameTuple.new(*found.map!(&:to_s))
    log_found(tuple) if missing.delete?(tuple)
  end
end