lib/fiveruns/dash/update.rb in fiveruns-dash-ruby-0.7.6 vs lib/fiveruns/dash/update.rb in fiveruns-dash-ruby-0.8.0

- old
+ new

@@ -95,11 +95,16 @@ def timestamp Time.now.utc.strftime('%Y%m%d%H%M%S') end def uris_by_scheme(urls) - urls.map { |url| safe_parse(url) }.group_by(&:scheme) + safe = urls.map { |url| safe_parse(url) } + safe.inject({}) do |mapping, url| + mapping[url.scheme] ||= [] + mapping[url.scheme] << url + mapping + end end def storage_method_for(scheme) scheme =~ /^http/ ? :http : :file end @@ -116,13 +121,13 @@ @version = Fiveruns::Dash::Version::STRING @data = data end def io - returning StringIO.new do |io| - io.write compressed - io.rewind - end + io = StringIO.new + io.write compressed + io.rewind + io end def params {} end \ No newline at end of file