summaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authordearblue <[email protected]>2021-05-05 19:01:57 +0900
committerdearblue <[email protected]>2021-05-05 22:16:03 +0900
commit6fc5dc986a5ffc1a74c63ad0617ea1dcc10d3cdd (patch)
tree86da312642d6093ebd28452e13c295a842ed118a /doc
parent35a6dfe905ec3cca51dabbcc8d17032c9f3a305c (diff)
downloadmruby-6fc5dc986a5ffc1a74c63ad0617ea1dcc10d3cdd.tar.gz
mruby-6fc5dc986a5ffc1a74c63ad0617ea1dcc10d3cdd.zip
Extend the tab with 8 whitespace
This work was done as follows: - check: `git grep $'\011' -- :^oss-fuzz` - convert: `ruby -pi -e 'nil while $_.sub!(/^(.*?)\t/) { $1 + " " * (8 - $1.size % 8) }'` The `doc/guide/{compile,mrbgems}.md` file adds and removes whitespace to make the directory tree look the same. In `mrbgems/mruby-socket/src/socket.c`, there is a part where the indent is changed from 4 to 2 at the same time as the tab is changed.
Diffstat (limited to 'doc')
-rw-r--r--doc/guides/compile.md92
-rw-r--r--doc/guides/mrbgems.md144
2 files changed, 123 insertions, 113 deletions
diff --git a/doc/guides/compile.md b/doc/guides/compile.md
index 7156b2b68..08dbd850f 100644
--- a/doc/guides/compile.md
+++ b/doc/guides/compile.md
@@ -333,9 +333,9 @@ conf.enable_debug
When debugging mode is enabled
* Macro `MRB_DEBUG` would be defined.
- * Which means `mrb_assert()` macro is enabled.
+ * Which means `mrb_assert()` macro is enabled.
* Debug information of irep would be generated by `mrbc`.
- * Because `-g` flag would be added to `mrbc` runner.
+ * Because `-g` flag would be added to `mrbc` runner.
* You can have better backtrace of mruby scripts with this.
## Cross-Compilation
@@ -379,23 +379,25 @@ end
During the build process the directory `build` will be created in the
root directory. The structure of this directory will look like this:
- +- build
- |
- +- host
- |
- +- LEGAL <- License description
- |
- +- bin <- Binaries (mirb, mrbc and mruby)
- |
- +- lib <- Libraries (libmruby.a and libmruby_core.a)
- |
- +- mrbc <- Minimal mrbc place
- |
- +- mrbgems <- Compilation result from mrbgems
- |
- +- mrblib <- Compilation result from mrblib
- |
- +- src <- Compilation result from C sources
+```
++- build
+ |
+ +- host
+ |
+ +- LEGAL <- License description
+ |
+ +- bin <- Binaries (mirb, mrbc and mruby)
+ |
+ +- lib <- Libraries (libmruby.a and libmruby_core.a)
+ |
+ +- mrbc <- Minimal mrbc place
+ |
+ +- mrbgems <- Compilation result from mrbgems
+ |
+ +- mrblib <- Compilation result from mrblib
+ |
+ +- src <- Compilation result from C sources
+```
The compilation workflow will look like this:
@@ -425,31 +427,33 @@ The compilation workflow will look like this:
In case of a cross-compilation to `i386` the `build` directory structure looks
like this:
- +- build
- |
- +- host
- | |
- | +- bin <- Native Binaries
- | |
- | +- lib <- Native Libraries
- | |
- | +- mrbgems
- | |
- | +- src
- |
- +- i386
- |
- +- bin <- Cross-compiled Binaries
- |
- +- include <- Header Directory
- |
- +- lib <- Cross-compiled Libraries
- |
- +- mrbgems
- |
- +- mrblib
- |
- +- src
+```
++- build
+ |
+ +- host
+ | |
+ | +- bin <- Native Binaries
+ | |
+ | +- lib <- Native Libraries
+ | |
+ | +- mrbgems
+ | |
+ | +- src
+ |
+ +- i386
+ |
+ +- bin <- Cross-compiled Binaries
+ |
+ +- include <- Header Directory
+ |
+ +- lib <- Cross-compiled Libraries
+ |
+ +- mrbgems
+ |
+ +- mrblib
+ |
+ +- src
+```
An extra directory is created for the target platform. In case you
compile for `i386` a directory called `i386` is created under the
diff --git a/doc/guides/mrbgems.md b/doc/guides/mrbgems.md
index d4160ebc8..9aebb9208 100644
--- a/doc/guides/mrbgems.md
+++ b/doc/guides/mrbgems.md
@@ -111,21 +111,21 @@ contains every gem found in the `mrbgems` directory.
The maximal GEM structure looks like this:
```
-+- GEM_NAME <- Name of GEM
- |
- +- README.md <- Readme for GEM
- |
- +- mrbgem.rake <- GEM Specification
- |
- +- include/ <- Header for Ruby extension (will exported)
- |
- +- mrblib/ <- Source for Ruby extension
- |
- +- src/ <- Source for C extension
- |
- +- tools/ <- Source for Executable (in C)
- |
- +- test/ <- Test code (Ruby)
++- GEM_NAME <- Name of GEM
+ |
+ +- README.md <- Readme for GEM
+ |
+ +- mrbgem.rake <- GEM Specification
+ |
+ +- include/ <- Header for Ruby extension (will exported)
+ |
+ +- mrblib/ <- Source for Ruby extension
+ |
+ +- src/ <- Source for C extension
+ |
+ +- tools/ <- Source for Executable (in C)
+ |
+ +- test/ <- Test code (Ruby)
```
The folder `mrblib` contains pure Ruby files to extend mruby. The folder `src`
@@ -297,19 +297,21 @@ mrb_c_extension_example_gem_final(mrb_state* mrb) {
### Example
- +- c_extension_example/
- |
- +- README.md (Optional)
- |
- +- src/
- | |
- | +- example.c <- C extension source
- |
- +- test/
- | |
- | +- example.rb <- Test code for C extension
- |
- +- mrbgem.rake <- GEM specification
+```
++- c_extension_example/
+ |
+ +- README.md (Optional)
+ |
+ +- src/
+ | |
+ | +- example.c <- C extension source
+ |
+ +- test/
+ | |
+ | +- example.rb <- Test code for C extension
+ |
+ +- mrbgem.rake <- GEM specification
+```
## Ruby Extension
@@ -323,19 +325,21 @@ none
### Example
- +- ruby_extension_example/
- |
- +- README.md (Optional)
- |
- +- mrblib/
- | |
- | +- example.rb <- Ruby extension source
- |
- +- test/
- | |
- | +- example.rb <- Test code for Ruby extension
- |
- +- mrbgem.rake <- GEM specification
+```
++- ruby_extension_example/
+ |
+ +- README.md (Optional)
+ |
+ +- mrblib/
+ | |
+ | +- example.rb <- Ruby extension source
+ |
+ +- test/
+ | |
+ | +- example.rb <- Test code for Ruby extension
+ |
+ +- mrbgem.rake <- GEM specification
+```
## C and Ruby Extension
@@ -353,23 +357,25 @@ See C and Ruby example.
### Example
- +- c_and_ruby_extension_example/
- |
- +- README.md (Optional)
- |
- +- mrblib/
- | |
- | +- example.rb <- Ruby extension source
- |
- +- src/
- | |
- | +- example.c <- C extension source
- |
- +- test/
- | |
- | +- example.rb <- Test code for C and Ruby extension
- |
- +- mrbgem.rake <- GEM specification
+```
++- c_and_ruby_extension_example/
+ |
+ +- README.md (Optional)
+ |
+ +- mrblib/
+ | |
+ | +- example.rb <- Ruby extension source
+ |
+ +- src/
+ | |
+ | +- example.c <- C extension source
+ |
+ +- test/
+ | |
+ | +- example.rb <- Test code for C and Ruby extension
+ |
+ +- mrbgem.rake <- GEM specification
+```
## Binary gems
@@ -389,23 +395,23 @@ binary gems, to separate normal gems and binary gems.
### Example
```
- +- mruby-bin-example/
++- mruby-bin-example/
|
- +- README.md (Optional)
+ +- README.md (Optional)
|
+- bintest/
- | |
- | +- example.rb <- Test code for binary gem
+ | |
+ | +- example.rb <- Test code for binary gem
|
- +- mrbgem.rake <- Gem specification
+ +- mrbgem.rake <- Gem specification
|
- +- mrblib/ <- Source for Ruby extension (Optional)
+ +- mrblib/ <- Source for Ruby extension (Optional)
|
- +- src/ <- Source for C extension (Optional)
+ +- src/ <- Source for C extension (Optional)
|
+- tools/
- |
- +- example/ <- Executable name directory
- |
- +- example.c <- Source for Executable (includes main)
+ |
+ +- example/ <- Executable name directory
+ |
+ +- example.c <- Source for Executable (includes main)
```