Method: Stickler::Repository::Remote#push

Defined in:
lib/stickler/repository/remote.rb

#push(path) ⇒ Object

See Api#push



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/stickler/repository/remote.rb', line 80

def push( path )
  spec = speclite_from_gem_file( path )
  raise Stickler::Repository::Error, "gem #{spec.full_name} already exists in remote repository" if remote_gem_file_exist?( spec )
  begin
    resp = push_resource.post( IO.read( path ) )
  rescue Resourceful::UnsuccessfulHttpRequestError => e
    msg = "Failure pushing #{path} to remote repository : response code => #{e.http_response.code}, response message => '#{e.http_response.body}'"
    raise Stickler::Repository::Error, msg
  end
  return spec
end