Class: EacGit::Local::Remote

Inherits:
Object
  • Object
show all
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

Methods included from RemoteLike

#fetch, #ls

Instance Method Details

#exist?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/eac_git/local/remote.rb', line 13

def exist?
  url
end

#git_command(*args) ⇒ EacRubyUtils::Envs::Command

Returns EacRubyUtils::Envs::Command.

Returns:

  • (EacRubyUtils::Envs::Command)

    EacRubyUtils::Envs::Command



18
19
20
# File 'lib/eac_git/local/remote.rb', line 18

def git_command(*args)
  local.command(*args)
end

#pushEacGit::Local::Remote::Push



23
24
25
# File 'lib/eac_git/local/remote.rb', line 23

def push
  ::EacGit::Local::Remote::Push.new(self)
end

#remote_referenceString

Returns:

  • (String)


28
29
30
# File 'lib/eac_git/local/remote.rb', line 28

def remote_reference
  name
end

#urlString?

Returns:

  • (String, nil)


33
34
35
36
37
# File 'lib/eac_git/local/remote.rb', line 33

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

Returns:

  • (String)


40
41
42
# File 'lib/eac_git/local/remote.rb', line 40

def url=(new_url)
  local.command('remote', 'set-url', name, new_url).execute!
end