Skip to content

Instantly share code, notes, and snippets.

@jmercedes
Last active August 29, 2015 13:55
Show Gist options
  • Select an option

  • Save jmercedes/8789546 to your computer and use it in GitHub Desktop.

Select an option

Save jmercedes/8789546 to your computer and use it in GitHub Desktop.
# Configure the class responsible to send e-mails.
config.mailer = 'Devise::Mailer'
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
CmpcLabV1::Application.initialize!
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com',
:enable_starttls_auto => true
}
def self.generate_from_xml
xml = open("https://s3.amazonaws.com/bionuclear/154948_Tabla2.xml")
document = Nokogiri::XML(xml)
articles = document.css('ARTICULOS')
articles.each do |result|
email = result.css('email').first.content
patient = result.css('nombre_paciente').first.content
age = result.css('edad').first.content
insurance_plan = result.css('Aseguradora').first.content
gender = result.css('Sexo').first.content
generated_password = Devise.friendly_token.first(8)
user = User.where(:email => email).first_or_create(:email => email, :password => 'prueba123')
user.results.create!(patient: patient, gender: gender, insurance_plan: insurance_plan, age: age)
# user = User.first_or_create(:email => email)
# user = User.create!(email: email, :password => generated_password)
# User.where(:email => email) do |user|
# user.result.create!(patient: patient, gender: gender, insurance_plan: insurance_plan, age: age)
# end
end
end
2014-02-03T18:03:30.211984+00:00 heroku[router]: at=info method=GET path=/ host=cmpc-lab-v2.herokuapp.com request_id=1d8cd4c8-7cc8-469c-b1a5-d574e87593c2 fwd="190.166.175.131" dyno=web.1 connect=12ms service=810ms status=302 bytes=112
2014-02-03T18:03:32.318640+00:00 heroku[router]: at=info method=GET path=/assets/application-dc08e2457d7abcce4c9c08e578188223.js host=cmpc-lab-v2.herokuapp.com request_id=6b33f08c-c49e-4916-8665-b82cef10532d fwd="190.166.175.131" dyno=web.1 connect=5ms service=23ms status=200 bytes=163923
2014-02-03T18:03:39.030153+00:00 heroku[router]: at=info method=GET path=/assets/testimonial-bg-ad88c654b33cee6f7b3be534ea5bc933.jpg host=cmpc-lab-v2.herokuapp.com request_id=0f580059-24f7-4ddb-a843-8ffef070f99c fwd="190.166.175.131" dyno=web.1 connect=4ms service=15ms status=200 bytes=101299
2014-02-03T18:03:39.072306+00:00 heroku[router]: at=info method=GET path=/assets/glyphicons-halflings-7eb193615ec1fe31f5bc9026084e1032.png host=cmpc-lab-v2.herokuapp.com request_id=1b6a5434-0f27-4e2e-98f4-eabe26e5987f fwd="190.166.175.131" dyno=web.1 connect=5ms service=10ms status=200 bytes=12799
2014-02-03T18:03:43.221742+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=cmpc-lab-v2.herokuapp.com request_id=953e4bab-9550-4a04-878f-8f1f06ffd0f4 fwd="190.166.175.131" dyno=web.1 connect=27ms service=56ms status=200 bytes=0
2014-02-03T18:20:39+00:00 heroku[slug-compiler]: Slug compilation started
2014-02-03T18:21:01+00:00 heroku[slug-compiler]: Slug compilation finished
2014-02-03T18:21:01.381615+00:00 heroku[web.1]: State changed from up to starting
2014-02-03T18:21:04.424679+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-02-03T18:21:05.712054+00:00 app[web.1]: Exiting
2014-02-03T18:21:07.082686+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 56383 -e $RAILS_ENV`
2014-02-03T18:21:07.456300+00:00 heroku[web.1]: Process exited with status 0
2014-02-03T18:21:17.979026+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/http/mime_type.rb:166: warning: already initialized constant Mime::PDF
2014-02-03T18:21:17.979223+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/http/mime_type.rb:166: warning: previous definition of PDF was here
2014-02-03T18:21:19.256888+00:00 app[web.1]: => Booting Thin
2014-02-03T18:21:19.256888+00:00 app[web.1]: => Rails 4.0.0 application starting in production on http://0.0.0.0:56383
2014-02-03T18:21:19.256888+00:00 app[web.1]: => Run `rails server -h` for more startup options
2014-02-03T18:21:19.256888+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-02-03T18:21:19.256888+00:00 app[web.1]: Thin web server (v1.6.1 codename Death Proof)
2014-02-03T18:21:19.257086+00:00 app[web.1]: Maximum connections set to 1024
2014-02-03T18:21:19.257215+00:00 app[web.1]: Listening on 0.0.0.0:56383, CTRL+C to stop
2014-02-03T18:21:19.345623+00:00 heroku[web.1]: State changed from starting to up
2014-02-03T18:21:57.778933+00:00 app[web.1]: Started GET "/" for 190.166.175.131 at 2014-02-03 18:21:57 +0000
2014-02-03T18:21:57.778933+00:00 app[web.1]: Started GET "/" for 190.166.175.131 at 2014-02-03 18:21:57 +0000
2014-02-03T18:21:58.227244+00:00 app[web.1]: Started GET "/" for 190.166.175.131 at 2014-02-03 18:21:58 +0000
2014-02-03T18:21:58.227244+00:00 app[web.1]: Started GET "/" for 190.166.175.131 at 2014-02-03 18:21:58 +0000
2014-02-03T18:21:58.692110+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 18:21:58 +0000
2014-02-03T18:21:58.692110+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 18:21:58 +0000
2014-02-03T18:21:58.787987+00:00 heroku[router]: at=info method=GET path=/users/sign_in host=cmpc-lab-v2.herokuapp.com request_id=d2791a6c-f563-4051-9ea7-f072551f5b6b fwd="190.166.175.131" dyno=web.1 connect=3ms service=96ms status=200 bytes=5014
2014-02-03T18:21:59.703190+00:00 heroku[router]: at=info method=GET path=/assets/logo_cmpc-58e1dc17410512f196363a50c9026ba0.png host=cmpc-lab-v2.herokuapp.com request_id=716f9c68-6860-4891-be10-34fffebfc414 fwd="190.166.175.131" dyno=web.1 connect=2ms service=16ms status=200 bytes=5868
2014-02-03T18:22:12.217246+00:00 heroku[router]: at=info method=GET path=/assets/testimonial-bg-ad88c654b33cee6f7b3be534ea5bc933.jpg host=cmpc-lab-v2.herokuapp.com request_id=d911dc37-c66a-4213-be2f-78b3e7a06aa9 fwd="190.166.175.131" dyno=web.1 connect=2ms service=11ms status=200 bytes=101299
2014-02-03T18:27:03.313141+00:00 app[web.1]: Started GET "/users/sign_up" for 190.166.175.131 at 2014-02-03 18:27:03 +0000
2014-02-03T18:27:03.312446+00:00 app[web.1]: Started GET "/users/sign_up" for 190.166.175.131 at 2014-02-03 18:27:03 +0000
2014-02-03T18:27:03.347712+00:00 heroku[router]: at=info method=GET path=/users/sign_up host=cmpc-lab-v2.herokuapp.com request_id=ef70e25f-33e2-4178-a233-16fc9a85e1ba fwd="190.166.175.131" dyno=web.1 connect=1ms service=38ms status=200 bytes=4610
2014-02-03T18:27:03.649896+00:00 app[web.1]: Started GET "/users/sign_up" for 190.166.175.131 at 2014-02-03 18:27:03 +0000
2014-02-03T18:27:03.648742+00:00 app[web.1]: Started GET "/users/sign_up" for 190.166.175.131 at 2014-02-03 18:27:03 +0000
2014-02-03T18:27:03.688350+00:00 heroku[router]: at=info method=GET path=/users/sign_up host=cmpc-lab-v2.herokuapp.com request_id=20b07d61-8183-42d1-9ec1-533df8a0419a fwd="190.166.175.131" dyno=web.1 connect=1ms service=42ms status=200 bytes=4610
2014-02-03T18:27:04.223124+00:00 heroku[router]: at=info method=GET path=/assets/application-dc08e2457d7abcce4c9c08e578188223.js host=cmpc-lab-v2.herokuapp.com request_id=e1e83973-7c52-46c9-a201-97ce35274be6 fwd="190.166.175.131" dyno=web.1 connect=17ms service=22ms status=304 bytes=0
2014-02-03T18:27:04.194091+00:00 heroku[router]: at=info method=GET path=/assets/logo_cmpc-58e1dc17410512f196363a50c9026ba0.png host=cmpc-lab-v2.herokuapp.com request_id=d7d99147-c917-405d-b8f5-5b5bb790820f fwd="190.166.175.131" dyno=web.1 connect=1ms service=7ms status=304 bytes=0
2014-02-03T18:27:14.089214+00:00 app[web.1]: Started POST "/users" for 190.166.175.131 at 2014-02-03 18:27:14 +0000
2014-02-03T18:27:14.091605+00:00 app[web.1]: Started POST "/users" for 190.166.175.131 at 2014-02-03 18:27:14 +0000
2014-02-03T18:27:14.846792+00:00 heroku[router]: at=info method=POST path=/users host=cmpc-lab-v2.herokuapp.com request_id=20634857-85bd-40bb-a779-522c40bff6da fwd="190.166.175.131" dyno=web.1 connect=1ms service=769ms status=200 bytes=4888
2014-02-03T18:27:37.705638+00:00 app[web.1]: Started GET "/users/confirmation/new" for 190.166.175.131 at 2014-02-03 18:27:37 +0000
2014-02-03T18:27:37.706049+00:00 app[web.1]: Started GET "/users/confirmation/new" for 190.166.175.131 at 2014-02-03 18:27:37 +0000
2014-02-03T18:27:42.426526+00:00 app[web.1]: Started POST "/users/confirmation" for 190.166.175.131 at 2014-02-03 18:27:42 +0000
2014-02-03T18:27:42.435727+00:00 app[web.1]: Started POST "/users/confirmation" for 190.166.175.131 at 2014-02-03 18:27:42 +0000
2014-02-03T18:27:44.387195+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 18:27:44 +0000
2014-02-03T18:27:44.387283+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 18:27:44 +0000
2014-02-03T18:27:44.439777+00:00 heroku[router]: at=info method=GET path=/users/sign_in host=cmpc-lab-v2.herokuapp.com request_id=212b270d-f693-4361-9851-dc650d705d28 fwd="190.166.175.131" dyno=web.1 connect=2ms service=34ms status=200 bytes=5048
2014-02-03T18:27:45.093747+00:00 heroku[router]: at=info method=GET path=/assets/logo_cmpc-58e1dc17410512f196363a50c9026ba0.png host=cmpc-lab-v2.herokuapp.com request_id=dec0bf9f-357a-47a2-8509-8351795bdc3b fwd="190.166.175.131" dyno=web.1 connect=9ms service=12ms status=304 bytes=0
2014-02-03T18:27:47.929350+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=cmpc-lab-v2.herokuapp.com request_id=0d852c80-0374-4773-b17e-6742db09a718 fwd="190.166.175.131" dyno=web.1 connect=24ms service=25ms status=304 bytes=0
2014-02-03T18:27:44.986631+00:00 heroku[router]: at=info method=GET path=/assets/application-6781e0d7bf90ddc373ee3e4ddb13abb7.css host=cmpc-lab-v2.herokuapp.com request_id=5f5e3722-7847-419d-987f-ba756c0746e3 fwd="190.166.175.131" dyno=web.1 connect=2ms service=10ms status=304 bytes=0
2014-02-03T18:27:43.920377+00:00 heroku[router]: at=info method=POST path=/users/confirmation host=cmpc-lab-v2.herokuapp.com request_id=690eecc5-343c-4843-9588-e2543bfaa2cb fwd="190.166.175.131" dyno=web.1 connect=11ms service=1497ms status=302 bytes=112
2014-02-03T18:33:21.842112+00:00 app[web.1]: Started GET "/" for 190.166.175.131 at 2014-02-03 18:33:21 +0000
2014-02-03T18:33:21.842405+00:00 app[web.1]: Started GET "/" for 190.166.175.131 at 2014-02-03 18:33:21 +0000
2014-02-03T18:33:22.270851+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 18:33:22 +0000
2014-02-03T18:33:22.273438+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 18:33:22 +0000
2014-02-03T18:33:22.294192+00:00 heroku[router]: at=info method=GET path=/users/sign_in host=cmpc-lab-v2.herokuapp.com request_id=11a39a41-f009-4b5e-8d1d-61a3bd1f397c fwd="190.166.175.131" dyno=web.1 connect=16ms service=24ms status=200 bytes=5014
2014-02-03T18:33:24.565506+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=cmpc-lab-v2.herokuapp.com request_id=4d4ee5c1-464c-47ae-9054-faf8c6a84ea8 fwd="190.166.175.131" dyno=web.1 connect=11ms service=8ms status=304 bytes=0
2014-02-03T18:33:32.049119+00:00 app[web.1]: Started GET "/users/sign_up" for 190.166.175.131 at 2014-02-03 18:33:32 +0000
2014-02-03T18:33:32.050170+00:00 app[web.1]: Started GET "/users/sign_up" for 190.166.175.131 at 2014-02-03 18:33:32 +0000
2014-02-03T18:33:32.588178+00:00 app[web.1]: Started GET "/users/sign_up" for 190.166.175.131 at 2014-02-03 18:33:32 +0000
2014-02-03T18:33:32.586461+00:00 app[web.1]: Started GET "/users/sign_up" for 190.166.175.131 at 2014-02-03 18:33:32 +0000
2014-02-03T18:33:32.706488+00:00 heroku[router]: at=info method=GET path=/users/sign_up host=cmpc-lab-v2.herokuapp.com request_id=bb64a606-003b-4b00-97c7-9369956a267a fwd="190.166.175.131" dyno=web.1 connect=63ms service=161ms status=200 bytes=4610
2014-02-03T18:33:23.829016+00:00 heroku[router]: at=info method=GET path=/assets/glyphicons-halflings-7eb193615ec1fe31f5bc9026084e1032.png host=cmpc-lab-v2.herokuapp.com request_id=7ab95050-dfa0-4545-a0f7-b27e010189d4 fwd="190.166.175.131" dyno=web.1 connect=42ms service=28ms status=304 bytes=0
2014-02-03T18:33:37.245651+00:00 app[web.1]: Started GET "/users/confirmation/new" for 190.166.175.131 at 2014-02-03 18:33:37 +0000
2014-02-03T18:33:37.247587+00:00 app[web.1]: Started GET "/users/confirmation/new" for 190.166.175.131 at 2014-02-03 18:33:37 +0000
2014-02-03T18:33:46.368734+00:00 app[web.1]: Started POST "/users/confirmation" for 190.166.175.131 at 2014-02-03 18:33:46 +0000
2014-02-03T18:33:46.368734+00:00 app[web.1]: Started POST "/users/confirmation" for 190.166.175.131 at 2014-02-03 18:33:46 +0000
2014-02-03T18:33:47.444922+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 18:33:47 +0000
2014-02-03T18:33:47.448420+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 18:33:47 +0000
2014-02-03T18:33:47.548496+00:00 heroku[router]: at=info method=GET path=/users/sign_in host=cmpc-lab-v2.herokuapp.com request_id=ba44df50-2b29-42ac-8213-3f0b00d8d37a fwd="190.166.175.131" dyno=web.1 connect=40ms service=102ms status=200 bytes=5048
2014-02-03T18:33:48.179235+00:00 heroku[router]: at=info method=GET path=/assets/application-dc08e2457d7abcce4c9c08e578188223.js host=cmpc-lab-v2.herokuapp.com request_id=7a75f597-ce94-4440-9903-619bd8cca5b4 fwd="190.166.175.131" dyno=web.1 connect=42ms service=46ms status=304 bytes=0
2014-02-03T18:33:32.161461+00:00 heroku[router]: at=info method=GET path=/users/sign_up host=cmpc-lab-v2.herokuapp.com request_id=2cc39320-7387-49e8-84bb-648190157e33 fwd="190.166.175.131" dyno=web.1 connect=15ms service=165ms status=304 bytes=0
2014-02-03T18:33:21.860658+00:00 heroku[router]: at=info method=GET path=/ host=cmpc-lab-v2.herokuapp.com request_id=3040d490-5215-4c56-bc3b-eb5fb46819ad fwd="190.166.175.131" dyno=web.1 connect=8ms service=21ms status=302 bytes=112
2014-02-03T18:33:46.940997+00:00 heroku[router]: at=info method=POST path=/users/confirmation host=cmpc-lab-v2.herokuapp.com request_id=784a599b-2003-4690-bb0f-663a42ee0f33 fwd="190.166.175.131" dyno=web.1 connect=1ms service=574ms status=302 bytes=112
2014-02-03T18:45:37.614940+00:00 heroku[api]: Starting process with command `rails console` by j.mercedes@thedesignpill.com
2014-02-03T18:45:48.197989+00:00 heroku[run.9889]: Awaiting client
2014-02-03T18:45:48.227672+00:00 heroku[run.9889]: Starting process with command `rails console`
2014-02-03T18:45:48.380656+00:00 heroku[run.9889]: State changed from starting to up
2014-02-03T19:03:01.852744+00:00 heroku[run.9889]: Process exited with status 0
2014-02-03T19:03:01.867322+00:00 heroku[run.9889]: State changed from up to complete
2014-02-03T19:07:38.938562+00:00 heroku[run.9544]: State changed from starting to up
2014-02-03T19:08:09.651745+00:00 heroku[run.8571]: Awaiting client
2014-02-03T19:08:09.706181+00:00 heroku[run.8571]: Starting process with command `bundle exec rake db:seed`
2014-02-03T19:08:18.540032+00:00 heroku[run.8571]: Process exited with status 0
2014-02-03T19:08:18.551592+00:00 heroku[run.8571]: State changed from up to complete
2014-02-03T19:09:16.174943+00:00 app[web.1]: Started GET "/" for 190.166.175.131 at 2014-02-03 19:09:16 +0000
2014-02-03T19:09:16.174943+00:00 app[web.1]: Started GET "/" for 190.166.175.131 at 2014-02-03 19:09:16 +0000
2014-02-03T19:09:16.846379+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 19:09:16 +0000
2014-02-03T19:09:16.846379+00:00 app[web.1]: Started GET "/users/sign_in" for 190.166.175.131 at 2014-02-03 19:09:16 +0000
2014-02-03T19:09:16.862197+00:00 heroku[router]: at=info method=GET path=/users/sign_in host=cmpc-lab-v2.herokuapp.com request_id=2b8e0608-968f-4a9e-9f67-6e97146adae4 fwd="190.166.175.131" dyno=web.1 connect=8ms service=16ms status=200 bytes=5014
2014-02-03T19:09:17.893804+00:00 heroku[router]: at=info method=GET path=/assets/logo_cmpc-58e1dc17410512f196363a50c9026ba0.png host=cmpc-lab-v2.herokuapp.com request_id=06c07054-de52-49fb-8f1b-34a8a567814e fwd="190.166.175.131" dyno=web.1 connect=1ms service=3ms status=304 bytes=0
2014-02-03T19:09:19.169788+00:00 heroku[router]: at=info method=GET path=/assets/testimonial-bg-ad88c654b33cee6f7b3be534ea5bc933.jpg host=cmpc-lab-v2.herokuapp.com request_id=a49f8ea4-8096-4fd3-8b41-03ceb4f6feed fwd="190.166.175.131" dyno=web.1 connect=1ms service=4ms status=304 bytes=0
2014-02-03T19:09:18.135071+00:00 heroku[router]: at=info method=GET path=/assets/application-6781e0d7bf90ddc373ee3e4ddb13abb7.css host=cmpc-lab-v2.herokuapp.com request_id=140ef292-0850-44b2-a74a-83422967c050 fwd="190.166.175.131" dyno=web.1 connect=84ms service=198ms status=304 bytes=0
2014-02-03T19:09:21.240295+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=cmpc-lab-v2.herokuapp.com request_id=04ec09e5-eecb-4a22-b626-f9a8490e83d1 fwd="190.166.175.131" dyno=web.1 connect=4ms service=6ms status=304 bytes=0
2014-02-03T19:10:03.459772+00:00 heroku[run.1932]: Awaiting client
2014-02-03T19:10:03.527736+00:00 heroku[run.1932]: Starting process with command `rails console`
2014-02-03T19:10:03.464687+00:00 heroku[run.1932]: State changed from starting to up
2014-02-03T19:10:27.493526+00:00 heroku[run.1932]: State changed from up to complete
2014-02-03T19:10:27.496883+00:00 heroku[run.1932]: Process exited with status 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment