Class: Gemstash::GemPusher

Inherits:
Object
  • Object
show all
Includes:
Env::Helper, LegacyRubyGemsSupport
Defined in:
lib/gemstash/gem_pusher.rb

Overview

Class that supports pushing a new gem to the private repository of gems.

Defined Under Namespace

Classes: ExistingVersionError, YankedVersionError

Class Method Summary collapse

Instance Method Summary collapse

Methods included from LegacyRubyGemsSupport

included

Constructor Details

#initialize(auth, content) ⇒ GemPusher

Returns a new instance of GemPusher.



26
27
28
29
# File 'lib/gemstash/gem_pusher.rb', line 26

def initialize(auth, content)
  @auth = auth
  @content = content
end

Class Method Details

.serve(app) ⇒ Object



21
22
23
24
# File 'lib/gemstash/gem_pusher.rb', line 21

def self.serve(app)
  gem = app.request.body.read
  new(app.auth, gem).serve
end

Instance Method Details

#serveObject



31
32
33
34
35
36
37
# File 'lib/gemstash/gem_pusher.rb', line 31

def serve
  check_auth
  store_gem
  store_gemspec
  save_to_database
  invalidate_cache
end