Sha256: c869ea319e640450dcd6562e1c3a3a2dc8ad816b4810a83210034c3956c5821e

Contents?: true

Size: 1016 Bytes

Versions: 12

Compression:

Stored size: 1016 Bytes

Contents

# A single command/script to be run on a local/remote server
# For the display, it has an active ("installing") and 
# past tense ("installed") verb and a noub/description ("packages")
module Bosh::Bootstrap::Commander
  class Command
    attr_reader :command       # verb e.g. "install"
    attr_reader :description   # noun phrase, e.g. "packages"

    attr_reader :full_present_tense  # e.g. "installing packages"
    attr_reader :full_past_tense    # e.g. "installed packages"
  
    def initialize(command, description, full_present_tense=nil, full_past_tense=nil)
      @command            = command
      @description        = description
      @full_present_tense = full_present_tense || "#{command} #{description}"
      @full_past_tense    = full_past_tense || "#{command} #{description}"
    end

    # Invoke this command (subclass) to call back upon
    # +server+ to perform a server helper
    def perform(server)
      raise "please implement this method to call back upon `server`"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bosh-bootstrap-0.10.2 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.10.1 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.10.0 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.9.0 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.8.2 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.8.1 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.8.0 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.7.1 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.7.0 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.6.0 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.5.1 lib/bosh-bootstrap/commander/command.rb
bosh-bootstrap-0.5.0 lib/bosh-bootstrap/commander/command.rb