lib/retweet.rb in streambot-0.2.4 vs lib/retweet.rb in streambot-0.2.5

- old
+ new

@@ -16,16 +16,14 @@ url = URI.parse("http://api.twitter.com/1/statuses/retweet/#{id}.json") req = Net::HTTP::Post.new(url.path) # set credentials req.basic_auth @auth[:username],@auth[:password] # connect - res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) } + res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req)} case res - when Net::HTTPSuccess, Net::HTTPRedirection - return res - else - # when connection wasn't successful print error message - puts res.error! + when Net::HTTPSuccess then return res + else + res.error! end end end \ No newline at end of file