Skip to content

Commit

Permalink
Pass &:path as an argument, instead of a block
Browse files Browse the repository at this point in the history
  • Loading branch information
mmozuras committed Oct 14, 2014
1 parent 32f7971 commit 861f335
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/pronto/formatter/checkstyle_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@ def open_xml
end

def process_messages(messages)
group_messages(messages).map do |path, path_messages|
messages.group_by(&:path).map do |path, path_messages|
REXML::Element.new('file', @checkstyle).tap do |file|
file.attributes['name'] = path
add_file_messages(path_messages, file)
end
end
end

def group_messages(messages)
messages.group_by { |message| message.path }
end

def add_file_messages(path_messages, file)
path_messages.each do |message|
REXML::Element.new('error', file).tap do |e|
Expand Down

0 comments on commit 861f335

Please sign in to comment.