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