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.
50 lines
520 B
Ruby
50 lines
520 B
Ruby
# frozen_string_literal: true
|
|
|
|
module BlobLike
|
|
extend ActiveSupport::Concern
|
|
include Gitlab::BlobHelper
|
|
|
|
def id
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def name
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def path
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def size
|
|
0
|
|
end
|
|
|
|
def data
|
|
nil
|
|
end
|
|
|
|
def mode
|
|
nil
|
|
end
|
|
|
|
def binary?
|
|
false
|
|
end
|
|
|
|
def load_all_data!(repository)
|
|
# No-op
|
|
end
|
|
|
|
def truncated?
|
|
false
|
|
end
|
|
|
|
def external_storage
|
|
nil
|
|
end
|
|
|
|
def external_size
|
|
nil
|
|
end
|
|
end
|