Class: Soapstone::GitCommand
- Inherits:
-
Object
- Object
- Soapstone::GitCommand
- Defined in:
- lib/soapstone/core/git_command.rb
Class Method Summary collapse
Class Method Details
.current_branch ⇒ Object
16 17 18 |
# File 'lib/soapstone/core/git_command.rb', line 16 def self.current_branch `git rev-parse --abbrev-ref HEAD`.strip end |
.in_git_repository? ⇒ Boolean
4 5 6 |
# File 'lib/soapstone/core/git_command.rb', line 4 def self.in_git_repository? system("git rev-parse --git-dir > /dev/null 2>&1") end |
.staged_diff ⇒ Object
12 13 14 |
# File 'lib/soapstone/core/git_command.rb', line 12 def self.staged_diff `git diff --cached`.strip end |
.staged_files ⇒ Object
8 9 10 |
# File 'lib/soapstone/core/git_command.rb', line 8 def self.staged_files `git diff --cached --name-status`.strip end |