From: Jean Privat Date: Fri, 8 May 2015 18:20:33 +0000 (-0400) Subject: lib/github: add `Comment::is_ack` to detect acknowledgments X-Git-Tag: v0.7.5~63^2~1 X-Git-Url: http://nitlanguage.org lib/github: add `Comment::is_ack` to detect acknowledgments Signed-off-by: Jean Privat --- diff --git a/lib/github/api.nit b/lib/github/api.nit index ea516fa..6f7c7d9 100644 --- a/lib/github/api.nit +++ b/lib/github/api.nit @@ -1016,6 +1016,12 @@ abstract class Comment # Comment body text. fun body: String do return json["body"].to_s + + # Does the comment contain an acknowledgement (+1) + fun is_ack: Bool + do + return body.has("\\+1\\b".to_re) or body.has(":+1:") or body.has(":shipit:") + end end # A comment made on a commit.