summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authordearblue <[email protected]>2020-12-21 21:45:37 +0900
committerdearblue <[email protected]>2020-12-21 21:48:50 +0900
commit6c1c2041ef81ea1ba3e96c93c40bfdf9fbc26602 (patch)
tree2c7095ab1d560117c93c06fab498714f49be3b95 /mrbgems
parent788ee38bdf4ab5fc95028a9ee482313e98610f99 (diff)
downloadmruby-6c1c2041ef81ea1ba3e96c93c40bfdf9fbc26602.tar.gz
mruby-6c1c2041ef81ea1ba3e96c93c40bfdf9fbc26602.zip
Take advantage of gembox
I think that it is easy to use if it is divided according to the type of library and the general purpose. It is a subdivision from the previous `default.gembox`. By type gembox: - `stdlib`: Add some standard Ruby methods not provided by core. - `stdlib-ext`: Add some standard Ruby methods that are not provided by `stdlib`. - `stdlib-io`: Provides `IO`, `File`, `Socket`, `print`, etc. Conflict with `MRB_NO_STDIO` - `math`: Add a class related to math. Conflict with `MRB_NO_FLOAT` - `metaprog`: Adds features related to metaprogramming. Purpose gembox: - `default.gembox`: Import the same gems as before - `default-no-stdio.gembox`: Import the` stdlib` and `math` - `default-no-fpu.gembox`: Import the` stdlib` only
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/default-no-fpu.gembox3
-rw-r--r--mrbgems/default-no-stdio.gembox4
-rw-r--r--mrbgems/default.gembox98
-rw-r--r--mrbgems/math.gembox10
-rw-r--r--mrbgems/metaprog.gembox15
-rw-r--r--mrbgems/stdlib-ext.gembox18
-rw-r--r--mrbgems/stdlib-io.gembox12
-rw-r--r--mrbgems/stdlib.gembox54
8 files changed, 121 insertions, 93 deletions
diff --git a/mrbgems/default-no-fpu.gembox b/mrbgems/default-no-fpu.gembox
new file mode 100644
index 000000000..57ebe164d
--- /dev/null
+++ b/mrbgems/default-no-fpu.gembox
@@ -0,0 +1,3 @@
+MRuby::GemBox.new do |conf|
+ gembox "stdlib"
+end
diff --git a/mrbgems/default-no-stdio.gembox b/mrbgems/default-no-stdio.gembox
new file mode 100644
index 000000000..8efb06a73
--- /dev/null
+++ b/mrbgems/default-no-stdio.gembox
@@ -0,0 +1,4 @@
+MRuby::GemBox.new do |conf|
+ gembox "stdlib"
+ gembox "math"
+end
diff --git a/mrbgems/default.gembox b/mrbgems/default.gembox
index ca8938e87..f7618a6e0 100644
--- a/mrbgems/default.gembox
+++ b/mrbgems/default.gembox
@@ -1,82 +1,9 @@
MRuby::GemBox.new do |conf|
- # Meta-programming features
- conf.gem :core => "mruby-metaprog"
-
- # Use standard IO/File class
- conf.gem :core => "mruby-io"
-
- # Use standard IO/File class
- conf.gem :core => "mruby-socket"
-
- # Use standard Array#pack, String#unpack methods
- conf.gem :core => "mruby-pack"
-
- # Use standard Kernel#sprintf method
- conf.gem :core => "mruby-sprintf"
-
- # Use standard print/puts/p
- conf.gem :core => "mruby-print"
-
- # Use standard Math module
- conf.gem :core => "mruby-math"
-
- # Use standard Time class
- conf.gem :core => "mruby-time"
-
- # Use standard Struct class
- conf.gem :core => "mruby-struct"
-
- # Use Comparable module extension
- conf.gem :core => "mruby-compar-ext"
-
- # Use Enumerable module extension
- conf.gem :core => "mruby-enum-ext"
-
- # Use String class extension
- conf.gem :core => "mruby-string-ext"
-
- # Use Numeric class extension
- conf.gem :core => "mruby-numeric-ext"
-
- # Use Array class extension
- conf.gem :core => "mruby-array-ext"
-
- # Use Hash class extension
- conf.gem :core => "mruby-hash-ext"
-
- # Use Range class extension
- conf.gem :core => "mruby-range-ext"
-
- # Use Proc class extension
- conf.gem :core => "mruby-proc-ext"
-
- # Use Symbol class extension
- conf.gem :core => "mruby-symbol-ext"
-
- # Use Random class
- conf.gem :core => "mruby-random"
-
- # Use Object class extension
- conf.gem :core => "mruby-object-ext"
-
- # Use ObjectSpace class
- conf.gem :core => "mruby-objectspace"
-
- # Use Fiber class
- conf.gem :core => "mruby-fiber"
-
- # Use Enumerator class (require mruby-fiber)
- conf.gem :core => "mruby-enumerator"
-
- # Use Enumerator::Lazy class (require mruby-enumerator)
- conf.gem :core => "mruby-enum-lazy"
-
- # Use toplevel object (main) methods extension
- conf.gem :core => "mruby-toplevel-ext"
-
- # Use Rational/Complex numbers
- conf.gem :core => "mruby-rational"
- conf.gem :core => "mruby-complex"
+ gembox "stdlib"
+ gembox "stdlib-ext"
+ gembox "stdlib-io"
+ gembox "math"
+ gembox "metaprog"
# Generate mrbc command
conf.gem :core => "mruby-bin-mrbc"
@@ -92,19 +19,4 @@ MRuby::GemBox.new do |conf|
# Generate mruby-config command
conf.gem :core => "mruby-bin-config"
-
- # Use Kernel module extension
- conf.gem :core => "mruby-kernel-ext"
-
- # Use class/module extension
- conf.gem :core => "mruby-class-ext"
-
- # Use Method/UnboundMethod class
- conf.gem :core => "mruby-method"
-
- # Use eval()
- conf.gem :core => "mruby-eval"
-
- # Use mruby-compiler to build other mrbgems
- conf.gem :core => "mruby-compiler"
end
diff --git a/mrbgems/math.gembox b/mrbgems/math.gembox
new file mode 100644
index 000000000..88f70ddde
--- /dev/null
+++ b/mrbgems/math.gembox
@@ -0,0 +1,10 @@
+# It also works with MRB_NO_STDIO.
+
+MRuby::GemBox.new do |conf|
+ # Use standard Math module
+ conf.gem :core => "mruby-math"
+
+ # Use Rational/Complex numbers
+ conf.gem :core => "mruby-rational"
+ conf.gem :core => "mruby-complex"
+end
diff --git a/mrbgems/metaprog.gembox b/mrbgems/metaprog.gembox
new file mode 100644
index 000000000..db35d307c
--- /dev/null
+++ b/mrbgems/metaprog.gembox
@@ -0,0 +1,15 @@
+# It also works with MRB_NO_STDIO and MRB_NO_FLOAT.
+
+MRuby::GemBox.new do |conf|
+ # Meta-programming features
+ conf.gem :core => "mruby-metaprog"
+
+ # Use Method/UnboundMethod class
+ conf.gem :core => "mruby-method"
+
+ # Use eval()
+ conf.gem :core => "mruby-eval"
+
+ # Use mruby-compiler to build other mrbgems
+ conf.gem :core => "mruby-compiler"
+end
diff --git a/mrbgems/stdlib-ext.gembox b/mrbgems/stdlib-ext.gembox
new file mode 100644
index 000000000..2177dca36
--- /dev/null
+++ b/mrbgems/stdlib-ext.gembox
@@ -0,0 +1,18 @@
+# It also works with MRB_NO_STDIO and MRB_NO_FLOAT.
+
+MRuby::GemBox.new do |conf|
+ # Use standard Array#pack, String#unpack methods
+ conf.gem :core => "mruby-pack"
+
+ # Use standard Kernel#sprintf method
+ conf.gem :core => "mruby-sprintf"
+
+ # Use standard Time class
+ conf.gem :core => "mruby-time"
+
+ # Use standard Struct class
+ conf.gem :core => "mruby-struct"
+
+ # Use Random class
+ conf.gem :core => "mruby-random"
+end
diff --git a/mrbgems/stdlib-io.gembox b/mrbgems/stdlib-io.gembox
new file mode 100644
index 000000000..cd1c2049c
--- /dev/null
+++ b/mrbgems/stdlib-io.gembox
@@ -0,0 +1,12 @@
+# It also works with MRB_NO_FLOAT.
+
+MRuby::GemBox.new do |conf|
+ # Use standard IO/File class
+ conf.gem :core => "mruby-io"
+
+ # Use standard IO/File class
+ conf.gem :core => "mruby-socket"
+
+ # Use standard print/puts/p
+ conf.gem :core => "mruby-print"
+end
diff --git a/mrbgems/stdlib.gembox b/mrbgems/stdlib.gembox
new file mode 100644
index 000000000..72fb9e343
--- /dev/null
+++ b/mrbgems/stdlib.gembox
@@ -0,0 +1,54 @@
+# It also works with MRB_NO_STDIO and MRB_NO_FLOAT.
+
+MRuby::GemBox.new do |conf|
+ # Use Comparable module extension
+ conf.gem :core => "mruby-compar-ext"
+
+ # Use Enumerable module extension
+ conf.gem :core => "mruby-enum-ext"
+
+ # Use String class extension
+ conf.gem :core => "mruby-string-ext"
+
+ # Use Numeric class extension
+ conf.gem :core => "mruby-numeric-ext"
+
+ # Use Array class extension
+ conf.gem :core => "mruby-array-ext"
+
+ # Use Hash class extension
+ conf.gem :core => "mruby-hash-ext"
+
+ # Use Range class extension
+ conf.gem :core => "mruby-range-ext"
+
+ # Use Proc class extension
+ conf.gem :core => "mruby-proc-ext"
+
+ # Use Symbol class extension
+ conf.gem :core => "mruby-symbol-ext"
+
+ # Use Object class extension
+ conf.gem :core => "mruby-object-ext"
+
+ # Use ObjectSpace class
+ conf.gem :core => "mruby-objectspace"
+
+ # Use Fiber class
+ conf.gem :core => "mruby-fiber"
+
+ # Use Enumerator class (require mruby-fiber)
+ conf.gem :core => "mruby-enumerator"
+
+ # Use Enumerator::Lazy class (require mruby-enumerator)
+ conf.gem :core => "mruby-enum-lazy"
+
+ # Use toplevel object (main) methods extension
+ conf.gem :core => "mruby-toplevel-ext"
+
+ # Use Kernel module extension
+ conf.gem :core => "mruby-kernel-ext"
+
+ # Use class/module extension
+ conf.gem :core => "mruby-class-ext"
+end