Class: CreateGithubRelease::Assertions::InGitRepo
- Inherits:
-
CreateGithubRelease::AssertionBase
- Object
- CreateGithubRelease::AssertionBase
- CreateGithubRelease::Assertions::InGitRepo
- Defined in:
- lib/create_github_release/assertions/in_git_repo.rb
Overview
Assert that the current directory is a git repository
Checks both the local repository and the remote repository.
Instance Attribute Summary
Attributes inherited from CreateGithubRelease::AssertionBase
Instance Method Summary collapse
-
#assert
Make sure that the current directory is a git repository.
Methods inherited from CreateGithubRelease::AssertionBase
#backtick_debug?, #error, #initialize, #print, #puts
Methods included from BacktickDebug
Constructor Details
This class inherits a constructor from CreateGithubRelease::AssertionBase
Instance Method Details
#assert
This method returns an undefined value.
Make sure that the current directory is a git repository
34 35 36 37 38 39 40 41 42 |
# File 'lib/create_github_release/assertions/in_git_repo.rb', line 34 def assert print 'Checking that you are in a git repo...' `git rev-parse --is-inside-work-tree --quiet > /dev/null 2>&1` if $CHILD_STATUS.success? puts 'OK' else error 'You are not in a git repo' end end |