Class: NiceCommits::Notification
- Inherits:
-
Object
- Object
- NiceCommits::Notification
- Defined in:
- lib/nice_commits/notification.rb
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize(commit) ⇒ Notification
constructor
A new instance of Notification.
- #red(string) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(commit) ⇒ Notification
Returns a new instance of Notification.
3 4 5 |
# File 'lib/nice_commits/notification.rb', line 3 def initialize(commit) @commit = commit end |
Instance Method Details
#deliver ⇒ Object
7 8 9 |
# File 'lib/nice_commits/notification.rb', line 7 def deliver puts red(to_s) end |
#red(string) ⇒ Object
15 16 17 |
# File 'lib/nice_commits/notification.rb', line 15 def red(string) "\033[31m%s\033[0m" % string end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/nice_commits/notification.rb', line 11 def to_s "(WARNING) Invalid git commit message\nSHA: %s\n%s\n" % [@commit.sha, @commit.] end |