That is one way of going about it, but it's probably very painful. You'd have to make libffi bindings for all those OSX-specific calls.
Google took me here: http://forum.soft32.com/mac/
Then I saw the comment at the bottom, and it makes some good points. I googled for a ruby gem that wraps getifaddres, and found this. https://github.com/bbcoimbra/
See if you can use it to get the network card information. If it works, you'll probably have to figure out how to build Windows-specific gems, because I'm almost sure this won't install on Windows.
===
So I git cloned "system-getifaddrs".
The problems are fixed here.
I found a extconf.rb in system-getifaddrs/ext/rb_getifaddrs, and did:
$ ruby extconf.rb
checking for arpa/inet.h... yes
checking for sys/socket.h... yes
checking for sys/types.h... yes
checking for netdb.h... yes
checking for ifaddrs.h... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for unistd.h... yes
creating Makefile
I don't think that's what I'm supposed to dochecking for arpa/inet.h... yes
checking for sys/socket.h... yes
checking for sys/types.h... yes
checking for netdb.h... yes
checking for ifaddrs.h... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for unistd.h... yes
creating Makefile
No comments:
Post a Comment