Native system calls in Ruby on Linux
I've been working through the book Scripted GUI Testing with Ruby, and I'm really en开发者_高级运维joying the ability to manipulate the Windows environment using the Win32API to make calls to user32.dll. However, the book doesn't explore doing the same type of work in a Linux system. I understand that there are sure to be differences in technique, but how can I get started doing these similar activities (manipulating the mouse and keyboard, finding windows, getting information about the environment and gui, etc) in Linux?
It heavily depends on the windowing libraries used (GTK/Qt), but if you know the interfaces and signatures you can use Ruby/DL or Ruby/FFI to directly call into the C DLLs.
精彩评论