Sha256: f211f27e2fc09162ac124e9c8f5e41f84c101e1444995edd1ee391921d45b529

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

# encoding: UTF-8
# frozen_string_literal: true

require 'nrser/refinements/types'
using NRSER::Types


# Namespace
# =======================================================================

module  Locd
module  CLI
module  Command


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

class Job < Agent
  
  desc              "add [OPTIONS] -- CMD_TEMPLATE...",
                    "Add job that runs in the current directory"
  
  include_shared    t[  groups:
                          t.has_any(  :write,
                                      :add,
                                      :respond_with_agents  ) ]

  option            :every,
                    desc: "How often to start the job",
                    type: :string
  
  option            :at,
                    desc: "Day/time to start the job",
                    type: :hash
  
  def add           *cmd_template, **kwds
    logger.trace "#{ self.class.name }##{ __method__ }",
      options: options,
      cmd_template: cmd_template,
      kwds: kwds,
      shared: self.class.shared_method_options
    
    kwds[:start_interval] ||= get_start_interval
    
    super *cmd_template, **kwds
  end

end # class Job


# /Namespace
# =======================================================================

end # module  Command
end # module  CLI
end # module  Locd

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
locd-0.1.13 lib/locd/cli/command/job/add.rb