Skip to content

Commit 3866b14

Browse files
authored
Merge pull request #16 from sue445/festure/add_link
refactor
2 parents 1991874 + cf0df19 commit 3866b14

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

class.go renamed to anyargs.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import (
99
"unsafe"
1010
)
1111

12-
// RbDefineModule calls `rb_define_module` in C
13-
func RbDefineModule(name string) VALUE {
14-
return VALUE(C.rb_define_module(goString2Char(name)))
15-
}
12+
// c.f. https://github.com/ruby/ruby/blob/master/include/ruby/internal/anyargs.h
1613

1714
// RbDefineSingletonMethod calls `rb_define_singleton_method` in C
1815
func RbDefineSingletonMethod(klass VALUE, name string, fun unsafe.Pointer, args int) {

doc.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Package ruby is a wrapper for creating Ruby native extension in Go
2+
//
3+
// ref.
4+
// - https://docs.ruby-lang.org/en/master/extension_rdoc.html
5+
// - https://docs.ruby-lang.org/ja/latest/function/index.html
6+
package ruby

error.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import (
1515
"fmt"
1616
)
1717

18+
// c.f. https://github.com/ruby/ruby/blob/master/include/ruby/internal/error.h
19+
1820
// RbRaise calls `rb_raise` in C
1921
func RbRaise(exc VALUE, format string, a ...interface{}) {
2022
str := fmt.Sprintf(format, a...)

iterator.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ package ruby
55
*/
66
import "C"
77

8+
// c.f. https://github.com/ruby/ruby/blob/master/include/ruby/internal/iterator.h
9+
810
// RbYield calls `rb_yield` in C
911
func RbYield(val VALUE) VALUE {
1012
return VALUE(C.rb_yield(C.VALUE(val)))

long.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ package ruby
55
*/
66
import "C"
77

8+
// c.f. https://github.com/ruby/ruby/blob/master/include/ruby/internal/arithmetic/long.h
9+
810
// RbNum2long calls `rb_num2long` in C
911
func RbNum2long(n VALUE) Long {
1012
return Long(C.rb_num2long(C.VALUE(n)))

module.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package ruby
2+
3+
/*
4+
#include "ruby.h"
5+
*/
6+
import "C"
7+
8+
// c.f. https://github.com/ruby/ruby/blob/master/include/ruby/internal/module.h
9+
10+
// RbDefineModule calls `rb_define_module` in C
11+
func RbDefineModule(name string) VALUE {
12+
return VALUE(C.rb_define_module(goString2Char(name)))
13+
}

wrapper.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Package ruby is a wrapper for creating native Ruby extension in Go
2-
//
3-
// ref. https://docs.ruby-lang.org/en/master/extension_rdoc.html
41
package ruby
52

63
/*

0 commit comments

Comments
 (0)