Class: Reap::Systems::System
- Includes:
- Utilities
- Defined in:
- lib/reap/systems/system.rb
Overview
System
Source Control system base class.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Tool
Class Method Summary collapse
- .detect ⇒ Object
- .factory(name = nil) ⇒ Object
- .inherited(base) ⇒ Object
- .register(*names) ⇒ Object
- .registry ⇒ Object
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
.detect ⇒ Object
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 |