From 47b739527a1d5a69b833691e66870ffcf4f2acbc Mon Sep 17 00:00:00 2001 From: Brandon Keepers Date: Fri, 28 Nov 2014 13:55:55 -0600 Subject: [PATCH] Treat lines as enumerator and not array --- lib/linguist/shebang.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/shebang.rb b/lib/linguist/shebang.rb index 7fa021cc..55481f69 100644 --- a/lib/linguist/shebang.rb +++ b/lib/linguist/shebang.rb @@ -34,7 +34,7 @@ module Linguist # Check for multiline shebang hacks that call `exec` if script == 'sh' && - lines[0...5].any? { |l| l.match(/exec (\w+).+\$0.+\$@/) } + lines.first(5).any? { |l| l.match(/exec (\w+).+\$0.+\$@/) } script = $1 end