Sha256: 3aa173ec78eaf287f39fb4b155f20dbf405ca3e677c2c991f8024def659506c6
Contents?: true
Size: 1.17 KB
Versions: 11
Compression:
Stored size: 1.17 KB
Contents
module Lita module GithubPrList class Status attr_accessor :comment, :status, :pass_regex, :review_regex, :fail_regex, :fixed_regex PASS_REGEX = /:elephant: :elephant: :elephant:/ REVIEW_REGEX = /:book:/ FAIL_REGEX = /:poop:/ FIXED_REGEX = /:wave:/ PASS_EMOJI = "(elephant)(elephant)(elephant)" REVIEW_EMOJI = "(book)" FAIL_EMOJI = "(poop)" FIXED_EMOJI = "(wave)" def initialize(params = {}) self.comment = params.fetch(:comment, nil) self.status = params.fetch(:status, {}) raise "invalid params in #{self.class.name}" if comment.nil? end def comment_status case self.comment when PASS_REGEX status[:emoji] = PASS_EMOJI status[:status] = "Passed" when REVIEW_REGEX status[:emoji] = REVIEW_EMOJI status[:status] = "In Review" when FAIL_REGEX status[:emoji] = FAIL_EMOJI status[:status] = "Failed" when FIXED_REGEX status[:emoji] = FIXED_EMOJI status[:status] = "Fixed" end status end end end end
Version data entries
11 entries across 11 versions & 1 rubygems