Tcl execution by ruby?


#1

is there anyway to run Tcl from Ruby??


#2

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


#3

From: Ukrit H. removed_email_address@domain.invalid
Subject: Tcl execution by ruby?
Date: Thu, 5 Feb 2009 17:21:11 +0900
Message-ID: removed_email_address@domain.invalid

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,


#4

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.


#5

From: Ukrit H. removed_email_address@domain.invalid
Subject: Re: Tcl execution by ruby?
Date: Fri, 6 Feb 2009 16:17:35 +0900
Message-ID: removed_email_address@domain.invalid

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
(http://www.dumbo.ai.kyutech.ac.jp/~nagai/RubyTk/?RubyTkORCA)
may be able to make your Ruby/Tk (Tcl/Tk) application accessible
from web browsers. :wink:


#6

From: Ukrit H. removed_email_address@domain.invalid
Subject: Re: Tcl execution by ruby?
Date: Fri, 6 Feb 2009 16:36:16 +0900
Message-ID: removed_email_address@domain.invalid

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.


#7

Hidetoshi NAGAI wrote:

From: Ukrit H. removed_email_address@domain.invalid
Subject: Tcl execution by ruby?
Date: Thu, 5 Feb 2009 17:21:11 +0900
Message-ID: removed_email_address@domain.invalid

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?


#8

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