Commit c0073254 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #1712 from riyad/use-gem-for-emoji

Use gem for Emoji
parents 61e5fb6f ce910147
......@@ -94,6 +94,7 @@ gem 'settingslogic'
# Misc
gem "foreman"
gem 'gemoji', require: 'emoji/railtie'
gem "git"
group :assets do
......
......@@ -140,6 +140,7 @@ GEM
sass-rails (>= 3.1.1)
foreman (0.47.0)
thor (>= 0.13.6)
gemoji (1.1.1)
gherkin-ruby (0.2.1)
git (1.2.5)
github-linguist (2.3.4)
......@@ -422,6 +423,7 @@ DEPENDENCIES
ffaker
font-awesome-sass-rails (~> 2.0.0)
foreman
gemoji
git
github-linguist (~> 2.3.4)
github-markup (~> 0.7.4)
......
......@@ -115,7 +115,7 @@ module ApplicationHelper
def emoji_autocomplete_source
# should be an array of strings
# so to_s can be called, because it is sufficient and to_json is too slow
Emoji::NAMES.to_s
Emoji.names.to_s
end
def ldap_enable?
......
module Emoji
path = "#{Rails.root}/vendor/assets/images/emoji"
NAMES = Dir["#{path}/*.png"].sort.map {|f| File.basename(f, '.png')}
end
......@@ -128,7 +128,7 @@ module Gitlab
#
# Returns boolean
def valid_emoji?(emoji)
Emoji::NAMES.include? emoji
Emoji.names.include? emoji
end
# Private: Dispatches to a dedicated processing method based on reference
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment