Class: Silo::Remote::Git
Overview
This class represents a standard Git remote attached to the Git repository backing the Silo repository
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#add ⇒ Object
Adds this remote as a mirror to the backing Git repository.
-
#initialize(repo, name, url) ⇒ Git
constructor
Creates a new Git remote.
-
#push ⇒ Object
Pushes the current history of the repository to the remote repository using
git push
. -
#remove ⇒ Object
Removes this remote from the backing Git repository.
Constructor Details
#initialize(repo, name, url) ⇒ Git
Creates a new Git remote
24 25 26 27 28 |
# File 'lib/silo/remote/git.rb', line 24 def initialize(repo, name, url) super repo, name @url = url end |
Instance Method Details
#add ⇒ Object
Adds this remote as a mirror to the backing Git repository
31 32 33 |
# File 'lib/silo/remote/git.rb', line 31 def add @repo.git.git.remote({}, 'add', '--mirror', @name, @url) end |
#push ⇒ Object
Pushes the current history of the repository to the remote repository
using git push
37 38 39 |
# File 'lib/silo/remote/git.rb', line 37 def push @repo.git.git.push({}, @name) end |
#remove ⇒ Object
Removes this remote from the backing Git repository
42 43 44 |
# File 'lib/silo/remote/git.rb', line 42 def remove @repo.git.git.remote({}, 'rm', @name) end |