Skip to content
Browse files

#9: Don't hyperlink to github if variable not specified

  • Loading branch information...
1 parent 63bc684 commit 9458a6818bb580613c8ed0fd7da69fea31b5b252 @jrust jrust committed May 2, 2012
Showing with 14 additions and 9 deletions.
  1. +14 −9 lib/capistrano/notifier/mail.rb
View
23 lib/capistrano/notifier/mail.rb
@@ -68,11 +68,20 @@ def github
end
def html
- body.gsub(
- /([0-9a-f]{7})\.\.([0-9a-f]{7})/, "<a href=\"#{github_compare_prefix}/\\1...\\2\">\\1..\\2</a>"
- ).gsub(
- /^([0-9a-f]{7})/, "<a href=\"#{github_commit_prefix}/\\0\">\\0</a>"
- )
+ if gitub.nil?
+ body
+ else
+ body.gsub(
+ /([0-9a-f]{7})\.\.([0-9a-f]{7})/, "<a href=\"#{github_compare_prefix}/\\1...\\2\">\\1..\\2</a>"
+ ).gsub(
+ /^([0-9a-f]{7})/, "<a href=\"#{github_commit_prefix}/\\0\">\\0</a>"
+ )
+ end
+ end
+
+ def text
+ body.gsub(/([0-9a-f]{7})\.\.([0-9a-f]{7})/, "#{github_compare_prefix}/\\1...\\2") unless gitub.nil?
+ body
end
def notify_method
@@ -83,10 +92,6 @@ def subject
"#{application.titleize} branch #{branch} deployed to #{stage}"
end
- def text
- body.gsub(/([0-9a-f]{7})\.\.([0-9a-f]{7})/, "#{github_compare_prefix}/\\1...\\2")
- end
-
def to
cap.notifier_mail_options[:to]
end

0 comments on commit 9458a68

Please sign in to comment.
Something went wrong with that request. Please try again.