From 68793b1f0f514c388055b21372eafa1eb183d861 Mon Sep 17 00:00:00 2001 From: Nayeem Syed Date: Sat, 8 Mar 2014 08:12:18 +0000 Subject: [PATCH] added check for extension and line count on vcr_cassette? in generated --- lib/linguist/generated.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/linguist/generated.rb b/lib/linguist/generated.rb index f02e9b20..5c3de141 100644 --- a/lib/linguist/generated.rb +++ b/lib/linguist/generated.rb @@ -241,6 +241,8 @@ module Linguist # # Returns true or false def vcr_cassette? + return false unless extname == '.yml' + return false unless lines.count > 2 # VCR Cassettes have "recorded_with: VCR" in the second last line. return lines[-2].include?("recorded_with: VCR") end