Class: KKGit::GitOps::Status

Inherits:
Struct
  • Object
show all
Defined in:
lib/kk/git/git_ops.rb

Overview

仓库同步状态快照

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#aheadObject

Returns the value of attribute ahead

Returns:

  • (Object)

    the current value of ahead



24
25
26
# File 'lib/kk/git/git_ops.rb', line 24

def ahead
  @ahead
end

#behindObject

Returns the value of attribute behind

Returns:

  • (Object)

    the current value of behind



24
25
26
# File 'lib/kk/git/git_ops.rb', line 24

def behind
  @behind
end

#branchObject

Returns the value of attribute branch

Returns:

  • (Object)

    the current value of branch



24
25
26
# File 'lib/kk/git/git_ops.rb', line 24

def branch
  @branch
end

#cleanObject

Returns the value of attribute clean

Returns:

  • (Object)

    the current value of clean



24
25
26
# File 'lib/kk/git/git_ops.rb', line 24

def clean
  @clean
end

#detachedObject

Returns the value of attribute detached

Returns:

  • (Object)

    the current value of detached



24
25
26
# File 'lib/kk/git/git_ops.rb', line 24

def detached
  @detached
end

#remoteObject

Returns the value of attribute remote

Returns:

  • (Object)

    the current value of remote



24
25
26
# File 'lib/kk/git/git_ops.rb', line 24

def remote
  @remote
end

#upstream_configuredObject

Returns the value of attribute upstream_configured

Returns:

  • (Object)

    the current value of upstream_configured



24
25
26
# File 'lib/kk/git/git_ops.rb', line 24

def upstream_configured
  @upstream_configured
end

Instance Method Details

#behind_remote?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/kk/git/git_ops.rb', line 37

def behind_remote?
  behind.positive?
end

#needs_sync?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/kk/git/git_ops.rb', line 29

def needs_sync?
  ahead.positive? || behind.positive?
end

#unpushed?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/kk/git/git_ops.rb', line 33

def unpushed?
  ahead.positive?
end