Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
aa73a106
Commit
aa73a106
authored
Mar 07, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #966 from monaka/pr-add-dump-method-to-String-class
Add String#dump method.
parents
f9fd5d9d
63a56ddd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
mrbgems/mruby-string-ext/src/string.c
mrbgems/mruby-string-ext/src/string.c
+2
-1
mrbgems/mruby-string-ext/test/string.rb
mrbgems/mruby-string-ext/test/string.rb
+3
-0
No files found.
mrbgems/mruby-string-ext/src/string.c
View file @
aa73a106
...
...
@@ -21,6 +21,7 @@ mrb_mruby_string_ext_gem_init(mrb_state* mrb)
{
struct
RClass
*
s
=
mrb
->
string_class
;
mrb_define_method
(
mrb
,
s
,
"dump"
,
mrb_str_dump
,
ARGS_NONE
());
mrb_define_method
(
mrb
,
s
,
"getbyte"
,
mrb_str_getbyte
,
ARGS_REQ
(
1
));
}
...
...
mrbgems/mruby-string-ext/test/string.rb
View file @
aa73a106
...
...
@@ -13,3 +13,6 @@ assert('String#getbyte') do
assert_equal
bytes2
[
0
],
str2
.
getbyte
(
0
)
end
assert
(
'String#dump'
)
do
"foo"
.
dump
==
"
\"
foo
\"
"
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment