Class: EacGit::Local::Remote
- Inherits:
-
Object
- Object
- EacGit::Local::Remote
- Includes:
- RemoteLike
- Defined in:
- lib/eac_git/local/remote.rb,
lib/eac_git/local/remote/push.rb
Defined Under Namespace
Classes: Push
Constant Summary collapse
- NO_SUCH_REMOTE_CODE =
512
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#git_command(*args) ⇒ EacRubyUtils::Envs::Command
EacRubyUtils::Envs::Command.
- #push ⇒ EacGit::Local::Remote::Push
- #remote_reference ⇒ String
- #url ⇒ String?
- #url=(new_url) ⇒ String
Methods included from RemoteLike
Instance Method Details
#exist? ⇒ Boolean
16 17 18 |
# File 'lib/eac_git/local/remote.rb', line 16 def exist? url end |
#git_command(*args) ⇒ EacRubyUtils::Envs::Command
Returns EacRubyUtils::Envs::Command.
21 22 23 |
# File 'lib/eac_git/local/remote.rb', line 21 def git_command(*args) local.command(*args) end |
#push ⇒ EacGit::Local::Remote::Push
26 27 28 |
# File 'lib/eac_git/local/remote.rb', line 26 def push ::EacGit::Local::Remote::Push.new(self) end |
#remote_reference ⇒ String
31 32 33 |
# File 'lib/eac_git/local/remote.rb', line 31 def remote_reference name end |
#url ⇒ String?
36 37 38 39 40 |
# File 'lib/eac_git/local/remote.rb', line 36 def url local.command('remote', 'get-url', name) .execute!(exit_outputs: { NO_SUCH_REMOTE_CODE => nil }) .if_present(nil, &:strip) end |
#url=(new_url) ⇒ String
43 44 45 |
# File 'lib/eac_git/local/remote.rb', line 43 def url=(new_url) local.command('remote', 'set-url', name, new_url).execute! end |