diff options
| -rw-r--r-- | build_config.rb | 3 | ||||
| -rw-r--r-- | doc/api/mruby/range.h.md | 47 | ||||
| -rw-r--r-- | doc/api/mruby/re.h.md | 4 | ||||
| -rw-r--r-- | doc/api/mruby/version.h.md | 34 | ||||
| -rw-r--r-- | tasks/mrbgem_spec.rake | 4 |
5 files changed, 69 insertions, 23 deletions
diff --git a/build_config.rb b/build_config.rb index d3c1ebc1f..96b1d4684 100644 --- a/build_config.rb +++ b/build_config.rb @@ -21,7 +21,6 @@ MRuby::Build.new do |conf| # include the default GEMs conf.gembox 'default' - conf.gem :core => 'mruby-eval' # C compiler settings # conf.cc do |cc| @@ -106,7 +105,7 @@ MRuby::Build.new('host-debug') do |conf| conf.gem :core => "mruby-bin-debugger" # bintest - conf.enable_bintest + # conf.enable_bintest end MRuby::Build.new('test') do |conf| diff --git a/doc/api/mruby/range.h.md b/doc/api/mruby/range.h.md new file mode 100644 index 000000000..188e6ede6 --- /dev/null +++ b/doc/api/mruby/range.h.md @@ -0,0 +1,47 @@ +#### mrb_range_new
+```C
+ mrb_value mrb_range_new(mrb_state*, mrb_value, mrb_value, mrb_bool);
+```
+Initializes a Range. The first mrb_value being the beginning value and second being the ending value.
+The third parameter is an mrb_bool value that represents the inclusion or exclusion of the last value.
+If the third parameter is 0 then it includes the last value in the range. If the third parameter is 1
+then it excludes the last value in the range.
+C code
+```C
+ #include <stdio.h>
+ #include <mruby.h>
+ #include "mruby/range.h" // Needs the range header.
+ #include "mruby/compile.h"
+
+ int main(int argc, char *argv[])
+ {
+ mrb_int beg = 0;
+ mrb_int end = 2;
+ mrb_bool exclude = 1;
+ mrb_value range_obj;
+ mrb_state *mrb = mrb_open();
+ if (!mrb) { /* handle error */ }
+ FILE *fp = fopen("test.rb","r");
+ range_obj = mrb_range_new(mrb, mrb_fixnum_value(beg), mrb_fixnum_value(end), exclude);
+ mrb_value obj = mrb_load_file(mrb,fp);
+ mrb_funcall(mrb, obj, "method_name", 1, range_obj);
+ fclose(fp);
+ mrb_close(mrb);
+ return 0;
+ }
+```
+Ruby code
+```Ruby
+ class Example_Class
+ def method_name(a)
+ puts a
+ puts a.class
+ end
+ end
+ Example_Class.new
+```
+This returns the following:
+```Ruby
+ 0...2
+ Range
+```
diff --git a/doc/api/mruby/re.h.md b/doc/api/mruby/re.h.md index 01e18c6a5..f5cd2a71e 100644 --- a/doc/api/mruby/re.h.md +++ b/doc/api/mruby/re.h.md @@ -1,3 +1,3 @@ -#### Macros
-### REGEXP_CLASS
+### Macros
+#### REGEXP_CLASS
A string with the name of the REGEXP class.
diff --git a/doc/api/mruby/version.h.md b/doc/api/mruby/version.h.md index daf87077d..f627b1da1 100644 --- a/doc/api/mruby/version.h.md +++ b/doc/api/mruby/version.h.md @@ -1,33 +1,33 @@ -#### Macros
-### MRUBY_RUBY_VERSION
+### Macros
+#### MRUBY_RUBY_VERSION
The version of Ruby used by mruby.
-### MRUBY_RUBY_ENGINE
+#### MRUBY_RUBY_ENGINE
Ruby engine.
-### MRUBY_VERSION
+#### MRUBY_VERSION
The mruby version.
-### MRUBY_RELEASE_MAJOR
+#### MRUBY_RELEASE_MAJOR
Major release version.
-### MRUBY_RELEASE_MINOR
+#### MRUBY_RELEASE_MINOR
Minor release version.
-### MRUBY_RELEASE_NO
+#### MRUBY_RELEASE_NO
Release number.
-### MRUBY_RELEASE_DATE
+#### MRUBY_RELEASE_DATE
Release date as a string.
-### MRUBY_RELEASE_YEAR
+#### MRUBY_RELEASE_YEAR
Release year.
-### MRUBY_RELEASE_MONTH
+#### MRUBY_RELEASE_MONTH
Release month.
-### MRUBY_RELEASE_DAY
+#### MRUBY_RELEASE_DAY
Release day.
-### MRUBY_BIRTH_YEAR
+#### MRUBY_BIRTH_YEAR
The year mruby was first created.
-### MRUBY_AUTHOR
+#### MRUBY_AUTHOR
Mruby's authors.
-### MRB_STRINGIZE0(expr)
+#### MRB_STRINGIZE0(expr)
A passed in expression.
-### MRB_STRINGIZE(expr)
+#### MRB_STRINGIZE(expr)
Passes in an expression to MRB_STRINGIZE0.
-### MRUBY_DESCRIPTION
+#### MRUBY_DESCRIPTION
mruby's version, and release date.
-### MRUBY_COPYRIGHT
+#### MRUBY_COPYRIGHT
mruby's copyright information.
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake index d13e7733f..74aa5b817 100644 --- a/tasks/mrbgem_spec.rake +++ b/tasks/mrbgem_spec.rake @@ -54,7 +54,7 @@ module MRuby end @linker = LinkerConfig.new([], [], [], []) - @rbfiles = Dir.glob("#{dir}/mrblib/*.rb").sort + @rbfiles = Dir.glob("#{dir}/mrblib/**/*.rb").sort @objs = Dir.glob("#{dir}/src/*.{c,cpp,cxx,cc,m,asm,s,S}").map do |f| objfile(f.relative_path_from(@dir).to_s.pathmap("#{build_dir}/%X")) end @@ -62,7 +62,7 @@ module MRuby @generate_functions = !(@rbfiles.empty? && @objs.empty?) @objs << objfile("#{build_dir}/gem_init") if @generate_functions - @test_rbfiles = Dir.glob("#{dir}/test/*.rb") + @test_rbfiles = Dir.glob("#{dir}/test/**/*.rb") @test_objs = Dir.glob("#{dir}/test/*.{c,cpp,cxx,cc,m,asm,s,S}").map do |f| objfile(f.relative_path_from(dir).to_s.pathmap("#{build_dir}/%X")) end |
