From b1eba0e0700f8e4cc019259f39d586ce06dafc97 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 27 May 2011 12:50:59 -0500 Subject: [PATCH] Exclude files over 0.1MB from searches --- lib/linguist/blob_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 6cb1e6a5..d6bdcb10 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -209,13 +209,16 @@ module Linguist # Public: Should the blob be indexed for searching? # # Excluded: + # - Files over 0.1MB # - Non-text files # - Generated source files # - .po and .sql files # # Return true or false def indexable? - if !text? + if size > 100 * 1024 + false + elsif !text? false elsif generated? false