Merge branch 'polyfox-module-prepend'
authorYukihiro "Matz" Matsumoto <[email protected]>
Fri, 4 Sep 2015 17:04:20 +0000 (5 02:04 +0900)
committerYukihiro "Matz" Matsumoto <[email protected]>
Fri, 4 Sep 2015 17:04:20 +0000 (5 02:04 +0900)
build_config.rb
doc/api/mruby/range.h.md [new file with mode: 0644]
doc/api/mruby/re.h.md
doc/api/mruby/version.h.md
tasks/mrbgem_spec.rake

index d3c1ebc..96b1d46 100644 (file)
@@ -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 (file)
index 0000000..188e6ed
--- /dev/null
@@ -0,0 +1,47 @@
+#### 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
index 01e18c6..f5cd2a7 100644 (file)
@@ -1,3 +1,3 @@
-#### Macros\r
-### REGEXP_CLASS\r
+### Macros\r
+#### REGEXP_CLASS\r
 A string with the name of the REGEXP class.\r
index daf8707..f627b1d 100644 (file)
@@ -1,33 +1,33 @@
-#### 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
index d13e773..74aa5b8 100644 (file)
@@ -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