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



22
23
24
# File 'lib/kk/git/git_ops.rb', line 22

def ahead
  @ahead
end

#behindObject

Returns the value of attribute behind

Returns:

  • (Object)

    the current value of behind



22
23
24
# File 'lib/kk/git/git_ops.rb', line 22

def behind
  @behind
end

#branchObject

Returns the value of attribute branch

Returns:

  • (Object)

    the current value of branch



22
23
24
# File 'lib/kk/git/git_ops.rb', line 22

def branch
  @branch
end

#cleanObject

Returns the value of attribute clean

Returns:

  • (Object)

    the current value of clean



22
23
24
# File 'lib/kk/git/git_ops.rb', line 22

def clean
  @clean
end

#detachedObject

Returns the value of attribute detached

Returns:

  • (Object)

    the current value of detached



22
23
24
# File 'lib/kk/git/git_ops.rb', line 22

def detached
  @detached
end

#remoteObject

Returns the value of attribute remote

Returns:

  • (Object)

    the current value of remote



22
23
24
# File 'lib/kk/git/git_ops.rb', line 22

def remote
  @remote
end

#upstream_configuredObject

Returns the value of attribute upstream_configured

Returns:

  • (Object)

    the current value of upstream_configured



22
23
24
# File 'lib/kk/git/git_ops.rb', line 22

def upstream_configured
  @upstream_configured
end

Instance Method Details

#behind_remote?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/kk/git/git_ops.rb', line 35

def behind_remote?
  behind.positive?
end

#needs_sync?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/kk/git/git_ops.rb', line 27

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

#unpushed?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/kk/git/git_ops.rb', line 31

def unpushed?
  ahead.positive?
end