Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2018-09-11 07:37:44 +0300
committerMark Chao <mchao@gitlab.com>2018-10-30 10:44:55 +0300
commitbc14e4ed1024efa1e0a411bd59e1339fb1af20c0 (patch)
tree249ac6ce57b9758d3472dd4b1319527636b72f44 /app/models
parent39ae9a59a59615092fbef189466f37c34f4a7fb1 (diff)
Move :plain option to Highlight class
This is to DRY the repeated file size check. Move spec and constants to Highlight
Diffstat (limited to 'app/models')
-rw-r--r--app/models/blob.rb6
1 files changed, 0 insertions, 6 deletions
diff --git a/app/models/blob.rb b/app/models/blob.rb
index 425ba69c073..57c813e3775 100644
--- a/app/models/blob.rb
+++ b/app/models/blob.rb
@@ -7,8 +7,6 @@ class Blob < SimpleDelegator
CACHE_TIME = 60 # Cache raw blobs referred to by a (mutable) ref for 1 minute
CACHE_TIME_IMMUTABLE = 3600 # Cache blobs referred to by an immutable reference for 1 hour
- MAXIMUM_TEXT_HIGHLIGHT_SIZE = 1.megabyte
-
# Finding a viewer for a blob happens based only on extension and whether the
# blob is binary or text, which means 1 blob should only be matched by 1 viewer,
# and the order of these viewers doesn't really matter.
@@ -123,10 +121,6 @@ class Blob < SimpleDelegator
end
end
- def no_highlighting?
- raw_size && raw_size > MAXIMUM_TEXT_HIGHLIGHT_SIZE
- end
-
def empty?
raw_size == 0
end