Sha256: 90c2e1b6e4d761ceb3e12bb1c5c7dc67287b911dd3d9774e06bdb1e57bef85b0

Contents?: true

Size: 531 Bytes

Versions: 1

Compression:

Stored size: 531 Bytes

Contents

module Telesignature
  module MockService
    module SpinUp
      if ENV['TELESIGN_STUBBED']
        port = (ENV['TELESIGN_PORT'].to_i || 11989)
        if `lsof -i :#{port}`.blank? # no process running on #port
          Process.detach(pid = Process.fork do
            require 'telesignature/mock_service/fake_server'
          end)
        else
          Rails.logger.warn "TELESIGN STUB MODE FAILED TO START\nProcess already listening on #{port}"
        end
      end

      at_exit { pid && `kill #{pid}` }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
telesignature-0.0.11 lib/telesignature/mock_service/spin_up.rb