https://github.com/mattn/go-mruby
go-mruby make interface to embed mruby into go.
https://github.com/mattn/go-mruby
Last synced: 3 months ago
JSON representation
go-mruby make interface to embed mruby into go.
- Host: GitHub
- URL: https://github.com/mattn/go-mruby
- Owner: mattn
- Created: 2012-05-10T08:30:30.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2015-11-20T10:50:41.000Z (about 10 years ago)
- Last Synced: 2025-03-30T13:51:16.201Z (10 months ago)
- Language: Go
- Homepage: http://mattn.kaoriya.net/
- Size: 12.7 KB
- Stars: 83
- Watchers: 10
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.mkd
Awesome Lists containing this project
README
# go-mruby
go-mruby make interface to embed mruby into go.
## Install
```
git submodule init
git submodule update
make
cd example
go build -x .
LD_LIBRARY_PATH=.. ./example
```
On windows, use Makefile.w32
```
mingw32-make -f Makefile.w32
copy mruby.dll example
cd example
go build -x .
example.exe
```
## Usage
```go
package main
import "github.com/mattn/go-mruby"
func main() {
mrb := mruby.New()
defer mrb.Close()
println(mrb.Eval(`"hello " + ARGV[0]`, "mruby").(string))
for _, i := range mrb.Eval(`ARGV.map {|x| x + 1}`, 1, 2, 3).([]interface{}) {
println(i.(int32)) // 2 3 4
}
}
```
## License
MIT
## Author
* Yasuhiro Matsumoto