Class: Gemsmith::Tools::Pusher

Inherits:
Object
  • Object
show all
Defined in:
lib/gemsmith/tools/pusher.rb

Overview

Pushes a gem package to remote gem server.

Instance Method Summary collapse

Constructor Details

#initialize(command: Gem::CommandManager.new) ⇒ Pusher

Returns a new instance of Pusher.



13
14
15
16
# File 'lib/gemsmith/tools/pusher.rb', line 13

def initialize(command: Gem::CommandManager.new, **)
  super(**)
  @command = command
end

Instance Method Details

#call(specification) ⇒ Object



18
19
20
21
22
23
# File 'lib/gemsmith/tools/pusher.rb', line 18

def call specification
  command.run ["push", specification.package_path.to_s, *one_time_password]
  Success specification
rescue Gem::Exception => error
  Failure error.message
end