Class: Bob::SCM::Abstract
- Inherits:
-
Object
- Object
- Bob::SCM::Abstract
- Defined in:
- lib/bob/scm/abstract.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#dir_for(commit) ⇒ Object
Directory where the code will be checked out for the given
commit
. -
#initialize(uri, branch) ⇒ Abstract
constructor
A new instance of Abstract.
-
#with_commit(commit) {|commit| ... } ⇒ Object
Checkout the code at the specified
commit
and call the passed block.
Constructor Details
#initialize(uri, branch) ⇒ Abstract
Returns a new instance of Abstract.
6 7 8 9 |
# File 'lib/bob/scm/abstract.rb', line 6 def initialize(uri, branch) @uri = Addressable::URI.parse(uri) @branch = branch end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
4 5 6 |
# File 'lib/bob/scm/abstract.rb', line 4 def branch @branch end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
4 5 6 |
# File 'lib/bob/scm/abstract.rb', line 4 def uri @uri end |
Instance Method Details
#dir_for(commit) ⇒ Object
Directory where the code will be checked out for the given commit
.
21 22 23 |
# File 'lib/bob/scm/abstract.rb', line 21 def dir_for(commit) Bob.directory.join(path, resolve(commit)) end |
#with_commit(commit) {|commit| ... } ⇒ Object
Checkout the code at the specified commit
and call the passed block.
13 14 15 16 17 |
# File 'lib/bob/scm/abstract.rb', line 13 def with_commit(commit) commit = resolve(commit) checkout(commit) yield(commit) end |