Ruby Tk diagnostics

I’m trying to write a simple program to allow us to get data off a
machine which for some reason won’t do ftp, but can do telnet.
It hasn’t got kermit either, and I can’t find any free kermit
implementations even for DOS

I’m currently getting:
[…]
LE_ID
C:/RUBY/lib/ruby/1.6/Tk.rb:980:in _invoke': stack level too deep (SystemStackEr ror) from C:/RUBY/lib/ruby/1.6/Tk.rb:980:in_invoke’
from C:/RUBY/lib/ruby/1.6/Tk.rb:980:in _invoke' from C:/RUBY/lib/ruby/1.6/Tk.rb:980:in_invoke’
from C:/RUBY/lib/ruby/1.6/Tk.rb:980:in _invoke' from C:/RUBY/lib/ruby/1.6/Tk.rb:980:in_invoke’
from C:/RUBY/lib/ruby/1.6/Tk.rb:980:in _invoke' from C:/RUBY/lib/ruby/1.6/Tk.rb:980:in_invoke’
from C:/RUBY/lib/ruby/1.6/Tk.rb:980:in _invoke' ... 756 levels... from C:/RUBY/lib/ruby/1.6/tkentry.rb:6 from upload.rb:35:ininitialize’
from upload.rb:55:in `new’
from upload.rb:55

hgs@BUZZ ~

Which is what I can see in cygwin. cygwin, well my version, doesn’t
have script so I can’t capture the whole output, the rest has
scrolled away. The script is

#!/usr/local/bin/ruby

A program to allow the transmission of a file inband.

require 'net/telnet’
require “Tk”

class Upload
def do_connection()
tn = Net::Telnet.new(“Host” => @host)
tn.login(@user, @password)

    fp = open(file, "r") {
        tn.print(%Q{cat | ruby -pe '$_.unpack("m")' > #{outfile}})
        fp.readlines.each { |line|
            tn.print "#{[line].pack('m')}\n"
        }
        tn.print "\004\n"
        sleep 1
        tn.print "exit\n"
    }
end

def initialize()
    # initilize varaibles
    @host   = TkVariable.new()
    @user   = TkVariable.new()
    @passwd = TkVariable.new()
    @file   = TkVariable.new()

    p = proc { }
    root = TkRoot.new { title "Upload" }
    top = TkFrame.new(root)
    TkLabel.new(top) {text 'Remote Host:' }
    @host_entry = TkEntry.new(top, 'textvariable' => @host)
    @host_entry.pack
    TkLabel.new(top) {text 'Username:' }
    @user_entry = TkEntry.new(top, 'textvariable' => @user)
    @user_entry.pack
    TkLabel.new(top) {text 'password:' }
    @pass_entry = TkEntry.new(top, 'textvariable' => @passwd,
                                   'show' => '*')
    @pass_entry.pack
    TkLabel.new(top) {text 'File to send:' }
    @file_entry = TkEntry.new(top, 'textvariable' => @file)
    @file_entry.pack

    TkButton.new(top) {text 'Pig It'; command p }
    TkButton.new(top) {text 'Exit'; command {proc exit}}
    top.pack
end

end

Upload.new()
Tk.mainloop

So there is nothing in proc p at the moment, but still.
I can’t see anything wrong with 35. Anyone any idea why this is failing?
I’ve done work in tk before, but not with ruby and tk.

    Hugh

I'm currently getting:
        [...]

Work fine for me

LE_ID
C:/RUBY/lib/ruby/1.6/Tk.rb:980:in `_invoke': stack level too deep
(SystemStackError)

This remind me a weird problem that you can see only under very special
circumstances, where the same alias is redefined twice. This is the
redefinition which give the "stack level too deep"

Verify that you have the latest version of ruby and ruby/tk

Guy Decoux

I’m currently getting:
[…]

Work fine for me

That is encouraging, at least…

LE_ID
C:/RUBY/lib/ruby/1.6/Tk.rb:980:in `_invoke’: stack level too deep
(SystemStackError)

This remind me a weird problem that you can see only under very special
circumstances, where the same alias is redefined twice. This is the
redefinition which give the “stack level too deep”

OK, I thought it could not be due to any iteration or recursion on my
part.

Verify that you have the latest version of ruby and ruby/tk

Hmm, I’m using the Ruby 1.6.6 windows install from /\ndy. (it would be
the simplest way to get this onto the destination machine too.)

Andy, any chance of an upgrade? Or are there other workarounds?

Guy Decoux

    Thank you,
    Hugh
···

On Thu, 25 Jul 2002, ts wrote: