summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-02-21 15:58:57 +0000
committerRobert Speicher <robert@gitlab.com>2018-02-21 15:58:57 +0000
commitdaf88307c0cb45199578a44b04f1f8302523ead2 (patch)
tree1e368ace98137b7d76639c42e9c076eb972c2f30
parent5d0cd8b6e990f2e23a7a2ae486b3aa0d83043b89 (diff)
parented0a029d53c5a62b49027a0b7192b97a0513787f (diff)
downloadgitlab-ce-daf88307c0cb45199578a44b04f1f8302523ead2.tar.gz
Merge branch '26039-Update-to-github-linguist5.3.x' into 'master'
Resolve "Update to github-linguist 5.3.x" Closes #26039 See merge request gitlab-org/gitlab-ce!17241
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock8
-rw-r--r--app/models/blob.rb2
-rw-r--r--changelogs/unreleased/26039-Update-to-github-linguist5-3-x.yml5
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb2
5 files changed, 12 insertions, 7 deletions
diff --git a/Gemfile b/Gemfile
index a05ca23f5eb..24c14365480 100644
--- a/Gemfile
+++ b/Gemfile
@@ -81,7 +81,7 @@ gem 'gollum-lib', '~> 4.2', require: false
gem 'gollum-rugged_adapter', '~> 0.4.4', require: false
# Language detection
-gem 'github-linguist', '~> 4.7.0', require: 'linguist'
+gem 'github-linguist', '~> 5.3.3', require: 'linguist'
# API
gem 'grape', '~> 1.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 8de6c8d80a8..32c35353a74 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -288,11 +288,11 @@ GEM
gitaly-proto (0.84.0)
google-protobuf (~> 3.1)
grpc (~> 1.0)
- github-linguist (4.7.6)
- charlock_holmes (~> 0.7.3)
+ github-linguist (5.3.3)
+ charlock_holmes (~> 0.7.5)
escape_utils (~> 1.1.0)
mime-types (>= 1.19)
- rugged (>= 0.23.0b)
+ rugged (>= 0.25.1)
github-markup (1.6.1)
gitlab-flowdock-git-hook (1.0.1)
flowdock (~> 0.7)
@@ -1058,7 +1058,7 @@ DEPENDENCIES
gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.2.0)
gitaly-proto (~> 0.84.0)
- github-linguist (~> 4.7.0)
+ github-linguist (~> 5.3.3)
gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-markup (~> 1.6.2)
gitlab-styles (~> 2.3)
diff --git a/app/models/blob.rb b/app/models/blob.rb
index 19ad110db58..71c974b4c09 100644
--- a/app/models/blob.rb
+++ b/app/models/blob.rb
@@ -160,7 +160,7 @@ class Blob < SimpleDelegator
if stored_externally?
if rich_viewer
rich_viewer.binary?
- elsif Linguist::Language.find_by_filename(name).any?
+ elsif Linguist::Language.find_by_extension(name).any?
false
elsif _mime_type
_mime_type.binary?
diff --git a/changelogs/unreleased/26039-Update-to-github-linguist5-3-x.yml b/changelogs/unreleased/26039-Update-to-github-linguist5-3-x.yml
new file mode 100644
index 00000000000..0f1cb2fef9d
--- /dev/null
+++ b/changelogs/unreleased/26039-Update-to-github-linguist5-3-x.yml
@@ -0,0 +1,5 @@
+---
+title: Update to github-linguist 5.3.x
+merge_request: 17241
+author: Ken Ding
+type: other
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index 0e9150964fa..67271d769a0 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -1590,7 +1590,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
expected_languages = [
{ value: 66.63, label: "Ruby", color: "#701516", highlight: "#701516" },
{ value: 22.96, label: "JavaScript", color: "#f1e05a", highlight: "#f1e05a" },
- { value: 7.9, label: "HTML", color: "#e44b23", highlight: "#e44b23" },
+ { value: 7.9, label: "HTML", color: "#e34c26", highlight: "#e34c26" },
{ value: 2.51, label: "CoffeeScript", color: "#244776", highlight: "#244776" }
]