Class: Reap::Hosts::Host

Inherits:
Tool
  • Object
show all
Defined in:
lib/reap/hosts/host.rb

Overview

Host

Base class for Hosts.

Direct Known Subclasses

Mailinglist, Rubyforge

Instance Attribute Summary

Attributes inherited from Tool

#project

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tool

#debug?, #dryrun?, #force?, from_project, #initialize, #metadata, #trace?, #verbose?

Methods included from Utilities

#ask, #bin?, #cd, #command_paths, #compress, #dir!, #dir?, directory!, directory?, #email, exist!, exist?, #exists!, #exists?, #file!, #file?, #fileutils, #glob, #list_option, #multiglob, #multiglob_r, #out_of_date?, #password, path!, path?, #read, #rm_r, #safe?, #sh, #stage, #stage_manifest, #status, #write, #ziputils

Constructor Details

This class inherits a constructor from Reap::Tool

Class Method Details

.factory(name) ⇒ Object



31
32
33
# File 'lib/reap/hosts/host.rb', line 31

def self.factory(name)
  registry[name]
end

.inherited(base) ⇒ Object



26
27
28
29
# File 'lib/reap/hosts/host.rb', line 26

def self.inherited(base)
  scm = base.basename.downcase
  registry[scm] = base
end

.register(*uris) ⇒ Object



20
21
22
23
24
# File 'lib/reap/hosts/host.rb', line 20

def self.register(*uris)
  uris.each do |uri|
    registry[uri] = self
  end
end

.registryObject



16
17
18
# File 'lib/reap/hosts/host.rb', line 16

def self.registry
  Hosts.registry
end

Instance Method Details

#announce_confirm?(options = {}) ⇒ Boolean

Generic announce confirmation.

Returns:

  • (Boolean)


37
38
39
40
41
42
43
44
45
46
# File 'lib/reap/hosts/host.rb', line 37

def announce_confirm?(options={})
  return true if force?
  ans = ask("Announce to #{self.class.basename.downcase}?", "yN")
  case ans.downcase
  when 'y', 'yes'
    true
  else
    false
  end
end

#inspectObject



61
62
63
# File 'lib/reap/hosts/host.rb', line 61

def inspect
  "<#{self.class}>"
end

#release_confirm?(options = {}) ⇒ Boolean

Generic announce confirmation.

Returns:

  • (Boolean)


50
51
52
53
54
55
56
57
58
59
# File 'lib/reap/hosts/host.rb', line 50

def release_confirm?(options={})
  return true if force?
  ans = ask("Release to #{self.class.basename.downcase}?", "yN")
  case ans.downcase
  when 'y', 'yes'
    true
  else
    false
  end
end