Sha256: b76e00ded2e59e9a1705a482bc5503778c9bba4ccfeafb29183c4712fb8b9ddd

Contents?: true

Size: 613 Bytes

Versions: 9

Compression:

Stored size: 613 Bytes

Contents

module ZTK
  class Command

    # Command Private Functionality
    module Private

      # Returns a string in the format of "user@hostname" for the current
      # shell.
      def tag
        @@hostname ||= Socket.gethostname.split('.').first.strip
        "#{ENV['USER']}@#{@@hostname}"
      end

      # Formats a header suitable for writing to the direct logger when logging
      # sessions.
      def log_header(what)
        count = 12
        sep = ("=" * count)
        header = [sep, "[ #{what} ]", sep, "[ #{tag} ]", sep, "[ #{what} ]", sep].join
        "#{header}\n"
      end

    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ztk-1.6.24 lib/ztk/command/private.rb
ztk-1.6.23 lib/ztk/command/private.rb
ztk-1.6.22 lib/ztk/command/private.rb
ztk-1.6.21 lib/ztk/command/private.rb
ztk-1.6.20 lib/ztk/command/private.rb
ztk-1.6.19 lib/ztk/command/private.rb
ztk-1.6.18 lib/ztk/command/private.rb
ztk-1.6.17 lib/ztk/command/private.rb
ztk-1.6.16 lib/ztk/command/private.rb