From d426b3c21269df23cfbc4dd634c35d5d487aa090 Mon Sep 17 00:00:00 2001 From: Tom Black Date: Fri, 17 Feb 2017 00:53:59 -0500 Subject: Minor cleanup --- ext/ruby2d/extconf.rb | 4 ++-- lib/ruby2d/application.rb | 1 - lib/ruby2d/dsl.rb | 1 - lib/ruby2d/image.rb | 9 ++++++--- lib/ruby2d/text.rb | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ext/ruby2d/extconf.rb b/ext/ruby2d/extconf.rb index 305f5fc..592ccaa 100644 --- a/ext/ruby2d/extconf.rb +++ b/ext/ruby2d/extconf.rb @@ -5,8 +5,8 @@ $errors = [] class String def colorize(c); "\e[#{c}m#{self}\e[0m" end - def bold; colorize('1') end - def red; colorize('1;31') end + def bold; colorize('1') end + def red; colorize('1;31') end end def print_errors diff --git a/lib/ruby2d/application.rb b/lib/ruby2d/application.rb index c6924b1..8de526d 100644 --- a/lib/ruby2d/application.rb +++ b/lib/ruby2d/application.rb @@ -12,7 +12,6 @@ module Ruby2D::Application @@window.set(opts) end - # def on(mouse: nil, key: nil, key_up: nil, key_down: nil, controller: nil, &proc) def on(args = {}, &proc) @@window.on(args, &proc) end diff --git a/lib/ruby2d/dsl.rb b/lib/ruby2d/dsl.rb index 20d088e..910c100 100644 --- a/lib/ruby2d/dsl.rb +++ b/lib/ruby2d/dsl.rb @@ -9,7 +9,6 @@ module Ruby2D::DSL Application.set(opts) end - # def on(mouse: nil, key: nil, key_up: nil, key_down: nil, controller: nil, &proc) def on(args = {}, &proc) Application.on(args, &proc) end diff --git a/lib/ruby2d/image.rb b/lib/ruby2d/image.rb index cf5e00e..40e3878 100644 --- a/lib/ruby2d/image.rb +++ b/lib/ruby2d/image.rb @@ -8,9 +8,12 @@ module Ruby2D def initialize(x, y, path) - # unless File.exists? path - # raise Error, "Cannot find image file `#{path}`" - # end + # TODO: Check if file exists + # `File.exists?` is not available in MRuby + # Ideally would do: + # unless File.exists? path + # raise Error, "Cannot find image file `#{path}`" + # end @type_id = 3 @x, @y, @path = x, y, path diff --git a/lib/ruby2d/text.rb b/lib/ruby2d/text.rb index 06128cf..2bf890c 100644 --- a/lib/ruby2d/text.rb +++ b/lib/ruby2d/text.rb @@ -46,7 +46,7 @@ module Ruby2D def resolve_path(font) if RUBY_PLATFORM =~ /darwin/ font_path = "/Library/Fonts/#{font}.ttf" - else + else # Linux font_path = "/usr/share/fonts/truetype/#{font}.ttf" end -- cgit v1.2.3