Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- thufir@dur:~/ruby$
- thufir@dur:~/ruby$ ruby weather.rb
- {:host=>"rainmaker.wunderground.com", :port=>3000}
- SimpleTelnet: EventMachine reactor had been started independently. Won't stop it automatically.
- #<EventMachine::Protocols::SimpleTelnet:0x99e1728
- @check_input_buffer_timer=nil,
- @connection_state=:connected,
- @fiber_resumer=
- #<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)>,
- @input_buffer="",
- @input_rest="",
- @last_command=nil,
- @logged_in=2013-08-29 07:10:47 -0700,
- @signature=2,
- @telnet_options=
- {:host=>"rainmaker.wunderground.com",
- :port=>3000,
- :prompt=>/[$%#>] \z/n,
- :connect_timeout=>3,
- :timeout=>10,
- :wait_time=>0,
- :bin_mode=>false,
- :telnet_mode=>true,
- :output_log=>nil,
- :command_log=>nil,
- :login_prompt=>/[Ll]ogin[: ]*\z/n,
- :password_prompt=>/[Pp]ass(?:word|phrase)[: ]*\z/n,
- :username=>nil,
- :password=>nil,
- :SGA=>false,
- :BINARY=>false},
- @wait_time_timer=nil>
- ^C/home/thufir/.rvm/gems/ruby-2.0.0-p247/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine': Interrupt
- from /home/thufir/.rvm/gems/ruby-2.0.0-p247/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
- from weather.rb:9:in `<main>'
- thufir@dur:~/ruby$
- thufir@dur:~/ruby$
- thufir@dur:~/ruby$ cat weather.rb
- #!/usr/bin/env ruby
- require 'rubygems'
- require 'em-simple_telnet'
- require 'yaml'
- require 'pry'
- require 'pp'
- EventMachine.run do
- params = YAML.load_file('params.yml')
- options = {:host => params['host'], :port => params['port']}
- pp options
- EM::P::SimpleTelnet.new(options) do |host|
- pp host
- end
- end
- thufir@dur:~/ruby$
Advertisement
Add Comment
Please, Sign In to add comment