Class: Agent::Lock::CLI::Commands::TreeCommand Abstract

Inherits:
Base
  • Object
show all
Defined in:
lib/agent/lock/cli/commands/tree_command.rb

Overview

This class is abstract.

Subclass and implement #call(**options).

A command that works on the lock store of one checkout, and so takes --dir to name which checkout that is, and --locking-strategy and --redis-url to name which store.

They are added in inherited rather than restated in every subclass, so a new lock verb gets them by subclassing and cannot forget one. Every verb takes the store flags, not acquire alone: a lock taken on a named Redis is released on that same Redis.

Direct Known Subclasses

Acquire, Break, Check, List, Mine, Note, Release, ReleaseAll, Resume

Instance Attribute Summary

Attributes inherited from Base

#launcher

Class Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Agent::Lock::CLI::Commands::Base

Class Method Details

.inherited(subclass) ⇒ void

This method returns an undefined value.

Parameters:



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/agent/lock/cli/commands/tree_command.rb', line 23

def self.inherited(subclass)
  super
  subclass.option :dir, type: :string, default: ".",
                        desc: "Act on the checkout that contains this directory"
  subclass.option :locking_strategy, type: :string, aliases: ["-s"],
                                     desc: "redis or filesystem: where the locks live, instead of " \
                                           "AGENT_LOCK_BACKEND or whichever answers first"
  subclass.option :redis_url, type: :string, aliases: ["-u"],
                              desc: "The one Redis to use, with no fallback; implies " \
                                    "--locking-strategy redis (env: AGENT_LOCK_REDIS_URL)"
end