Class: Stickler::Repository::RemoteMirror

Inherits:
Remote
  • Object
show all
Defined in:
lib/stickler/repository/remote_mirror.rb

Overview

A Repository::Api implementation that retrieves all is data from an HTTP based remote location. It utilizes the Modern gem server api and the gem cutter api (push/yank/unyank). The legacy gem server api is not utilized.

This also supports the single extra method #mirror which tells the remote mirror repostory to mirro the given gem from an upstream server.

Instance Attribute Summary

Attributes inherited from Remote

#authenticator

Instance Method Summary collapse

Methods inherited from Remote

#delete, #gems_uri, #get, #initialize, #latest_specs_list, #open, #push, #search_for, #specs_list, #unyank, #uri, #uri_for_gem, #yank

Constructor Details

This class inherits a constructor from Stickler::Repository::Remote

Instance Method Details

#mirror(spec, upstream_host) ⇒ Object

Tell the remote repoistory to mirror the given gem from an upstream repository



14
15
16
17
# File 'lib/stickler/repository/remote_mirror.rb', line 14

def mirror( spec, upstream_host )
  raise Stickler::Repository::Error, "gem #{spec.full_name} already exists in remote repository" if remote_gem_file_exist?( spec )
  resource_request( mirror_resource( spec, upstream_host ) )
end