ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* run a ruby script and use the standard output ???
@ 2006-09-27 21:08 Renaud AUBIN
  2006-09-28  7:45 ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Renaud AUBIN @ 2006-09-27 21:08 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 657 bytes --]

Hi all,

Is it possible to run a ruby script from a context document during its
processing (I already know how to do that using \write18 but there is
maybe a better way...) then get the output of the script to display or
use it into the document. It's a little bit hard to describe so I have a
simple example:

\starttext
\def\vartest{3.124325234543523452435}
\write18{ruby ./myscript.rb \vartest
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
\stoptext

with myscript.rb:

temp = ARGV[0]
puts "\nXXXXXXXXXXXXX " + (Math::sqrt(temp.to_f)).to_s + " XXXXXXXXXXXXX\n"

I would store the result of puts into a variable usable within ConTeXt...


Renaud

[-- Attachment #1.2: Type: text/html, Size: 1018 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-09-30  6:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-27 21:08 run a ruby script and use the standard output ??? Renaud AUBIN
2006-09-28  7:45 ` Hans Hagen
2006-09-28  9:18   ` Taco Hoekwater
2006-09-29 15:34     ` Renaud AUBIN
2006-09-29 15:45       ` Taco Hoekwater
2006-09-29 18:24         ` Renaud AUBIN
2006-09-29 18:54           ` Taco Hoekwater
2006-09-29 19:18             ` Renaud AUBIN
2006-09-29 19:45             ` Renaud AUBIN
2006-09-30  6:47               ` Taco Hoekwater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).