[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: ruby-1.8.1/ext/tk/sample/demos-en/ : none works!

neodrace

5/14/2005 3:30:00 PM

... at least thats what ya consider 4 non-win os, as for win you have to
make small changes to the source, here's my suggestion: since cat doesnt
work for use we go with the dos equivalent TYPE, but wait: dos uses \'es
instead of /'es ... so, inside widget.rb change:

$demo_dir = File.dirname($0)
to
$demo_dir = File.dirname($0).gsub(/\//,'\\')

and in the bottom we use type and \'s:

eval `TYPE #{[$demo_dir, tag[5..-1]].join("\\")}.rb`

yeah, i know kinda lame ...
okok, being nice today, if you totaly dislike dos and type and want your
own cat... well just do it!

1. Edit widget.rb, replace the line

eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb`

with

eval `ruby cat.rb #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb`

(so you can leave the seperators as /)

2. create your own cat.rb in the same folder (as widget.rb), here's the
simple content:

f=File.open(ARGV[0],"r")
f.each do |line| print line end
f.close

... although its pointless :-P

1 Answer

nobu.nokada

5/14/2005 3:49:00 PM

0

Hi,

At Sun, 15 May 2005 00:35:30 +0900,
neodrace wrote in [ruby-talk:142638]:
> ... at least thats what ya consider 4 non-win os, as for win you have to
> make small changes to the source, here's my suggestion: since cat doesnt
> work for use we go with the dos equivalent TYPE, but wait: dos uses \'es
> instead of /'es ... so, inside widget.rb change:

It already has no longer used an external command there.

--
Nobu Nakada