lib/omgili_aggregator.rb
# Used for testing with smaller datasets if you have limited RAM
Used for testing with smaller datasets if you have limited RAM
Used for testing with smaller datasets if you have limited RAM
def limit_download_size(megabytes, download_list)
  return download_list if download_list_size(download_list) < megabytes.to_f
  total_size = 0.0
  count = -1
  results = []
  while total_size < megabytes.to_f
    results.push(download_list[count += 1])
    total_size += download_list[count].size
  end
  results
end
def limit_download_size ( megabytes , download_list ) return download_list if download_list_size ( download_list ) < megabytes . to_f total_size = 0.0 count = - 1 results = [ ] while total_size < megabytes . to_f results . push ( download_list [ count += 1 ] ) total_size += download_list [ count ] . size end results end
Used for testing with smaller datasets if you have limited RAM
Used for testing with smaller datasets if you have limited RAM
megabytes
<not_specific>
download_list
<not_specific>