Created
April 8, 2014 22:45
-
-
Save samrocketman/10204370 to your computer and use it in GitHub Desktop.
Revert GitLab back to gemoji
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Gemfile b/Gemfile | |
index 195de7b..84bb745 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -164,7 +164,7 @@ gem "jquery-ui-rails", "2.0.2" | |
gem "raphael-rails", "~> 2.1.2" | |
gem 'bootstrap-sass', '~> 3.0' | |
gem "font-awesome-rails", '~> 3.2' | |
-gem "gitlab_emoji", "~> 0.0.1.1" | |
+gem "gemoji", "~> 1.3.0" | |
gem "gon", '~> 5.0.0' | |
gem 'nprogress-rails' | |
diff --git a/Gemfile.lock b/Gemfile.lock | |
index e092482..c6eb5f1 100644 | |
--- a/Gemfile.lock | |
+++ b/Gemfile.lock | |
@@ -128,8 +128,6 @@ GEM | |
mail (~> 2.2) | |
email_validator (1.4.0) | |
activemodel | |
- emoji (1.0.1) | |
- json | |
enumerize (0.7.0) | |
activesupport (>= 3.2) | |
equalizer (0.0.8) | |
@@ -167,6 +165,7 @@ GEM | |
formatador (0.2.4) | |
gemnasium-gitlab-service (0.2.1) | |
rugged (~> 0.19) | |
+ gemoji (1.3.1) | |
gherkin-ruby (0.3.1) | |
racc | |
github-markdown (0.5.5) | |
@@ -191,8 +190,6 @@ GEM | |
charlock_holmes (~> 0.6.6) | |
escape_utils (~> 0.2.4) | |
mime-types (~> 1.19) | |
- gitlab_emoji (0.0.1.1) | |
- emoji (~> 1.0.1) | |
gitlab_git (5.7.1) | |
activesupport (~> 4.0.0) | |
charlock_holmes (~> 0.6.9) | |
@@ -594,12 +591,12 @@ DEPENDENCIES | |
font-awesome-rails (~> 3.2) | |
foreman | |
gemnasium-gitlab-service (~> 0.2) | |
+ gemoji (~> 1.3.0) | |
github-markup (~> 0.7.4)! | |
gitlab-flowdock-git-hook (~> 0.4.2) | |
gitlab-gollum-lib (~> 1.1.0) | |
gitlab-grack (~> 2.0.0.pre) | |
gitlab-linguist (~> 3.0.0) | |
- gitlab_emoji (~> 0.0.1.1) | |
gitlab_git (~> 5.7.1) | |
gitlab_meta (= 6.0) | |
gitlab_omniauth-ldap (= 1.0.4) | |
diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml | |
index fd6097d..6a20ded 100644 | |
--- a/app/views/layouts/_init_auto_complete.html.haml | |
+++ b/app/views/layouts/_init_auto_complete.html.haml | |
@@ -1,4 +1,4 @@ | |
:javascript | |
GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_project_path(@project)}" | |
- GitLab.GfmAutoComplete.Emoji.assetBase = "#{Gitlab.config.gitlab.relative_url_root + Emoji.asset_path}" | |
+ GitLab.GfmAutoComplete.Emoji.assetBase = "#{Gitlab.config.gitlab.relative_url_root + '/assets/emoji'}" | |
GitLab.GfmAutoComplete.setup(); | |
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml | |
index 81bf061..217e36e 100644 | |
--- a/app/views/projects/notes/_note.html.haml | |
+++ b/app/views/projects/notes/_note.html.haml | |
@@ -23,7 +23,7 @@ | |
%i.icon-thumbs-up | |
\+1 | |
- if note.downvote? | |
- %span.vote.downvote.label.label-danger | |
+ %span.vote.downvote.label.label-error | |
%i.icon-thumbs-down | |
\-1 | |
diff --git a/config/initializers/gemoji.rb b/config/initializers/gemoji.rb | |
new file mode 100644 | |
index 0000000..6cc33ac | |
--- /dev/null | |
+++ b/config/initializers/gemoji.rb | |
@@ -0,0 +1,3 @@ | |
+# Workaround for https://github.com/github/gemoji/pull/18 | |
+require 'gemoji' | |
+Gitlab::Application.config.assets.paths << Emoji.images_path | |
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb | |
index 80bb008..e72f4f5 100644 | |
--- a/lib/gitlab/markdown.rb | |
+++ b/lib/gitlab/markdown.rb | |
@@ -152,7 +152,7 @@ module Gitlab | |
# | |
# Returns boolean | |
def valid_emoji?(emoji) | |
- Emoji.find_by_name emoji | |
+ Emoji.names.include? emoji | |
end | |
# Private: Dispatches to a dedicated processing method based on reference |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to apply this patch:
patch -p1 < ../gemoji.patch