Created
February 28, 2018 08:19
-
-
Save texrg/20e3ce008a653c26ef0b6e4610b22441 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MRuby::GemBox.new do |conf| | |
# 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 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 Enumerable::Lazy class (require mruby-enumerator) | |
conf.gem :core => "mruby-enum-lazy" | |
# Use toplevel object (main) methods extension | |
conf.gem :core => "mruby-toplevel-ext" | |
# Generate mirb command | |
# conf.gem :core => "mruby-bin-mirb" | |
# Generate mruby command | |
# conf.gem :core => "mruby-bin-mruby" | |
# Generate mruby-strip command | |
conf.gem :core => "mruby-bin-strip" | |
# Use Kernel module extension | |
conf.gem :core => "mruby-kernel-ext" | |
# Use mruby-compiler to build other mrbgems | |
# tu jest np.: mrb_load_string | |
# conf.gem :core => "mruby-compiler" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "mruby.h" | |
#include <mruby/compile.h> | |
int main() | |
{ | |
mrb_value c; | |
mrb_state *mrb = mrb_open(); | |
FILE *kod; | |
kod = fopen("test.rb", "r"); | |
c = mrb_load_file(mrb, kod); | |
if (!mrb) { printf("Problemy z programem"); } | |
fclose(kod); | |
mrb_close(mrb); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Why i can use Build.new('minimal') without default | |
MRuby::Build.new do |conf| | |
toolchain :gcc | |
conf.cc.flags << '-Os' | |
conf.enable_test | |
conf.gembox 'default' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
File.open("zz",'w') do |f| | |
f.puts "LL" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment