Sha256: 4fe4ebc121ddf0011ce998fbbb51c39c12bae2071ec0acf94f6b1a1f8283fc7e
Contents?: true
Size: 1.18 KB
Versions: 6
Compression:
Stored size: 1.18 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:|:hankey:/ 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
6 entries across 6 versions & 1 rubygems