[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

getting hostname from ruby

phil swenson

1/31/2006 3:14:00 PM

Is there a cleaner way to get the host name from ruby other than
`hostname`?

phil

--
Posted via http://www.ruby-....


3 Answers

Robert Klemme

1/31/2006 3:23:00 PM

0

phil swenson wrote:
> Is there a cleaner way to get the host name from ruby other than
> `hostname`?

16:21:55 [~]: ruby -r socket -e 'p Socket.gethostname'
"bond"

Kind regards

robert

Mike Fletcher

1/31/2006 3:40:00 PM

0

phil swenson wrote:
> Is there a cleaner way to get the host name from ruby other than
> `hostname`?

require 'socket'

hostname = Socket.gethostname

--
Posted via http://www.ruby-....


Dave Baldwin

1/31/2006 4:23:00 PM

0

I am trying to insert my own data into an FXImage and the setData
member look just what I need. Unfortunately, regardless of the
number of parameters I pass it I always get the

test.rb:10:in `setData': No matching function for overloaded
'FXImage_setData' (ArgumentError)
from test.rb:10

I have looked at the swig files but am none the wiser as to what I am
doing wrong, or if there is a bug here.

The simple test case is below and while this doesn't achieve anything
it does demonstrate the point.

I am using FX 1.4.3 running on Mac OSX 10.4 with ruby 1.8.3
(2005-09-21) [powerpc-darwin8.3.0]


#!/usr/bin/env ruby

require 'fox14'
include Fox

application = FXApp.new("Hello", "FoxTest")
main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL)
@buffer = FXImage.new(application, nil, IMAGE_KEEP, 640, 480)
data = [0xff00ff00] * 640 * 480
@buffer.setData(data, 0)

application.create()
main.show(PLACEMENT_SCREEN)
application.run()


Thanks,

Dave.