Sha256: 8713e18e46f3a0451553a6d9f2784aeab3ef06c8561da3a67b27deeb85eb35f3

Contents?: true

Size: 836 Bytes

Versions: 6

Compression:

Stored size: 836 Bytes

Contents

# frozen_string_literal: true

# takeltau mutagen socket check
module MutagenSocketCheck
  # Backend method for mutagen socket check.
  # @return [Boolean] Does a mutagen socket exist?
  def mutagen_socket_check(socket)
    log.debug "Check if the mutagen socket \"#{socket}\" exists"

    return false unless mutagen_check_daemon

    socket_exists = _mutagen_socket_check_socket(socket)

    unless socket_exists.exitstatus.zero?
      log.debug "A mutagen socket \"#{socket}\" does not exist"
      return false
    end

    log.debug "The mutagen socket \"#{socket}\" does exist"
    true
  end

  private

  # Get git branch.
  def _mutagen_socket_check_socket(socketname)
    cmd_check_socket = format(
      config.active['cmd_mutagen_forward_socket_check'],
      socketname: socketname
    )
    try cmd_check_socket
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
takeltau-0.34.15 lib/takeltau/mutagen/socket/check.rb
takeltau-0.34.14 lib/takeltau/mutagen/socket/check.rb
takeltau-0.34.13 lib/takeltau/mutagen/socket/check.rb
takeltau-0.34.12 lib/takeltau/mutagen/socket/check.rb
takeltau-0.34.11 lib/takeltau/mutagen/socket/check.rb
takeltau-0.34.9 lib/takeltau/mutagen/socket/check.rb