Created
October 27, 2016 22:06
-
-
Save theist/342fc1c826814c54a999f48a345e097a to your computer and use it in GitHub Desktop.
rspec sample 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'excon' | |
# Cargamos los datos de redirecciones | |
csv_data = CSV(File.open('redirects.csv').read).read | |
#borramos la columna de encabezado | |
csv_data.delete_at(0) | |
# Configuramos excon para que no verifique el SSL y tenga un timeout bajo | |
Excon.defaults[:ssl_verify_peer] = false | |
Excon.defaults[:read_timeout] = 10 | |
csv_data.each do |redirect| | |
# trabajamos con el tipico CSV "origen -> destino" | |
origin = redirect[0] | |
destination = redirect[1] | |
# Code! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment