Class: Ed::Repository
- Inherits:
-
Object
- Object
- Ed::Repository
- Defined in:
- lib/ed/repository.rb
Instance Attribute Summary collapse
-
#copy ⇒ Boolean
(also: #copy?)
readonly
Has the repository been copied?.
-
#path ⇒ String
readonly
The path to the repository on local disk.
Instance Method Summary collapse
- #checkout(*args) ⇒ void
-
#initialize(path, copy = true) ⇒ Repository
constructor
A new instance of Repository.
Constructor Details
#initialize(path, copy = true) ⇒ Repository
Returns a new instance of Repository.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ed/repository.rb', line 25 def initialize path, copy = true if copy @path = copy!(path.to_s) @copy = true else @path = path.to_s @copy = false end parent = Process.pid ObjectSpace.define_finalizer(self) do if parent == Process.pid FileUtils.rm_rf(@path) end end end |
Instance Attribute Details
#copy ⇒ Boolean (readonly) Also known as: copy?
Returns Has the repository been copied?.
15 16 17 |
# File 'lib/ed/repository.rb', line 15 def copy @copy end |
#path ⇒ String (readonly)
Returns The path to the repository on local disk.
9 10 11 |
# File 'lib/ed/repository.rb', line 9 def path @path end |
Instance Method Details
#checkout(*args) ⇒ void
This method returns an undefined value.
49 50 51 |
# File 'lib/ed/repository.rb', line 49 def checkout *args git "checkout", *args end |