summaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/language/Core.md12
-rw-r--r--doc/mrbconf/README.md38
-rw-r--r--doc/mrbgems/README.md39
3 files changed, 85 insertions, 4 deletions
diff --git a/doc/language/Core.md b/doc/language/Core.md
index 033939865..d7331e7f3 100644
--- a/doc/language/Core.md
+++ b/doc/language/Core.md
@@ -1328,6 +1328,12 @@ ISO Code | Source File | C Function
--- | --- | ---
15.3.1.2.5 | src/kernel.c | mrb_f_block_given_p_m
+#### local_variables
+
+ISO Code | Source File | C Function
+--- | --- | ---
+15.3.1.2.7 | src/kernel.c | mrb_local_variables
+
#### raise
ISO Code | Source File | C Function
@@ -1498,6 +1504,12 @@ ISO Code | Source File | C Function
--- | --- | ---
15.3.1.3.26 | src/kernel.c | mrb_obj_is_kind_of_m
+#### local_variables
+
+ISO Code | Source File | C Function
+--- | --- | ---
+15.3.1.3.28 | src/kernel.c | mrb_local_variables
+
#### methods
ISO Code | Source File | C Function
diff --git a/doc/mrbconf/README.md b/doc/mrbconf/README.md
new file mode 100644
index 000000000..930e185da
--- /dev/null
+++ b/doc/mrbconf/README.md
@@ -0,0 +1,38 @@
+# mruby configuration macros.
+
+## stdio setting.
+`ENABLE_STDIO`
+* Will be defined automatically if `DISABLE_STDIO` isn't defined.
+* Uses `<stdio.h>` functions.
+
+`DISABLE_STDIO`
+* When defined `<stdio.h>` functions won't be used.
+
+## Debug macros.
+`ENABLE_DEBUG`
+* When defined code fetch hook and debug OP hook will be enabled.
+* When using any of the hook set function pointer `code_fetch_hook` and/or `debug_op_hook` of `mrb_state`.
+* Fetch hook will be called before any OP.
+* Debug OP hook will be called when dispatching `OP_DEBUG`.
+
+`DISABLE_DEBUG`
+* Will be define automatically if `ENABLE_DEBUG` isn't defined.
+
+`MRB_DEBUG`
+* When defined `mrb_assert*` macro will be defined with macros from `<assert.h>`.
+* Could be enabled via `enable_debug` method of `MRuby::Build`.
+
+## Stack configuration
+
+`MRB_STACK_EXTEND_DOUBLING`
+* If defined doubles the stack size when extending it.
+* Else extends stack with `MRB_STACK_GROWTH`.
+
+`MRB_STACK_GROWTH`
+* Default value is `128`.
+* Used in stack extending.
+* Ignored when `MRB_STACK_EXTEND_DOUBLING` is defined.
+
+`MRB_STACK_MAX`
+* Default value is `0x40000 - MRB_STACK_GROWTH`.
+* Raises `RuntimeError` when stack size exceeds this value.
diff --git a/doc/mrbgems/README.md b/doc/mrbgems/README.md
index 7ac225730..231914905 100644
--- a/doc/mrbgems/README.md
+++ b/doc/mrbgems/README.md
@@ -76,6 +76,8 @@ The maximal GEM structure looks like this:
+- GEM_NAME <- Name of GEM
|
+ +- include/ <- Header for Ruby extension (will exported)
+ |
+- mrblib/ <- Source for Ruby extension
|
+- src/ <- Source for C extension
@@ -87,10 +89,10 @@ The maximal GEM structure looks like this:
+- 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 C and pure Ruby files
-for testing purposes which will be used by `mrbtest`. *mrbgem.rake* contains
-the specification to compile C and Ruby files. *README.md* is a short description
-of your GEM.
+contains C/C++ files to extend mruby. The folder *include* contains C/C++ header
+files. The folder *test* contains C/C++ and pure Ruby files for testing purposes
+which will be used by `mrbtest`. *mrbgem.rake* contains the specification
+to compile C and Ruby files. *README.md* is a short description of your GEM.
## Build process
@@ -159,6 +161,22 @@ Its format is same as argument of method `MRuby::Build#gem`, expect that it can'
When a special version of depedency is required,
use `MRuby::Build#gem` in *build_config.rb* to override default gem.
+If you have conflicting GEMs use the following method:
+* `spec.add_conflict(gem, *requirements)`
+ * The `requirements` argument is same as in `add_dependency` method.
+
+like following code:
+
+ MRuby::Gem::Specification.new 'some-regexp-binding' do |spec|
+ spec.license = 'BSD'
+ spec.author = 'John Doe'
+
+ spec.add_conflict 'mruby-onig-regexp', '> 0.0.0'
+ spec.add_conflict 'mruby-hs-regexp'
+ spec.add_conflict 'mruby-pcre-regexp'
+ spec.add_conflict 'mruby-regexp-pcre'
+ end
+
In case your GEM has more complex build requirements you can use
the following options additionally inside of your GEM specification:
@@ -173,6 +191,19 @@ the following options additionally inside of your GEM specification:
* `spec.test_objs` (Object test files for integration into mrbtest)
* `spec.test_preload` (Initialization files for mrbtest)
+### include_paths and depencency
+
+Your GEM can export include paths to another GEMs that depends on your GEM.
+By default, `/...absolute path.../{GEM_NAME}/include` will be exported.
+So it is recommended not to put GEM's local header files on include/.
+
+These exports are retroactive.
+For example: when B depends to C and A depends to B, A will get include paths exported by C.
+
+Exported include_paths are automatically appended to GEM local include_paths by Minirake.
+You can use `spec.export_include_paths` accessor if you want more complex build.
+
+
## C Extension
mruby can be extended with C. This is possible by using the C API to