Does Ruby have an equivalent to Python's ctypes?

From the description I found of ctypes, I think ffi
<https://github.com/ffi/ffi> would be close. Perhaps if you give us
more information about what you want to do, we can give you more
specific recommendations.

No. But, if you really need it, you can roll your own using regular
expressions or constants.

The following gists show my take of each:

  https://gist.github.com/650968
  https://gist.github.com/671652

HTH,
Ammar

http://rubyforge.org/projects/ctype/

Regards,

Dan

···

On 11/10/10 3:05 PM, Shadowfirebird wrote:

Given how easy it is to implement this type functionality in pure
ruby, do you really want the added dependency? Especially on a gem
that's still in beat, hasn't been touched since 2005, and requires a
compiler (sure, no big deal, but character types are not worth all
that ceremony). I stumbled across this gem when I was searching for
ctype functionality (http://www.ruby-forum.com/topic/329485\) and
decided that it wasn't worth it.

If you need the methods to be callable on Strings, it's easy to do so.
Also, if you want the functionality to handle Unicode characters,
doing it in pure ruby, using regular expressions, is much easier.

Regards,
Ammar

···

On Thu, Nov 11, 2010 at 3:25 AM, Daniel Berger <djberg96@gmail.com> wrote:

On 11/10/10 3:05 PM, Shadowfirebird wrote:

http://rubyforge.org/projects/ctype/