Class: VcrStripeWebhook::StripeCLI

Inherits:
Object
  • Object
show all
Defined in:
lib/vcr_stripe_webhook/stripe_cli.rb

Defined Under Namespace

Classes: ReadyWaiter

Instance Method Summary collapse

Constructor Details

#initialize(server_port, api_key) ⇒ StripeCLI

Returns a new instance of StripeCLI.



5
6
7
8
9
# File 'lib/vcr_stripe_webhook/stripe_cli.rb', line 5

def initialize(server_port, api_key)
  @server_port = server_port
  @api_key = api_key
  run
end

Instance Method Details

#terminateObject



11
12
13
14
15
16
17
18
# File 'lib/vcr_stripe_webhook/stripe_cli.rb', line 11

def terminate
  @stdout.close
  @read_out_thread.join
  @stderr.close
  @read_err_thread.join
  Process.kill(:TERM, @pid)
  Process.waitpid(@pid)
end