Skip to content
Permalink
Browse files
Removed trailing spaces
  • Loading branch information
nobu committed Sep 28, 2016
1 parent 9d3167c commit 6511bfd79af479bd889a2d9250631a5ed78ecf51
Show file tree
Hide file tree
Showing 20 changed files with 82 additions and 82 deletions.
@@ -96,7 +96,7 @@ class Liste < Array
def initialize(str = nil)
@feld = str
end
end
end
p Liste.new "foobar"
```
@@ -5,20 +5,20 @@
MRuby::Build.new do |conf|
toolchain :gcc
conf.gembox 'default'
conf.cc.defines = %w(ENABLE_READLINE)
conf.cc.defines = %w(ENABLE_READLINE)
conf.gembox 'default'

#lightweight regular expression
conf.gem :github => "pbosetti/mruby-hs-regexp", :branch => "master"

end

# Define cross build settings
MRuby::CrossBuild.new('core2-32-poky-linux') do |conf|
toolchain :gcc

# Mac OS X
#
#
POKY_EDISON_PATH = '/opt/poky-edison/1.7.2'

POKY_EDISON_SYSROOT = "#{POKY_EDISON_PATH}/sysroots/core2-32-poky-linux"
@@ -42,7 +42,7 @@
cxx.include_paths << ["#{POKY_EDISON_SYSROOT}/usr/include/c++/4.9.1"]
cxx.flags = conf.cc.flags.dup
cxx.defines = conf.cc.defines.dup
cxx.compile_options = conf.cc.compile_options.dup
cxx.compile_options = conf.cc.compile_options.dup
end

conf.archiver do |archiver|
@@ -222,7 +222,7 @@ MRB_API struct RClass *mrb_define_class(mrb_state *mrb, const char *name, struct

/**
* Defines a new module.
*
*
* @param [mrb_state *] mrb_state* The current mruby state.
* @param [const char *] char* The name of the module.
* @return [struct RClass *] Reference to the newly defined module.
@@ -232,11 +232,11 @@ MRB_API mrb_value mrb_singleton_class(mrb_state*, mrb_value);

/**
* Include a module in another class or module.
* Equivalent to:
* Equivalent to:
*
* module B
* include A
* end
* module B
* include A
* end
* @param [mrb_state *] mrb_state* The current mruby state.
* @param [struct RClass *] RClass* A reference to module or a class.
* @param [struct RClass *] RClass* A reference to the module to be included.
@@ -253,7 +253,7 @@ MRB_API void mrb_include_module(mrb_state*, struct RClass*, struct RClass*);
* @param [mrb_state *] mrb_state* The current mruby state.
* @param [struct RClass *] RClass* A reference to module or a class.
* @param [struct RClass *] RClass* A reference to the module to be prepended.
*/
*/
MRB_API void mrb_prepend_module(mrb_state*, struct RClass*, struct RClass*);

/**
@@ -302,7 +302,7 @@ MRB_API void mrb_define_method(mrb_state *mrb, struct RClass *cla, const char *n
* foo = mrb_define_class(mrb, "Foo", mrb->object_class);
* mrb_define_class_method(mrb, foo, "bar", bar_method, MRB_ARGS_NONE());
* }
* @param [mrb_state *] mrb_state* The MRuby state reference.
* @param [mrb_state *] mrb_state* The MRuby state reference.
* @param [struct RClass *] RClass* The class where the class method will be defined.
* @param [const char *] char* The name of the class method being defined.
* @param [mrb_func_t] mrb_func_t The function pointer to the class method definition.
@@ -317,23 +317,23 @@ MRB_API void mrb_define_singleton_method(mrb_state*, struct RObject*, const char
* Example:
*
* # Ruby style
* module Foo
* module Foo
* def Foo.bar
* end
* end
* // C style
* end
* end
* // C style
* mrb_value bar_method(mrb_state* mrb, mrb_value self){
* return mrb_nil_value();
* }
* void mrb_example_gem_init(mrb_state* mrb){
* return mrb_nil_value();
* }
* void mrb_example_gem_init(mrb_state* mrb){
* struct RClass *foo;
* foo = mrb_define_module(mrb, "Foo");
* foo = mrb_define_module(mrb, "Foo");
* mrb_define_module_function(mrb, foo, "bar", bar_method, MRB_ARGS_NONE());
* }
* }
* @param [mrb_state *] mrb_state* The MRuby state reference.
* @param [struct RClass *] RClass* The module where the module function will be defined.
* @param [const char *] char* The name of the module function being defined.
* @param [mrb_func_t] mrb_func_t The function pointer to the module function definition.
* @param [mrb_func_t] mrb_func_t The function pointer to the module function definition.
* @param [mrb_aspec] mrb_aspec The method parameters declaration.
*/
MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*, mrb_func_t, mrb_aspec);
@@ -348,9 +348,9 @@ MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*,
* AGE = 22
* end
* // C style
* #include <stdio.h>
* #include <stdio.h>
* #include <mruby.h>
*
*
* void
* mrb_example_gem_init(mrb_state* mrb){
* mrb_define_const(mrb, mrb->kernel_module, "AGE", mrb_fixnum_value(22));
@@ -389,7 +389,7 @@ MRB_API void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_
* // C style
* #include <stdio.h>
* #include <mruby.h>
*
*
* mrb_value
* mrb_example_method(mrb_state *mrb){
* return mrb_str_new_cstr(mrb, "example");
@@ -400,14 +400,14 @@ MRB_API void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_
* struct RClass *example_class_a;
* struct RClass *example_class_b;
* struct RClass *example_class_c;
*
*
* example_class_a = mrb_define_class(mrb, "ExampleClassA", mrb->object_class);
* mrb_define_method(mrb, example_class_a, "example_method", mrb_example_method, MRB_ARGS_NONE());
* example_class_b = mrb_define_class(mrb, "ExampleClassB", example_class_a);
* example_class_c = mrb_define_class(mrb, "ExampleClassC", example_class_b);
* mrb_undef_method(mrb, example_class_c, "example_method");
* }
*
*
* mrb_example_gem_final(mrb_state* mrb){
* }
* @param [mrb_state*] mrb_state* The mruby state reference.
@@ -428,24 +428,24 @@ MRB_API void mrb_undef_method(mrb_state*, struct RClass*, const char*);
* end
*
* ExampleClass.example_method
*
*
* // C style
* #include <stdio.h>
* #include <mruby.h>
* #include <mruby.h>
*
* mrb_value
* mrb_example_method(mrb_state *mrb){
* return mrb_str_new_cstr(mrb, "example");
* return mrb_str_new_cstr(mrb, "example");
* }
*
*
* void
* mrb_example_gem_init(mrb_state* mrb){
* struct RClass *example_class;
* example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class);
* mrb_define_class_method(mrb, example_class, "example_method", mrb_example_method, MRB_ARGS_NONE());
* mrb_undef_class_method(mrb, example_class, "example_method");
* }
*
*
* void
* mrb_example_gem_final(mrb_state* mrb){
* }
@@ -476,7 +476,7 @@ MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*);
* example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class); # => class ExampleClass; end
* obj = mrb_obj_new(mrb, example_class, 0, NULL); # => ExampleClass.new
* mrb_p(mrb, obj); // => Kernel#p
* }
* }
* @param [mrb_state*] mrb The current mruby state.
* @param [RClass*] c Reference to the class of the new object.
* @param [mrb_int] argc Number of arguments in argv
@@ -501,7 +501,7 @@ MRB_API mrb_value mrb_instance_new(mrb_state *mrb, mrb_value cv);
* void
* mrb_example_gem_init(mrb_state* mrb) {
* struct RClass *example_class;
*
*
* mrb_value obj;
* example_class = mrb_class_new(mrb, mrb->object_class);
* obj = mrb_obj_new(mrb, example_class, 0, NULL); // => #<#<Class:0x9a945b8>:0x9a94588>
@@ -521,7 +521,7 @@ MRB_API struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super);
* void
* mrb_example_gem_init(mrb_state* mrb) {
* struct RClass *example_module;
*
*
* example_module = mrb_module_new(mrb);
* }
*
@@ -541,7 +541,7 @@ MRB_API struct RClass * mrb_module_new(mrb_state *mrb);
*
* example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class);
* cd = mrb_class_defined(mrb, "ExampleClass");
*
*
* // If mrb_class_defined returns 1 then puts "True"
* // If mrb_class_defined returns 0 then puts "False"
* if (cd == 1){
@@ -597,7 +597,7 @@ MRB_API mrb_value mrb_notimplement_m(mrb_state*, mrb_value);
* Duplicate an object.
*
* Equivalent to:
* Object#dup
* Object#dup
* @param [mrb_state*] mrb The current mruby state.
* @param [mrb_value] obj Object to be duplicate.
* @return [mrb_value] The newly duplicated object.
@@ -629,7 +629,7 @@ MRB_API mrb_value mrb_check_to_integer(mrb_state *mrb, mrb_value val, const char
* mrb_define_method(mrb, example_class, "example_method", exampleMethod, MRB_ARGS_NONE());
* mid = mrb_intern_str(mrb, mrb_str_new_cstr(mrb, "example_method" ));
* obj_resp = mrb_obj_respond_to(mrb, example_class, mid); // => 1(true in Ruby world)
*
*
* // If mrb_obj_respond_to returns 1 then puts "True"
* // If mrb_obj_respond_to returns 0 then puts "False"
* if (obj_resp == 1) {
@@ -780,13 +780,13 @@ mrb_get_argc(mrb_state *mrb) /* get argc */
* #include <stdio.h>
* #include <mruby.h>
* #include "mruby/compile.h"
*
*
* int
* main()
* {
* mrb_int i = 99;
* mrb_state *mrb = mrb_open();
*
*
* if (!mrb) { }
* FILE *fp = fopen("test.rb","r");
* mrb_value obj = mrb_load_file(mrb,fp);
@@ -804,7 +804,7 @@ mrb_get_argc(mrb_state *mrb) /* get argc */
MRB_API mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, mrb_int,...);
/**
* Call existing ruby functions. This is basically the type safe version of mrb_funcall.
*
*
* #include <stdio.h>
* #include <mruby.h>
* #include "mruby/compile.h"
@@ -813,10 +813,10 @@ MRB_API mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, mrb_int,...);
* {
* mrb_int i = 99;
* mrb_state *mrb = mrb_open();
*
*
* if (!mrb) { }
* mrb_sym m_sym = mrb_intern_cstr(mrb, "method_name"); // Symbol for method.
*
*
* FILE *fp = fopen("test.rb","r");
* mrb_value obj = mrb_load_file(mrb,fp);
* mrb_funcall_argv(mrb, obj, m_sym, 1, &obj); // Calling ruby function from test.rb.
@@ -841,7 +841,7 @@ MRB_API mrb_value mrb_funcall_with_block(mrb_state*, mrb_value, mrb_sym, mrb_int
*
* # Ruby style:
* :pizza # => :pizza
*
*
* // C style:
* mrb_sym m_sym = mrb_intern_cstr(mrb, "pizza"); // => :pizza
* @param [mrb_state*] mrb_state* The current mruby state.
@@ -91,12 +91,12 @@ MRB_API void mrb_str_modify(mrb_state*, struct RString*);
/*
* Appends self to other. Returns self as a concatnated string.
*
*
*
* Example:
*
* !!!c
* int
* main(int argc,
* main(int argc,
* char **argv)
* {
* // Variable declarations.
@@ -138,12 +138,12 @@ MRB_API void mrb_str_concat(mrb_state*, mrb_value, mrb_value);
/*
* Adds two strings together.
*
*
*
* Example:
*
* !!!c
* int
* main(int argc,
* main(int argc,
* char **argv)
* {
* // Variable declarations.
@@ -215,7 +215,7 @@ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
*
* !!!c
* int
* main(int argc,
* main(int argc,
* char **argv)
* {
* // Variable declaration.
@@ -224,11 +224,11 @@ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
* mrb_state *mrb = mrb_open();
* if (!mrb)
* {
* // handle error
* // handle error
* }
* // Creates a new string.
* str = mrb_str_new_cstr(mrb, "Hello, world!");
* // Returns 5 characters of
* // Returns 5 characters of
* mrb_str_resize(mrb, str, 5);
* mrb_p(mrb, str);
*
@@ -254,7 +254,7 @@ MRB_API mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len);
*
* !!!c
* int
* main(int argc,
* main(int argc,
* char const **argv)
* {
* // Variable declarations.
@@ -14,7 +14,7 @@ def self.test(rubysource, testcase)

# compile
`./bin/mrbc -g -o "#{bin.path}" "#{script.path}"`

# add mrdb quit
testcase << {:cmd=>"quit"}

@@ -13,7 +13,7 @@ def self.test(rubysource, testcase)

# compile
`./bin/mrbc -g -o "#{bin.path}" "#{script.path}"`

# add mrdb quit
testcase << {:cmd=>"quit"}

0 comments on commit 6511bfd

Please sign in to comment.