Skip to content
/ gorb Public

Auto-generates a native Ruby wrapper stub for a given Go package.

Notifications You must be signed in to change notification settings

lsegal/gorb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 9, 2016
14ec194 · Nov 9, 2016

History

29 Commits
Sep 5, 2016
Nov 7, 2016
Nov 7, 2016
Nov 9, 2016
Nov 7, 2016
Nov 7, 2016
Nov 5, 2016
Sep 6, 2016
Nov 5, 2016
Sep 7, 2016
Nov 7, 2016
Nov 8, 2016
Nov 7, 2016
Sep 5, 2016
Nov 5, 2016

Repository files navigation

gorb

go<->rb

gorb provides a tool gorbgen to generate a native Ruby wrapper for a given Go package into the ext/<package> directory. The module name generated will be relative to the package directory you run gorbgen from.

Installing

$ go get -a github.com/lsegal/gorb/...
$ go install github.com/lsegal/gorb/cmd/gorbgen

Requirements

Currently, this project only works under Linux. See the Docker notes below for testing in a working environment.

Docker

You can use Docker to run the examples:

cd $GOPATH/github.com/lsegal/gorb
docker build -t lsegal/gorb .
sh start-docker.sh

Usage Example

Here is an example of running the built-in Test::Fib::Fibonacci package:

cd $GOPATH/github.com/lsegal/gorb
gorbgen -build test/fib
ruby ext/test/fib/test_fib.rb

Run Tests

To run acceptance tests:

$ ./test/test.sh

Tests pass if exit code is 0.

TODO

  • Support for slices, maps, complex pointer types.
  • Support for basic slice types (string, bool, int, float64).
  • Support for pass-by-value structs (partial value type support).
  • Support for external packages (partial support for local packages).
  • Support for error returns (as exceptions?).
  • Support for blocks
  • Compilation support for other systems (Windows not supported).

License

Licensed under the BSD license. Copyright Loren Segal 2016.

About

Auto-generates a native Ruby wrapper stub for a given Go package.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published