Ruby wrapper for NW RFC SDK using Ruby-FFI
I have just started a project on GitHub for a library that I am writing which wraps the NW RFC SDK library using Ruby-FFI.
So far, the library is not capable of much; you can connect to an ABAP system, set values (most types work) and call functions. I was a bit hesitant to start hosting the project in the open, and I deliberated over whether I should announce it (but I did), because there really is not much to show for it yet.
My main concerns are about whether I am structuring the code in an optimal way that makes the API easy to use and the code base to grow in future. But time will tell. I am writing tests as I go and then implementing the code to make it work, so it is a very iterative process.
A lot of time went into understanding some of the gritty details of FFI and required some brushing up on C, which it turns out, is very necessary (FFI is not some magic bullet for you to wrap C libraries, you need to understand C!).
So anyway, the plans now are for the following:
- Getting the rest of the types (decfloat16, decfloat34) etc. to work.
- Making server functions
- Instantiating functions and data types on the fly*
* necessary for testing new types to work; I have not seen any instances of these in remote-enabled functions, and secondly, it allow you to do more interesting things with server functions
You can gem install nwrfc to use it, or you can grab the code from the GitHub project. Documentation is at rubydoc.info, but you will get it installed locally too with the gem.