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
96afe4ba
Commit
96afe4ba
authored
Sep 24, 2012
by
Daniel Bovensiepen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Gem Readme Source
parent
a7cb9737
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
doc/mrbgems/README.md
doc/mrbgems/README.md
+13
-5
No files found.
doc/mrbgems/README.md
View file @
96afe4ba
...
...
@@ -7,6 +7,7 @@ standardized way into mruby.
The maximal Gem structure looks like this:
```
+- GEM_NAME <- Name of Gem
|
+- mrblib/ <- Source for Ruby extension
...
...
@@ -18,6 +19,7 @@ The maximal Gem structure looks like this:
+- Makefile <- Makefile for Gem
|
+- README.md <- Readme for Gem
```
The folder
*mrblib*
contains pure Ruby files to extend mruby. The folder
*src*
contains C files to extend mruby. The folder
*test*
contains pure Ruby files
...
...
@@ -44,17 +46,20 @@ by the name of you Gem. The directory name of your Gem is considered also
as the name! If you call your Gem directory
*c_extension_example*
, your
initialisation method could look like this:
void
mrb_c_extension_example_gem_init(mrb_state
*
mrb) {
_class_cextension = mrb_define_module(mrb, "CExtension");
mrb_define_class_method(mrb, _class_cextension, "c_method", mrb_c_method, ARGS_NONE());
}
```
void
mrb_c_extension_example_gem_init(mrb_state* mrb) {
_class_cextension = mrb_define_module(mrb, "CExtension");
mrb_define_class_method(mrb, _class_cextension, "c_method", mrb_c_method, ARGS_NONE());
}
```
mrbgems will also use the
*gem-clean*
make target to clean up your Gem. Implement
this target with the necessary rules!
### Example
```
+- c_extension_example/
|
+- src/
...
...
@@ -68,6 +73,7 @@ this target with the necessary rules!
+- Makefile <- Build rules for C extension
|
+- README.md
```
## Ruby Extension
...
...
@@ -83,6 +89,7 @@ process of your Ruby extension you can use the *Makefile* too.
### Example
```
+- ruby_extension_example/
|
+- mrblib/
...
...
@@ -96,3 +103,4 @@ process of your Ruby extension you can use the *Makefile* too.
+- Makefile
|
+- README.md
```
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