Module: GitUtils

Included in:
Toolbus
Defined in:
lib/utils.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#head_shaObject (readonly)

Returns the value of attribute head_sha.



16
17
18
# File 'lib/utils.rb', line 16

def head_sha
  @head_sha
end

#repo_urlObject (readonly)

Returns the value of attribute repo_url.



16
17
18
# File 'lib/utils.rb', line 16

def repo_url
  @repo_url
end

Instance Method Details

#git_status_clean?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/utils.rb', line 18

def git_status_clean?
  `git status -s`.length == 0
end

#latest_commit_online?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/utils.rb', line 22

def latest_commit_online?
  `git log --oneline $(git remote)/master...HEAD`.length == 0
end