From 95a9f3b838b47a3507926408f4abe552b6ef8574 Mon Sep 17 00:00:00 2001 From: Tom Black Date: Wed, 8 Mar 2017 00:01:25 -0500 Subject: Fix native app compilation with MRuby Also print clearer error when MRuby does not exist. --- bin/ruby2d | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/ruby2d b/bin/ruby2d index b5c862b..d399479 100755 --- a/bin/ruby2d +++ b/bin/ruby2d @@ -5,9 +5,8 @@ require 'fileutils' # Extending `String` to include some fancy colors class String def colorize(c); "\e[#{c}m#{self}\e[0m" end - def bold; colorize('1') end - def red; colorize('1;31') end - def red_underline; colorize('4;31') end + def bold; colorize('1') end + def error; colorize('4;31') end end # The installed gem directory @@ -78,9 +77,7 @@ def build_native(rb_file) # Check if MRuby exists; if not, quit if `which mruby`.empty? - puts "\n#{"mruby".bold} is needed to build native Ruby 2D applications.\n\n", - " On macOS, install using #{"Homebrew".bold}:", - " brew install mruby\n\n" + puts "#{'Error:'.error} Can't find MRuby, which is needed to build native Ruby 2D applications.\n" exit end @@ -105,7 +102,7 @@ def build_native(rb_file) end # Compile to native executable - `cc -lmruby \`simple2d --libs\` build/app.c -o build/app` + `cc build/app.c -lmruby \`simple2d --libs\` -o build/app` # Success! puts "Native app created at `build/app`" -- cgit v1.2.3