Ruby topology

Add Ruby APIs on C topology API (#273).

This pull request depend on #258, #273.  

Commit before 3d012a1 is part of #258 or #273 thus they can be ignored when reviewing this pull request.