Class: PortVCS::VCS
- Inherits:
-
Object
- Object
- PortVCS::VCS
- Defined in:
- lib/portvcs/portvcs.rb
Overview
A wrapper for *Dumb classes
Instance Attribute Summary collapse
-
#sys ⇒ Object
Returns the value of attribute sys.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(sys) ⇒ VCS
constructor
sys – a class like CVSDumb.
- #open(p) ⇒ Object
Constructor Details
Instance Attribute Details
#sys ⇒ Object
Returns the value of attribute sys.
23 24 25 |
# File 'lib/portvcs/portvcs.rb', line 23 def sys @sys end |
Class Method Details
.select(type) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/portvcs/portvcs.rb', line 9 def self.select(type) case type when 'cvs' return CVSDumb else fail "unknown VCS '#{type}'" end end |
Instance Method Details
#open(p) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/portvcs/portvcs.rb', line 25 def open(p) s1 = s2 = @sys.new(p) if block_given? begin s1 = yield(s2) rescue fail $! ensure s2.close end end return s1 end |