From 31541f7cade9886de8617b46e4ad698cc9edfa55 Mon Sep 17 00:00:00 2001 From: Robert Gerus Date: Sun, 9 Mar 2014 19:59:42 +0100 Subject: [PATCH] be consistent. --- plugins/scrape.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/scrape.rb b/plugins/scrape.rb index 26fa03f..0f9e82a 100644 --- a/plugins/scrape.rb +++ b/plugins/scrape.rb @@ -3,15 +3,15 @@ require 'digest/md5' include EventMachine::IRC::Commands -Client.register_trigger("PRIVMSG") { |msg| - msg[:params].each { |word| +Client.register_trigger("PRIVMSG") do |msg| + msg[:params].each do |word| if word =~ /4cdn[.]org/ then ext = "." + word.sub(/.*[.]([^.]*)/, '\1') if word.match(/[^.]+[.][^.]+/) content = open(word).read md5 = Digest::MD5.hexdigest(content) - File.open(Config[:scrape][:basepath] + md5 + ext, 'w') { |file| + File.open(Config[:scrape][:basepath] + md5 + ext, 'w') do |file| file.write(content) - } + end end - } -} + end +end