Tcl execution by ruby?

is there anyway to run Tcl from Ruby??

Ukrit H. wrote:

is there anyway to run Tcl from Ruby??
Depends on what you mean run Tcl from Ruby. If you mean run a Tcl
application from a Ruby application sure. If you mean invoke Tcl
procs or load Tcl packages and run procs from that pacakge from within
ruby probably that requires wrapping what you want done in an
application that can be run from Ruby.

Can you be a bit more detailed about what you want to do

Ron

From: Ukrit H. [email protected]
Subject: Tcl execution by ruby?
Date: Thu, 5 Feb 2009 17:21:11 +0900
Message-ID: [email protected]

is there anyway to run Tcl from Ruby??


require ‘tk’
Tk.load_tclscript(tcl_script_file, encoding=nil) # => use ‘source’
command
Tk.load_tcllibrary(file, pkg_name=None, interp=None) #=> use ‘load’
command
Tk.ip_eval(tcl_script_string) # eval the string as a bit of a tcl script
Tk.tk_call(arg, …) # each arg is a token of command line
TkComm.window(widget_path) # get a widget object if the widget exists

If you want to call a Tcl script without Tk,

Ron F. wrote:

Ukrit H. wrote:

is there anyway to run Tcl from Ruby??
Depends on what you mean run Tcl from Ruby. If you mean run a Tcl
application from a Ruby application sure. If you mean invoke Tcl
procs or load Tcl packages and run procs from that pacakge from within
ruby probably that requires wrapping what you want done in an
application that can be run from Ruby.

Can you be a bit more detailed about what you want to do

Ron

Sure thing Ron I’m working on a project which migrate tcl framework onto
web browser , Rails is a tool i choose. So I believe that Ruby will be
able to run passthrough this :). so please give me some idea.

From: Ukrit H. [email protected]
Subject: Re: Tcl execution by ruby?
Date: Fri, 6 Feb 2009 16:17:35 +0900
Message-ID: [email protected]

Sure thing Ron I’m working on a project which migrate tcl framework onto
web browser , Rails is a tool i choose. So I believe that Ruby will be

Ruby/TkORCA
(RubyTk - Ruby/TkORCA)
may be able to make your Ruby/Tk (Tcl/Tk) application accessible
from web browsers. :wink:

From: Ukrit H. [email protected]
Subject: Re: Tcl execution by ruby?
Date: Fri, 6 Feb 2009 16:36:16 +0900
Message-ID: [email protected]

Thx Hidetoshi I’m trying with your solution on rails but I’ve some
question
If I’m implementing rails which path I should place my tcl file?

As you like. And use fullpath of the tcl file.

Hidetoshi NAGAI wrote:

From: Ukrit H. [email protected]
Subject: Tcl execution by ruby?
Date: Thu, 5 Feb 2009 17:21:11 +0900
Message-ID: [email protected]

is there anyway to run Tcl from Ruby??


require ‘tk’
Tk.load_tclscript(tcl_script_file, encoding=nil) # => use ‘source’
command
Tk.load_tcllibrary(file, pkg_name=None, interp=None) #=> use ‘load’
command
Tk.ip_eval(tcl_script_string) # eval the string as a bit of a tcl script
Tk.tk_call(arg, …) # each arg is a token of command line
TkComm.window(widget_path) # get a widget object if the widget exists

If you want to call a Tcl script without Tk,

Thx Hidetoshi I’m trying with your solution on rails but I’ve some
question
If I’m implementing rails which path I should place my tcl file?

Ukrit H. wrote:

Ron

Sure thing Ron I’m working on a project which migrate tcl framework onto
web browser , Rails is a tool i choose. So I believe that Ruby will be
able to run passthrough this :). so please give me some idea.

Well I’m probably being a heretic here, but had you investigated the
Tcl browsr plugin? Jeff Hobbs at ActiveState could probably provide
you with a fair bit of info on how usable that might be for your
application… which in this case would be to put the tcl framework
directly inside the browser.

Ron