@@ -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|
--- /dev/null
+#### mrb_range_new\r
+```C\r
+ mrb_value mrb_range_new(mrb_state*, mrb_value, mrb_value, mrb_bool);\r
+```\r
+Initializes a Range. The first mrb_value being the beginning value and second being the ending value.\r
+The third parameter is an mrb_bool value that represents the inclusion or exclusion of the last value.\r
+If the third parameter is 0 then it includes the last value in the range. If the third parameter is 1 \r
+then it excludes the last value in the range.\r
+C code\r
+```C\r
+ #include <stdio.h>\r
+ #include <mruby.h>\r
+ #include "mruby/range.h" // Needs the range header.\r
+ #include "mruby/compile.h"\r
+\r
+ int main(int argc, char *argv[])\r
+ {\r
+ mrb_int beg = 0;\r
+ mrb_int end = 2;\r
+ mrb_bool exclude = 1;\r
+ mrb_value range_obj;\r
+ mrb_state *mrb = mrb_open();\r
+ if (!mrb) { /* handle error */ }\r
+ FILE *fp = fopen("test.rb","r");\r
+ range_obj = mrb_range_new(mrb, mrb_fixnum_value(beg), mrb_fixnum_value(end), exclude);\r
+ mrb_value obj = mrb_load_file(mrb,fp);\r
+ mrb_funcall(mrb, obj, "method_name", 1, range_obj);\r
+ fclose(fp);\r
+ mrb_close(mrb);\r
+ return 0;\r
+ }\r
+```\r
+Ruby code\r
+```Ruby\r
+ class Example_Class\r
+ def method_name(a)\r
+ puts a\r
+ puts a.class\r
+ end\r
+ end\r
+ Example_Class.new\r
+```\r
+This returns the following:\r
+```Ruby\r
+ 0...2\r
+ Range\r
+```\r
-#### Macros\r
-### REGEXP_CLASS\r
+### Macros\r
+#### REGEXP_CLASS\r
A string with the name of the REGEXP class.\r
-#### Macros\r
-### MRUBY_RUBY_VERSION\r
+### Macros\r
+#### MRUBY_RUBY_VERSION\r
The version of Ruby used by mruby.\r
-### MRUBY_RUBY_ENGINE\r
+#### MRUBY_RUBY_ENGINE\r
Ruby engine.\r
-### MRUBY_VERSION\r
+#### MRUBY_VERSION\r
The mruby version.\r
-### MRUBY_RELEASE_MAJOR\r
+#### MRUBY_RELEASE_MAJOR\r
Major release version.\r
-### MRUBY_RELEASE_MINOR\r
+#### MRUBY_RELEASE_MINOR\r
Minor release version.\r
-### MRUBY_RELEASE_NO\r
+#### MRUBY_RELEASE_NO\r
Release number.\r
-### MRUBY_RELEASE_DATE\r
+#### MRUBY_RELEASE_DATE\r
Release date as a string.\r
-### MRUBY_RELEASE_YEAR\r
+#### MRUBY_RELEASE_YEAR\r
Release year.\r
-### MRUBY_RELEASE_MONTH\r
+#### MRUBY_RELEASE_MONTH\r
Release month.\r
-### MRUBY_RELEASE_DAY\r
+#### MRUBY_RELEASE_DAY\r
Release day.\r
-### MRUBY_BIRTH_YEAR\r
+#### MRUBY_BIRTH_YEAR\r
The year mruby was first created.\r
-### MRUBY_AUTHOR\r
+#### MRUBY_AUTHOR\r
Mruby's authors.\r
-### MRB_STRINGIZE0(expr)\r
+#### MRB_STRINGIZE0(expr)\r
A passed in expression.\r
-### MRB_STRINGIZE(expr)\r
+#### MRB_STRINGIZE(expr)\r
Passes in an expression to MRB_STRINGIZE0.\r
-### MRUBY_DESCRIPTION\r
+#### MRUBY_DESCRIPTION\r
mruby's version, and release date.\r
-### MRUBY_COPYRIGHT\r
+#### MRUBY_COPYRIGHT\r
mruby's copyright information.\r
@@ -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