From b017a89612b3e264467eeb481f2c4bfeee81e825 Mon Sep 17 00:00:00 2001 From: Tom Black Date: Fri, 17 Feb 2017 00:30:07 -0500 Subject: Clean up exception class, move up in require order --- lib/ruby2d.rb | 2 +- lib/ruby2d/exceptions.rb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/ruby2d.rb b/lib/ruby2d.rb index 4e41d22..125ad82 100644 --- a/lib/ruby2d.rb +++ b/lib/ruby2d.rb @@ -1,5 +1,6 @@ # ruby2d.rb +require 'ruby2d/exceptions' require 'ruby2d/color' require 'ruby2d/window' require 'ruby2d/application' @@ -11,7 +12,6 @@ require 'ruby2d/triangle' require 'ruby2d/image' require 'ruby2d/sprite' require 'ruby2d/text' -require 'ruby2d/exceptions' require 'ruby2d/ruby2d' # load native extension include Ruby2D::DSL diff --git a/lib/ruby2d/exceptions.rb b/lib/ruby2d/exceptions.rb index 9ea90c7..84880e1 100644 --- a/lib/ruby2d/exceptions.rb +++ b/lib/ruby2d/exceptions.rb @@ -8,9 +8,8 @@ module Ruby2D def initialize(msg) super(msg) - puts error("\nRuby 2D Error:") << " " << msg - puts bold("Occurred in:") - puts bold(" " + caller.last), "\n" + puts error("\nRuby 2D Error:") << " #{msg}" << + bold("\nOccurred in:\n #{caller.last}\n") end end end -- cgit v1.2.3