You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CRuby methods are mapped to Go methods based on the following rules
101
+
102
+
* No lowercase letters included (`/^[A-Z0-9_]+$/`)
103
+
* No changes
104
+
* e.g. `RB_NUM2UINT`
105
+
* Lowercase letters included
106
+
* Converted to CamelCase
107
+
* e.g. `rb_define_method` (CRuby) -> `ruby.RbDefineMethod` (Go)
108
+
109
+
### Limitation
110
+
Most of the methods defined in `ruby.h` are automatically generated and defined in [ruby/function_generated.go](ruby/function_generated.go).
111
+
112
+
However, some of the methods listed below are not supported.
113
+
114
+
1. deprecated or internal methods
115
+
* See `function.exclude_name` in https://github.com/ruby-go-gem/ruby_header_parser/blob/main/config/default.yml
116
+
2. Methods with variable-length arguments
117
+
* Because Go's variable-length arguments couldn't be passed directly to C.
118
+
* However, it is possible to execute functions with variable length arguments in CRuby from Go with a hack like `RbRaise` in [ruby/ruby_internal_error.go](ruby/ruby_internal_error.go)
119
+
88
120
## Developing
89
121
### Build
90
122
Run `rake ruby:build_example`. (`bundle exec` is not required)
@@ -99,16 +131,6 @@ godoc
99
131
100
132
open http://localhost:6060/pkg/github.com/ruby-go-gem/go-gem-wrapper/
101
133
102
-
## Coverage
103
-
We provide auto-generated bindings for (almost) all CRuby functions available when including `ruby.h`:muscle:
0 commit comments