Sha256: c38de80c6a7e24609deea95bddcc1eaf1a5cf915b9d4e59df741b8afcab6a401

Contents?: true

Size: 2 KB

Versions: 3

Compression:

Stored size: 2 KB

Contents

# frozen_string_literal: true

# Requirements
# =======================================================================

# Stdlib
# -----------------------------------------------------------------------

# Deps
# -----------------------------------------------------------------------
require 'plist'
require 'fileutils'

# Project / Package
# -----------------------------------------------------------------------


# Refinements
# =======================================================================

using NRSER
using NRSER::Types


# Definitions
# =======================================================================


# An server {Locd::Agent} (HTTP only at the moment) that the proxy can
# route requests to.
# 
class Locd::Agent::RotateLogs < Locd::Agent::Job
  
  # Mixins
  # ============================================================================
  
  include Locd::Agent::System
  
  
  # Class Methods
  # ==========================================================================
  
  # @return [String]
  #   The non-namespace part of the log rotator agent's label.
  # 
  def self.label_name
    "rotate_logs"
  end
  
  
  # Not much to explain here.
  # 
  # @return [String]
  # 
  def self.default_cmd_template
    "{bin} rotate-logs run"
  end # .cmd_template
  
  
  def self.default_start_interval
    NRSER.deep_symbolize_keys Locd.config[:rotate_logs, :start_interval]
  end
  
  
  # Patch in {.default_cmd_template} as, well, the default for `cmd_template`.
  # 
  # @param cmd_template: (see Locd::Agent.render_cmd)
  # 
  # @param **kwds (see Locd::Agent::System::ClassMethods#default_write_kwds)
  # 
  # @return (see Locd::Agent::System::ClassMethods#default_write_kwds)
  # 
  def self.default_write_kwds cmd_template: self.default_cmd_template,
                              start_interval: self.default_start_interval,
                              **kwds
    super \
      cmd_template: cmd_template,
      start_interval: start_interval,
      **kwds
  end
  
end # class Locd::Agent::RotateLogs

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
locd-0.1.5 lib/locd/agent/rotate_logs.rb
locd-0.1.4 lib/locd/agent/rotate_logs.rb
locd-0.1.3 lib/locd/agent/rotate_logs.rb