Sha256: 76847859ba66bde8d09cd1aa8ea05983d382bb8d34e77998042251feda7b2787

Contents?: true

Size: 790 Bytes

Versions: 4

Compression:

Stored size: 790 Bytes

Contents

# frozen_string_literal: true

# takelage 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"

    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

4 entries across 4 versions & 1 rubygems

Version Path
takelage-0.28.11 lib/takelage/mutagen/socket/check.rb
takelage-0.28.8 lib/takelage/mutagen/socket/check.rb
takelage-0.28.7 lib/takelage/mutagen/socket/check.rb
takelage-0.28.5 lib/takelage/mutagen/socket/check.rb