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
a97f085c
Unverified
Commit
a97f085c
authored
Sep 18, 2020
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Sep 18, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5083 from wataash/example-clarify-caller
examples/mrbgems: clarify the caller
parents
dffe4bc8
2bf9fd06
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb
...es/mrbgems/c_and_ruby_extension_example/mrblib/example.rb
+1
-1
examples/mrbgems/c_and_ruby_extension_example/src/example.c
examples/mrbgems/c_and_ruby_extension_example/src/example.c
+5
-1
examples/mrbgems/c_extension_example/src/example.c
examples/mrbgems/c_extension_example/src/example.c
+5
-1
examples/mrbgems/ruby_extension_example/mrblib/example.rb
examples/mrbgems/ruby_extension_example/mrblib/example.rb
+1
-1
No files found.
examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb
View file @
a97f085c
module
CRubyExtension
def
CRubyExtension
.
ruby_method
puts
"A Ruby Extension"
puts
"
#{
self
}
:
A Ruby Extension"
end
end
examples/mrbgems/c_and_ruby_extension_example/src/example.c
View file @
a97f085c
#include <mruby.h>
#include <mruby/string.h>
#include <stdio.h>
static
mrb_value
mrb_c_method
(
mrb_state
*
mrb
,
mrb_value
self
)
{
puts
(
"A C Extension"
);
mrb_value
self_str
=
mrb_str_to_str
(
mrb
,
self
);
printf
(
"%s: A C Extension
\n
"
,
mrb_str_to_cstr
(
mrb
,
self_str
));
return
self
;
}
...
...
examples/mrbgems/c_extension_example/src/example.c
View file @
a97f085c
#include <mruby.h>
#include <mruby/string.h>
#include <stdio.h>
static
mrb_value
mrb_c_method
(
mrb_state
*
mrb
,
mrb_value
self
)
{
puts
(
"A C Extension"
);
mrb_value
self_str
=
mrb_str_to_str
(
mrb
,
self
);
printf
(
"%s: A C Extension
\n
"
,
mrb_str_to_cstr
(
mrb
,
self_str
));
return
self
;
}
...
...
examples/mrbgems/ruby_extension_example/mrblib/example.rb
View file @
a97f085c
class
RubyExtension
def
RubyExtension
.
ruby_method
puts
"A Ruby Extension"
puts
"
#{
self
}
:
A Ruby Extension"
end
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