From ed0a029d53c5a62b49027a0b7192b97a0513787f Mon Sep 17 00:00:00 2001 From: Ken Date: Wed, 21 Feb 2018 03:29:04 +1030 Subject: 26039 - update github-linguist to 5.3.3 version 26039 - add merge request id 26039 change due to lingust source file updates --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- app/models/blob.rb | 2 +- changelogs/unreleased/26039-Update-to-github-linguist5-3-x.yml | 5 +++++ spec/lib/gitlab/git/repository_spec.rb | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 changelogs/unreleased/26039-Update-to-github-linguist5-3-x.yml 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" } ] -- cgit v1.2.1