thufir

Untitled

Aug 29th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. thufir@dur:~/ruby$
  2. thufir@dur:~/ruby$ ruby weather.rb
  3. {:host=>"rainmaker.wunderground.com", :port=>3000}
  4. SimpleTelnet: EventMachine reactor had been started independently. Won't stop it automatically.
  5. #<EventMachine::Protocols::SimpleTelnet:0x99e1728
  6. @check_input_buffer_timer=nil,
  7. @connection_state=:connected,
  8. @fiber_resumer=
  9. #<Proc:0x99e16d8@/home/thufir/.rvm/gems/ruby-2.0.0-p247/gems/em-simple_telnet-0.0.14/lib/em-simple_telnet.rb:374 (lambda)>,
  10. @input_buffer="",
  11. @input_rest="",
  12. @last_command=nil,
  13. @logged_in=2013-08-29 07:10:47 -0700,
  14. @signature=2,
  15. @telnet_options=
  16. {:host=>"rainmaker.wunderground.com",
  17. :port=>3000,
  18. :prompt=>/[$%#>] \z/n,
  19. :connect_timeout=>3,
  20. :timeout=>10,
  21. :wait_time=>0,
  22. :bin_mode=>false,
  23. :telnet_mode=>true,
  24. :output_log=>nil,
  25. :command_log=>nil,
  26. :login_prompt=>/[Ll]ogin[: ]*\z/n,
  27. :password_prompt=>/[Pp]ass(?:word|phrase)[: ]*\z/n,
  28. :username=>nil,
  29. :password=>nil,
  30. :SGA=>false,
  31. :BINARY=>false},
  32. @wait_time_timer=nil>
  33. ^C/home/thufir/.rvm/gems/ruby-2.0.0-p247/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine': Interrupt
  34. from /home/thufir/.rvm/gems/ruby-2.0.0-p247/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
  35. from weather.rb:9:in `<main>'
  36.  
  37. thufir@dur:~/ruby$
  38. thufir@dur:~/ruby$
  39. thufir@dur:~/ruby$ cat weather.rb
  40. #!/usr/bin/env ruby
  41. require 'rubygems'
  42. require 'em-simple_telnet'
  43. require 'yaml'
  44. require 'pry'
  45. require 'pp'
  46.  
  47.  
  48. EventMachine.run do
  49.  
  50. params = YAML.load_file('params.yml')
  51. options = {:host => params['host'], :port => params['port']}
  52.  
  53. pp options
  54.  
  55. EM::P::SimpleTelnet.new(options) do |host|
  56. pp host
  57. end
  58.  
  59. end
  60. thufir@dur:~/ruby$
Advertisement
Add Comment
Please, Sign In to add comment