399056ed78
This saves about 128 MB of baseline RAM usage per Unicorn and
Sidekiq process (!).
Linguist wasn't detecting languages anymore from CE/EE since
9ae8b57467
. However, Linguist::BlobHelper
was still being depended on by BlobLike and others.
This removes the Linguist gem, given it isn't required anymore.
EscapeUtils were pulled in as dependency, but given Banzai depends on
it, it is now added explicitly.
Previously, Linguist was used to detect the best ACE mode. Instead,
we rely on ACE to guess the best mode based on the file extension.
22 lines
561 B
Ruby
22 lines
561 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
describe Gitlab::LanguageData do
|
|
describe '#extensions' do
|
|
before do
|
|
described_class.clear_extensions!
|
|
end
|
|
|
|
it 'loads the extensions once' do
|
|
expect(YAML).to receive(:load_file).once.and_call_original
|
|
|
|
2.times do
|
|
expect(described_class.extensions).to be_a(Set)
|
|
expect(described_class.extensions.count).to be > 0
|
|
# Sanity check for known extensions
|
|
expect(described_class.extensions).to include(*%w(.rb .yml .json))
|
|
end
|
|
end
|
|
end
|
|
end
|