def download_prepared_dump id
      name = "trunk-#{id}.dump"
      target_path = File.expand_path("../../fixtures/#{name}", __FILE__)
      
      puts "Accessing prepared DB test snapshot #{id} from S3."
      
      require 's3'
      service = S3::Service.new(:access_key_id => access_key_id, :secret_access_key => secret_access_key)
      bucket = service.buckets.find("cocoapods-org-testing-dumps")
      
      # Due to a bug in the s3 gem we are searching for the object via iterating.
      bucket.objects.each do |obj|
        if obj.key == name
          puts "Downloading prepared DB test snapshot #{id} from S3."
          File.open(target_path, 'w') do |file|
            file.write(obj.content)
          end
          break
        end
      end
      
      puts "Prepared DB test snapshot #{id} downloaded to #{target_path}"
    end
def download_prepared_dump id
      name = "trunk-#{id}.dump"
      target_path = File.expand_path("../../fixtures/#{name}", __FILE__)
      
      puts "Accessing prepared DB test snapshot #{id} from S3."
      
      require 's3'
      service = S3::Service.new(:access_key_id => access_key_id, :secret_access_key => secret_access_key)
      bucket = service.buckets.find("cocoapods-org-testing-dumps")
      
      # Due to a bug in the s3 gem we are searching for the object via iterating.
      bucket.objects.each do |obj|
        if obj.key == name
          puts "Downloading prepared DB test snapshot #{id} from S3."
          File.open(target_path, 'w') do |file|
            file.write(obj.content)
          end
          break
        end
      end
      
      puts "Prepared DB test snapshot #{id} downloaded to #{target_path}"
    end
Download prepared dump from S3 (needs credentials).