Class: Gemstash::GemPusher

Inherits:
Object
  • Object
show all
Includes:
Env::Helper
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

Constructor Details

#initialize(auth, content) ⇒ GemPusher

Returns a new instance of GemPusher.



24
25
26
27
# File 'lib/gemstash/gem_pusher.rb', line 24

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

Class Method Details

.serve(app) ⇒ Object



19
20
21
22
# File 'lib/gemstash/gem_pusher.rb', line 19

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

Instance Method Details

#serveObject



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

def serve
  check_auth
  store_gem
  store_gemspec
  save_to_database
  invalidate_cache
end