Be better about looking for warnings on Travis

This commit is contained in:
Elliot Winkler 2014-11-20 12:33:10 -07:00
parent ab08fef63e
commit b4082877fd
2 changed files with 12 additions and 5 deletions

View File

@ -13,9 +13,7 @@ class WarningsSpy
def partition
@relevant_warning_groups, @irrelevant_warning_groups =
warning_groups.partition do |group|
group.any? { |line| line.include?(search_text) }
end
warning_groups.partition { |group| relevant_warnings?(group) }
end
protected
@ -25,5 +23,14 @@ class WarningsSpy
private
def_delegators :reader, :warning_groups
def relevant_warnings?(group)
first_line = group[0]
first_line.start_with?("#{project_root}/lib")
end
def project_root
File.expand_path('../../..')
end
end
end

View File

@ -28,14 +28,14 @@ class WarningsSpy
def process_line(line)
if start_of_group?(line)
add_group(current_group)
current_group.clear
@current_group = []
end
current_group << line
end
def start_of_group?(line)
line =~ /^\W/
line =~ /^\S/
end
def add_group(group)