From pierre.lesaffre at lra.ens.fr Fri Sep 10 04:56:02 2010 From: pierre.lesaffre at lra.ens.fr (Pierre Lesaffre) Date: Fri, 10 Sep 2010 10:56:02 +0200 (CEST) Subject: [Tioga-users] Using tioga as a module ? Message-ID: Dear all, I want to use tioga as a module in a ruby code. What is the way to do that ? Is there a simple template sitting around to do that ? And a related question: is it possible to have tioga produce the pdf file silently (ie: without opening the viewing window) ? The idea would be to have a piece of code which would parse its own arguments, for example, and then produce graphs depending on these arguments. I tried to figure it out myself, but got lost in TiogaUI... In fact, I don't understand the philosophy of it. I cannot get around the fact that tioga wants to wrap around a user-made routine, when I would like to call tioga from that routine. Thanks a lot for your help ! Cheers, Pierre. From fourmond at gmail.com Fri Sep 10 09:26:33 2010 From: fourmond at gmail.com (Vincent Fourmond) Date: Fri, 10 Sep 2010 15:26:33 +0200 Subject: [Tioga-users] Using tioga as a module ? In-Reply-To: References: Message-ID: Hello, On Fri, Sep 10, 2010 at 10:56 AM, Pierre Lesaffre wrote: > ?I want to use tioga as a module in a ruby code. What is the way to do > that ? Is there a simple template sitting around to do that ? > ?And a related question: is it possible to have tioga produce the pdf > file silently (ie: without opening the viewing window) ? Definitely ;-)... > ?The idea would be to have a piece of code which would parse its own > arguments, for example, and then produce graphs depending on these > arguments. > > ?I tried to figure it out myself, but got lost in TiogaUI... That's precisely the place not to look for this kind of things ;-)... You can get more information there: http://tioga.rubyforge.org/doc/classes/Tioga/Tutorial.html and in particular http://tioga.rubyforge.org/doc/classes/Tioga/Tutorial/CommandLine.html if you're interested to run tioga from the command line as an external program. If what you require is simply a ruby file that generates a PDF file by simply running it, I've attached an older version of samples/sine.rb that does this; you surely can get some inspiration from it. Run it this way ruby sine.rb (you might need to add require 'rubygems' at the beginning, though, depending on the details of your installation). Enjoy ! Vincent -------------- next part -------------- A non-text attachment was scrubbed... Name: sine.rb Type: application/x-ruby Size: 1980 bytes Desc: not available URL: From pierre.lesaffre at lra.ens.fr Fri Sep 10 09:37:41 2010 From: pierre.lesaffre at lra.ens.fr (Pierre Lesaffre) Date: Fri, 10 Sep 2010 15:37:41 +0200 (CEST) Subject: [Tioga-users] Using tioga as a module ? In-Reply-To: References: Message-ID: Thanks Vincent: I think I get the answer to all my questions with your small piece of code ! Cheers, Pierre. On Fri, 10 Sep 2010, Vincent Fourmond wrote: > Hello, > > On Fri, Sep 10, 2010 at 10:56 AM, Pierre Lesaffre > wrote: > > ?I want to use tioga as a module in a ruby code. What is the way to do > > that ? Is there a simple template sitting around to do that ? > > ?And a related question: is it possible to have tioga produce the pdf > > file silently (ie: without opening the viewing window) ? > > Definitely ;-)... > > > ?The idea would be to have a piece of code which would parse its own > > arguments, for example, and then produce graphs depending on these > > arguments. > > > > ?I tried to figure it out myself, but got lost in TiogaUI... > > That's precisely the place not to look for this kind of things ;-)... > > You can get more information there: > > http://tioga.rubyforge.org/doc/classes/Tioga/Tutorial.html > > and in particular > > http://tioga.rubyforge.org/doc/classes/Tioga/Tutorial/CommandLine.html > > if you're interested to run tioga from the command line as an > external program. > > If what you require is simply a ruby file that generates a PDF file > by simply running it, I've attached an older version of > samples/sine.rb that does this; you surely can get some inspiration > from it. Run it this way > > ruby sine.rb > > (you might need to add require 'rubygems' at the beginning, though, > depending on the details of your installation). > > Enjoy ! > > Vincent >