Class: Raykit::Git
- Inherits:
-
Object
- Object
- Raykit::Git
- Defined in:
- lib/raykit/git.rb
Instance Attribute Summary collapse
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Class Method Summary collapse
- .branch ⇒ Object
- .last_tag ⇒ Object
- .outstanding_commit ⇒ Object
- .user_can_commit ⇒ Object
- .user_email ⇒ Object
- .user_name ⇒ Object
Instance Attribute Details
#start_time ⇒ Object
Returns the value of attribute start_time.
3 4 5 |
# File 'lib/raykit/git.rb', line 3 def start_time @start_time end |
Class Method Details
.branch ⇒ Object
5 6 7 8 |
# File 'lib/raykit/git.rb', line 5 def self.branch branches = `git branch` branches.match(/ ([\w.]+)/).captures[0] end |
.last_tag ⇒ Object
10 11 12 |
# File 'lib/raykit/git.rb', line 10 def self.last_tag `git describe --abbrev=0 --tags`.strip end |
.outstanding_commit ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/raykit/git.rb', line 28 def self.outstanding_commit if(Git::user_can_commit) return !`git status`.include?('nothing to commit,') else return false end end |
.user_can_commit ⇒ Object
22 23 24 25 26 |
# File 'lib/raykit/git.rb', line 22 def self.user_can_commit return false if(user_name.length == 0) return false if(user_email.length == 0) return true end |
.user_email ⇒ Object
18 19 20 |
# File 'lib/raykit/git.rb', line 18 def self.user_email return `git config --get user.email`.strip end |
.user_name ⇒ Object
14 15 16 |
# File 'lib/raykit/git.rb', line 14 def self.user_name return `git config --get user.name`.strip end |