Class: Reap::Systems::System

Inherits:
Tool
  • Object
show all
Includes:
Utilities
Defined in:
lib/reap/systems/system.rb

Overview

System

Source Control system base class.

Direct Known Subclasses

Svn

Instance Attribute Summary

Attributes inherited from Tool

#project

Class Method Summary collapse

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

Methods inherited from Tool

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

Constructor Details

This class inherits a constructor from Reap::Tool

Class Method Details

.detectObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/reap/systems/system.rb', line 39

def self.detect
  scm = %w(.svn .git .hg _darcs CVS).find{ |f| File.exist?(f) }
  case scm
  when '.svn'     then 'svn'
  when '.git'     then 'git'
  when 'CVS'      then 'cvs'
  when '_darcs'   then 'darcs'
  when '.hg'      then 'hg'
  end
end

.factory(name = nil) ⇒ Object



34
35
36
37
# File 'lib/reap/systems/system.rb', line 34

def self.factory(name=nil)
  name ||= detect
  registry[name]     
end

.inherited(base) ⇒ Object



30
31
32
# File 'lib/reap/systems/system.rb', line 30

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

.register(*names) ⇒ Object



26
27
28
# File 'lib/reap/systems/system.rb', line 26

def self.register(*names)
  registry[name] = self
end

.registryObject



22
23
24
# File 'lib/reap/systems/system.rb', line 22

def self.registry
  Systems.registry
end