getting hostname from ruby

P

phil swenson

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

phil
 
R

Robert Klemme

phil said:
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
 
D

Dave Baldwin

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top