Module: Avm::Git::Launcher::Base::Remotes
- Included in:
- Avm::Git::Launcher::Base
- Defined in:
- lib/avm/git/launcher/base/remotes.rb
Instance Method Summary collapse
- #assert_remote_url(remote_name, url) ⇒ Object
- #remote(name) ⇒ Avm::Git::Launcher::Remote
- #remote_branch_sha(remote_name, branch_name) ⇒ Object
- #remote_exist?(remote_name) ⇒ Boolean
- #remote_hashs(remote_name) ⇒ Object
Instance Method Details
#assert_remote_url(remote_name, url) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/avm/git/launcher/base/remotes.rb', line 24 def assert_remote_url(remote_name, url) r = git.remote(remote_name) if !r.url || r.url != url r.remove if r.url git.add_remote(remote_name, url) end r end |
#remote(name) ⇒ Avm::Git::Launcher::Remote
12 13 14 |
# File 'lib/avm/git/launcher/base/remotes.rb', line 12 def remote(name) ::Avm::Git::Launcher::Remote.new(self, name) end |
#remote_branch_sha(remote_name, branch_name) ⇒ Object
33 34 35 |
# File 'lib/avm/git/launcher/base/remotes.rb', line 33 def remote_branch_sha(remote_name, branch_name) remote_hashs(remote_name)["refs/heads/#{branch_name}"] end |
#remote_exist?(remote_name) ⇒ Boolean
20 21 22 |
# File 'lib/avm/git/launcher/base/remotes.rb', line 20 def remote_exist?(remote_name) remote(remote_name).exist? end |
#remote_hashs(remote_name) ⇒ Object
16 17 18 |
# File 'lib/avm/git/launcher/base/remotes.rb', line 16 def remote_hashs(remote_name) remote(remote_name).ls end |