Class: Rugged::Repository
- Inherits:
-
Object
- Object
- Rugged::Repository
- Defined in:
- lib/lyp/git_based_rugged.rb
Defined Under Namespace
Classes: Ref
Class Method Summary collapse
Instance Method Summary collapse
- #checkout(ref, opts) ⇒ Object
- #exec(cmd) ⇒ Object
- #head ⇒ Object
-
#initialize(path) ⇒ Repository
constructor
A new instance of Repository.
- #tags ⇒ Object
Constructor Details
#initialize(path) ⇒ Repository
Returns a new instance of Repository.
18 19 20 21 |
# File 'lib/lyp/git_based_rugged.rb', line 18 def initialize(path) @path = path exec('status') end |
Class Method Details
.clone_at(url, path) ⇒ Object
13 14 15 16 |
# File 'lib/lyp/git_based_rugged.rb', line 13 def self.clone_at(url, path) `git clone -q \"#{url}\" \"#{path}\"` new(path) end |
Instance Method Details
#checkout(ref, opts) ⇒ Object
31 32 33 34 |
# File 'lib/lyp/git_based_rugged.rb', line 31 def checkout(ref, opts) # strategy: :force exec("checkout -qf #{ref}") end |
#exec(cmd) ⇒ Object
40 41 42 |
# File 'lib/lyp/git_based_rugged.rb', line 40 def exec(cmd) `cd #{@path} && git #{cmd}` end |