Ruby on Windows questions

(J-Van) #1

Gotta port some software to Windows... :frowning: I'm a Windows newbie.

Using Ruby on Windows (XP)....

1. How do I find out the CPU % (or some sort of a load indicator) of
the machine?

2. How do I find out how much of a given ethernet connection is being
used? (i.e. if it's a gigabit connection and 1Mbps are being used,
I'd like to get back "1%".

3. Starting programs into the background is done the same way as on
*nix, right?

4. How can I tell how much of a CPU a program is currently using?

5. How do I start a Ruby program at boot (a service)?

6. Can I use something like ruby2exe to package up my Ruby service?

7. Does Windows use signals? How can I tell a program that I've
started to stop (i.e. on *nix, I'd do it via SIGTERM or SIGKILL).

8. Any known issues with DRb and Windows?

Any help is greatly appreciated!

Joe

(J-Van) #2

Also, is there a Ruby idiom for how to properly do platform-specific stuff?

My first instinct is to have something like ("end"s omitted)

module OS_Services
    module POSIX
        module Linux
            module 2.4
            module 2.6
        module BSD
        module Solaris
        module OSX
    module Windows
end

And then query (somehow) what OS I'm on and including the appropriate modules.

Joe

···

On 8/22/06, Joe Van Dyk <joevandyk@gmail.com> wrote:

Gotta port some software to Windows... :frowning: I'm a Windows newbie.

Using Ruby on Windows (XP)....

1. How do I find out the CPU % (or some sort of a load indicator) of
the machine?

2. How do I find out how much of a given ethernet connection is being
used? (i.e. if it's a gigabit connection and 1Mbps are being used,
I'd like to get back "1%".

3. Starting programs into the background is done the same way as on
*nix, right?

4. How can I tell how much of a CPU a program is currently using?

5. How do I start a Ruby program at boot (a service)?

6. Can I use something like ruby2exe to package up my Ruby service?

7. Does Windows use signals? How can I tell a program that I've
started to stop (i.e. on *nix, I'd do it via SIGTERM or SIGKILL).

8. Any known issues with DRb and Windows?

Any help is greatly appreciated!