ashbb/green_shoes — Issue #55: edit_line can't convert Symbol into Integer (TypeError)
Author: cyberarm
Created: 2011-11-08 00:29:16+00:00
State: open

I get this error when I try to call my edit_line:

``` text
C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/helper_methods.rb:79
:in `[]': can't convert Symbol into Integer (TypeError)
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/helper_
methods.rb:79:in `block in replace_string_to_float'
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/helper_
methods.rb:78:in `each'
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/helper_
methods.rb:78:in `replace_string_to_float'
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/helper_
methods.rb:67:in `basic_attributes'
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/app.rb:
263:in `edit_line'
from green-ping.rb:7:in `ping'
from green-ping.rb:35:in `block (2 levels) in

'
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/slot.rb
:30:in `initialize'
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/app.rb:
69:in `new'
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/app.rb:
69:in `flow'
from green-ping.rb:34:in `block in

'
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/main.rb
:81:in `instance_eval'
from C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.320/lib/shoes/main.rb
:81:in `app'
from green-ping.rb:4:in `

'
```

My Program:

``` ruby
require "green_shoes"
require "socket"

Shoes.app title: "Server Pinger", height: 105, width: 265 do
def ping
begin
ip = edit_line "example.com"
port = edit_line "25565"
TCPSocket.open(ip, port) {|s|
}
stack do
inscription "Pinged server at:"
inscription Time.now.strftime("%I:%M:%S %p")
end
flow do
tagline "Server Status: " + fg("Online", green) + "."
end

rescue Errno::ECONNREFUSED
stack do
inscription "Pinged server at:"
inscription Time.now.strftime("%I:%M:%S %p")
end
tagline "Server Status: " + fg("Offline", red) + "."
end
rescue Errno::ETIMEDOUT
stack do
inscription "Pinged server at:"
inscription Time.now.strftime("%I:%M:%S %p")
end
tagline "Server Status: " + fg("Offline", red) + "."
end

pinger = flow do
ping
end

button "check server status" do
pinger.clear do
ping
end
end
end

```