module Danger
  class EmojiMapper
    DATA = {
      "github" => {
        "no_entry_sign"    => "🚫",
        "warning"          => "⚠️",
        "book"             => "📖",
        "white_check_mark" => "✅"
      },
      "bitbucket_server" => {
        "no_entry_sign"    => "\u274C",
        "warning"          => "⚠️",
        "book"             => "\u2728",
        "white_check_mark" => "\u2705"
      }
    }.freeze

    def initialize(template)
      @template = DATA.include?(template) ? template : "github"
    end

    def map(emoji)
      emoji.delete! ":"
      DATA[template][emoji]
    end

    private

    attr_reader :template
  end
end

module Danger
  class EmojiMapper
    DATA = {
      "github" => {
        "no_entry_sign"    => "🚫",
        "warning"          => "⚠️",
        "book"             => "📖",
        "white_check_mark" => "✅"
      },
      "bitbucket_server" => {
        "no_entry_sign"    => ":no_entry_sign:",
        "warning"          => ":warning:",
        "book"             => ":book:",
        "white_check_mark" => ":white_check_mark:"
      }
    }.freeze

    def initialize(template)
      @template = DATA.include?(template) ? template : "github"
    end

    def map(emoji)
      emoji.delete! ":"
      DATA[template][emoji]
    end

    private

    attr_reader :template
  end
end

Use emoji shortcuts for bitbucket cloud
Use emoji shortcuts for bitbucket cloud

Using unicode emojis makes bitbucket render them as unicode emojis, and
browsers don't generally seem to support the unicode variation selector
16 - so the warning emoji turns up as a text symbol instead of an emoji
