diff options
| author | Ryan Scott <[email protected]> | 2013-05-18 11:05:09 +1000 |
|---|---|---|
| committer | Ryan Scott <[email protected]> | 2013-05-18 11:05:09 +1000 |
| commit | 8161f0f6d7f89ad723163943d2d3abc38cd02df5 (patch) | |
| tree | e6ce15a81d79744aa9b7ec30bd32b994586a60db /tasks | |
| parent | 008aec2bbcd38fa13c27b6df2b2463b6a88cefff (diff) | |
| parent | c8c4dfe426da121549f73fd776d0696a701db6b6 (diff) | |
| download | mruby-8161f0f6d7f89ad723163943d2d3abc38cd02df5.tar.gz mruby-8161f0f6d7f89ad723163943d2d3abc38cd02df5.zip | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/mrbgem_spec.rake | 1 | ||||
| -rw-r--r-- | tasks/mruby_build_commands.rake | 15 |
2 files changed, 9 insertions, 7 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake index f5edc515b..2ed72c3ff 100644 --- a/tasks/mrbgem_spec.rake +++ b/tasks/mrbgem_spec.rake @@ -136,6 +136,7 @@ module MRuby unless rbfiles.empty? f.puts %Q[ mrb_load_irep(mrb, gem_mrblib_irep_#{funcname});] f.puts %Q[ if (mrb->exc) {] + f.puts %Q[ mrb_print_backtrace(mrb);] f.puts %Q[ mrb_p(mrb, mrb_obj_value(mrb->exc));] f.puts %Q[ exit(EXIT_FAILURE);] f.puts %Q[ }] diff --git a/tasks/mruby_build_commands.rake b/tasks/mruby_build_commands.rake index a47633c51..1d69fa54d 100644 --- a/tasks/mruby_build_commands.rake +++ b/tasks/mruby_build_commands.rake @@ -236,20 +236,21 @@ module MRuby end class Command::Mrbc < Command + attr_accessor :compile_options + def initialize(build) super @command = nil - @compile_options = "-B%{funcname} -o- -" + @compile_options = "-B%{funcname} -o-" end def run(out, infiles, funcname) @command ||= @build.mrbcfile - IO.popen("#{filename @command} #{@compile_options % {:funcname => funcname}}", 'r+') do |io| - [infiles].flatten.each do |f| - _pp "MRBC", f.relative_path, nil, :indent => 2 - io.write IO.read(f) - end - io.close_write + infiles = [infiles].flatten + infiles.each do |f| + _pp "MRBC", f.relative_path, nil, :indent => 2 + end + IO.popen("#{filename @command} #{@compile_options % {:funcname => funcname}} #{infiles.join(' ')}", 'r+') do |io| out.puts io.read end end |
