diff options
| author | Tom Black <[email protected]> | 2017-02-17 00:30:07 -0500 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2017-02-17 00:30:07 -0500 |
| commit | b017a89612b3e264467eeb481f2c4bfeee81e825 (patch) | |
| tree | 20b48e490226bba361e9d12d20df518c7a481c3f | |
| parent | 88dec9d773e7960a525df8f0b7b9d09a180ac8c7 (diff) | |
| download | ruby2d-b017a89612b3e264467eeb481f2c4bfeee81e825.tar.gz ruby2d-b017a89612b3e264467eeb481f2c4bfeee81e825.zip | |
Clean up exception class, move up in require order
| -rwxr-xr-x | bin/ruby2d | 2 | ||||
| -rw-r--r-- | lib/ruby2d.rb | 2 | ||||
| -rw-r--r-- | lib/ruby2d/exceptions.rb | 5 |
3 files changed, 4 insertions, 5 deletions
@@ -15,6 +15,7 @@ end # The Ruby 2D library files @lib_files = [ + 'exceptions', 'color', 'window', 'application', @@ -26,7 +27,6 @@ end 'image', 'sprite', 'text', - 'exceptions' ] 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 |
