Class: DependencyWiring::SCM
- Inherits:
-
Object
- Object
- DependencyWiring::SCM
- Includes:
- ShellCommand, Wiring
- Defined in:
- lib/dependency_wiring/scm.rb
Instance Attribute Summary collapse
-
#opts ⇒ Object
Returns the value of attribute opts.
Attributes included from Wiring
Instance Method Summary collapse
-
#default_opts ⇒ Object
def update end.
-
#initialize(src, dest, opts = {}) ⇒ SCM
constructor
A new instance of SCM.
- #prepare_dest ⇒ Object
Methods included from Wiring
Constructor Details
#initialize(src, dest, opts = {}) ⇒ SCM
Returns a new instance of SCM.
10 11 12 13 |
# File 'lib/dependency_wiring/scm.rb', line 10 def initialize(src, dest, opts = {}) super(src, dest) @opts = default_opts().merge(opts) end |
Instance Attribute Details
#opts ⇒ Object
Returns the value of attribute opts.
9 10 11 |
# File 'lib/dependency_wiring/scm.rb', line 9 def opts @opts end |
Instance Method Details
#default_opts ⇒ Object
def update end
24 25 26 |
# File 'lib/dependency_wiring/scm.rb', line 24 def default_opts {} end |
#prepare_dest ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/dependency_wiring/scm.rb', line 28 def prepare_dest if File.exists?(@dest) && File.directory?(@dest) unless valid_destination? raise("#{@dest} doesn't seems to be a working copy.") end else super() begin clone rescue Exception => e Dir.delete(@dest) if File.exists?(@dest) && File.directory?(@dest) raise e end end end |