Module: Kamal::Git
Instance Method Summary collapse
- #email ⇒ Object
- #revision ⇒ Object
- #root ⇒ Object
- #uncommitted_changes ⇒ Object
-
#uncommitted_files ⇒ Object
returns an array of relative path names of files with uncommitted changes.
-
#untracked_files ⇒ Object
returns an array of relative path names of untracked files, including gitignored files.
- #used? ⇒ Boolean
- #user_name ⇒ Object
Instance Method Details
#email ⇒ Object
12 13 14 |
# File 'lib/kamal/git.rb', line 12 def email `git config user.email`.strip end |
#revision ⇒ Object
16 17 18 |
# File 'lib/kamal/git.rb', line 16 def revision `git rev-parse HEAD`.strip end |
#root ⇒ Object
24 25 26 |
# File 'lib/kamal/git.rb', line 24 def root `git rev-parse --show-toplevel`.strip end |
#uncommitted_changes ⇒ Object
20 21 22 |
# File 'lib/kamal/git.rb', line 20 def uncommitted_changes `git status --porcelain`.strip end |
#uncommitted_files ⇒ Object
returns an array of relative path names of files with uncommitted changes
29 30 31 |
# File 'lib/kamal/git.rb', line 29 def uncommitted_files `git ls-files --modified`.lines.map(&:strip) end |
#untracked_files ⇒ Object
returns an array of relative path names of untracked files, including gitignored files
34 35 36 |
# File 'lib/kamal/git.rb', line 34 def untracked_files `git ls-files --others`.lines.map(&:strip) end |
#used? ⇒ Boolean
4 5 6 |
# File 'lib/kamal/git.rb', line 4 def used? system("git rev-parse") end |
#user_name ⇒ Object
8 9 10 |
# File 'lib/kamal/git.rb', line 8 def user_name `git config user.name`.strip end |