Merge pull request #1712 from riyad/use-gem-for-emoji
Use gem for Emoji
							
								
								
									
										1
									
								
								Gemfile
								
								
								
								
							
							
						
						| 
						 | 
					@ -94,6 +94,7 @@ gem 'settingslogic'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Misc
 | 
					# Misc
 | 
				
			||||||
gem "foreman"
 | 
					gem "foreman"
 | 
				
			||||||
 | 
					gem 'gemoji', require: 'emoji/railtie'
 | 
				
			||||||
gem "git"
 | 
					gem "git"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
group :assets do
 | 
					group :assets do
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -140,6 +140,7 @@ GEM
 | 
				
			||||||
      sass-rails (>= 3.1.1)
 | 
					      sass-rails (>= 3.1.1)
 | 
				
			||||||
    foreman (0.47.0)
 | 
					    foreman (0.47.0)
 | 
				
			||||||
      thor (>= 0.13.6)
 | 
					      thor (>= 0.13.6)
 | 
				
			||||||
 | 
					    gemoji (1.1.1)
 | 
				
			||||||
    gherkin-ruby (0.2.1)
 | 
					    gherkin-ruby (0.2.1)
 | 
				
			||||||
    git (1.2.5)
 | 
					    git (1.2.5)
 | 
				
			||||||
    github-linguist (2.3.4)
 | 
					    github-linguist (2.3.4)
 | 
				
			||||||
| 
						 | 
					@ -422,6 +423,7 @@ DEPENDENCIES
 | 
				
			||||||
  ffaker
 | 
					  ffaker
 | 
				
			||||||
  font-awesome-sass-rails (~> 2.0.0)
 | 
					  font-awesome-sass-rails (~> 2.0.0)
 | 
				
			||||||
  foreman
 | 
					  foreman
 | 
				
			||||||
 | 
					  gemoji
 | 
				
			||||||
  git
 | 
					  git
 | 
				
			||||||
  github-linguist (~> 2.3.4)
 | 
					  github-linguist (~> 2.3.4)
 | 
				
			||||||
  github-markup (~> 0.7.4)
 | 
					  github-markup (~> 0.7.4)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -115,7 +115,7 @@ module ApplicationHelper
 | 
				
			||||||
  def emoji_autocomplete_source
 | 
					  def emoji_autocomplete_source
 | 
				
			||||||
    # should be an array of strings
 | 
					    # should be an array of strings
 | 
				
			||||||
    # so to_s can be called, because it is sufficient and to_json is too slow
 | 
					    # 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
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def ldap_enable?
 | 
					  def ldap_enable?
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +0,0 @@
 | 
				
			||||||
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
 | 
					    # Returns boolean
 | 
				
			||||||
    def valid_emoji?(emoji)
 | 
					    def valid_emoji?(emoji)
 | 
				
			||||||
      Emoji::NAMES.include? emoji
 | 
					      Emoji.names.include? emoji
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Private: Dispatches to a dedicated processing method based on reference
 | 
					    # Private: Dispatches to a dedicated processing method based on reference
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 5.0 KiB  | 
| 
		 Before Width: | Height: | Size: 5.0 KiB  | 
| 
		 Before Width: | Height: | Size: 3.2 KiB  | 
| 
		 Before Width: | Height: | Size: 3.6 KiB  | 
| 
		 Before Width: | Height: | Size: 4.6 KiB  | 
| 
		 Before Width: | Height: | Size: 4.0 KiB  | 
| 
		 Before Width: | Height: | Size: 3.1 KiB  | 
| 
		 Before Width: | Height: | Size: 3.8 KiB  | 
| 
		 Before Width: | Height: | Size: 4.1 KiB  | 
| 
		 Before Width: | Height: | Size: 4.4 KiB  | 
| 
		 Before Width: | Height: | Size: 4.6 KiB  | 
| 
		 Before Width: | Height: | Size: 3.4 KiB  | 
| 
		 Before Width: | Height: | Size: 4.6 KiB  | 
| 
		 Before Width: | Height: | Size: 6.9 KiB  | 
| 
		 Before Width: | Height: | Size: 5.3 KiB  | 
| 
		 Before Width: | Height: | Size: 3.6 KiB  | 
| 
		 Before Width: | Height: | Size: 4.4 KiB  | 
| 
		 Before Width: | Height: | Size: 6.5 KiB  | 
| 
		 Before Width: | Height: | Size: 3.0 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 2.8 KiB  | 
| 
		 Before Width: | Height: | Size: 5.5 KiB  | 
| 
		 Before Width: | Height: | Size: 5.0 KiB  | 
| 
		 Before Width: | Height: | Size: 4.2 KiB  | 
| 
		 Before Width: | Height: | Size: 3.1 KiB  | 
| 
		 Before Width: | Height: | Size: 3.1 KiB  | 
| 
		 Before Width: | Height: | Size: 3.5 KiB  | 
| 
		 Before Width: | Height: | Size: 2.9 KiB  | 
| 
		 Before Width: | Height: | Size: 2.9 KiB  | 
| 
		 Before Width: | Height: | Size: 3.1 KiB  | 
| 
		 Before Width: | Height: | Size: 3.4 KiB  | 
| 
		 Before Width: | Height: | Size: 3.4 KiB  | 
| 
		 Before Width: | Height: | Size: 3.0 KiB  | 
| 
		 Before Width: | Height: | Size: 3.3 KiB  | 
| 
		 Before Width: | Height: | Size: 3.3 KiB  | 
| 
		 Before Width: | Height: | Size: 3.0 KiB  | 
| 
		 Before Width: | Height: | Size: 3.6 KiB  | 
| 
		 Before Width: | Height: | Size: 3.0 KiB  | 
| 
		 Before Width: | Height: | Size: 3.5 KiB  | 
| 
		 Before Width: | Height: | Size: 3.1 KiB  | 
| 
		 Before Width: | Height: | Size: 3.2 KiB  | 
| 
		 Before Width: | Height: | Size: 3.2 KiB  | 
| 
		 Before Width: | Height: | Size: 1.4 KiB  | 
| 
		 Before Width: | Height: | Size: 4.7 KiB  | 
| 
		 Before Width: | Height: | Size: 6.6 KiB  | 
| 
		 Before Width: | Height: | Size: 2.9 KiB  | 
| 
		 Before Width: | Height: | Size: 5.9 KiB  | 
| 
		 Before Width: | Height: | Size: 4.0 KiB  | 
| 
		 Before Width: | Height: | Size: 3.0 KiB  | 
| 
		 Before Width: | Height: | Size: 5.8 KiB  | 
| 
		 Before Width: | Height: | Size: 4.4 KiB  | 
| 
		 Before Width: | Height: | Size: 3.9 KiB  | 
| 
		 Before Width: | Height: | Size: 2.9 KiB  | 
| 
		 Before Width: | Height: | Size: 3.4 KiB  | 
| 
		 Before Width: | Height: | Size: 2.2 KiB  | 
| 
		 Before Width: | Height: | Size: 1.8 KiB  | 
| 
		 Before Width: | Height: | Size: 4.6 KiB  | 
| 
		 Before Width: | Height: | Size: 3.8 KiB  | 
| 
		 Before Width: | Height: | Size: 1.4 KiB  | 
| 
		 Before Width: | Height: | Size: 5.5 KiB  | 
| 
		 Before Width: | Height: | Size: 2.4 KiB  | 
| 
		 Before Width: | Height: | Size: 4.2 KiB  | 
| 
		 Before Width: | Height: | Size: 5.9 KiB  | 
| 
		 Before Width: | Height: | Size: 6.2 KiB  | 
| 
		 Before Width: | Height: | Size: 3.1 KiB  | 
| 
		 Before Width: | Height: | Size: 2.7 KiB  | 
| 
		 Before Width: | Height: | Size: 3.7 KiB  | 
| 
		 Before Width: | Height: | Size: 5.4 KiB  | 
| 
		 Before Width: | Height: | Size: 6.0 KiB  | 
| 
		 Before Width: | Height: | Size: 6.4 KiB  | 
| 
		 Before Width: | Height: | Size: 5.1 KiB  | 
| 
		 Before Width: | Height: | Size: 2.7 KiB  | 
| 
		 Before Width: | Height: | Size: 4.7 KiB  | 
| 
		 Before Width: | Height: | Size: 5.6 KiB  | 
| 
		 Before Width: | Height: | Size: 6.3 KiB  | 
| 
		 Before Width: | Height: | Size: 4.6 KiB  | 
| 
		 Before Width: | Height: | Size: 3.8 KiB  | 
| 
		 Before Width: | Height: | Size: 4.8 KiB  | 
| 
		 Before Width: | Height: | Size: 5.3 KiB  | 
| 
		 Before Width: | Height: | Size: 2.3 KiB  | 
| 
		 Before Width: | Height: | Size: 3.8 KiB  | 
| 
		 Before Width: | Height: | Size: 2.3 KiB  | 
| 
		 Before Width: | Height: | Size: 1.3 KiB  | 
| 
		 Before Width: | Height: | Size: 4.1 KiB  | 
| 
		 Before Width: | Height: | Size: 3.7 KiB  | 
| 
		 Before Width: | Height: | Size: 5.0 KiB  | 
| 
		 Before Width: | Height: | Size: 4.0 KiB  | 
| 
		 Before Width: | Height: | Size: 4.0 KiB  | 
| 
		 Before Width: | Height: | Size: 5.1 KiB  | 
| 
		 Before Width: | Height: | Size: 4.7 KiB  | 
| 
		 Before Width: | Height: | Size: 3.7 KiB  | 
| 
		 Before Width: | Height: | Size: 5.1 KiB  | 
| 
		 Before Width: | Height: | Size: 5.9 KiB  | 
| 
		 Before Width: | Height: | Size: 4.6 KiB  | 
| 
		 Before Width: | Height: | Size: 3.1 KiB  |