Skip to content

Commit 0897f17

Browse files
authored
Merge pull request #219 from ruby-go-gem/feature/array
Add `RARRAY_` functions
2 parents 279ad74 + 84f4e82 commit 0897f17

File tree

4 files changed

+57
-3
lines changed

4 files changed

+57
-3
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ group :development do
66
gem "rake"
77
gem "rubocop", require: false
88
gem "rubocop_auto_corrector", require: false
9-
gem "ruby_header_parser"
9+
gem "ruby_header_parser", ">= 0.3.0"
1010
gem "yard"
1111
end
1212

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ GEM
112112
rubocop_auto_corrector (0.5.0)
113113
rubocop (>= 1.30.0)
114114
ruby-progressbar (1.13.0)
115-
ruby_header_parser (0.2.0)
115+
ruby_header_parser (0.3.0)
116116
securerandom (0.3.1)
117117
serverspec (2.42.3)
118118
multi_json
@@ -168,7 +168,7 @@ DEPENDENCIES
168168
rspec-temp_dir
169169
rubocop
170170
rubocop_auto_corrector
171-
ruby_header_parser
171+
ruby_header_parser (>= 0.3.0)
172172
serverspec
173173
steep
174174
test-unit

ruby/function_generated.go

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby/ruby_internal_core_rarray.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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/core/rarray.h
9+
10+
// RARRAY_LEN is alias to [RbArrayLen]
11+
func RARRAY_LEN(a VALUE) Long {
12+
return RbArrayLen(a)
13+
}
14+
15+
// RARRAY_CONST_PTR is alias to [RbArrayConstPtr]
16+
func RARRAY_CONST_PTR(a VALUE) *VALUE {
17+
return RbArrayConstPtr(a)
18+
}

0 commit comments

Comments
 (0)