summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTom Black <[email protected]>2017-02-17 00:53:59 -0500
committerTom Black <[email protected]>2017-02-17 00:53:59 -0500
commitd426b3c21269df23cfbc4dd634c35d5d487aa090 (patch)
tree9e317889f5647c36bc75637cb1e8d40184961370
parente11976895af419e7411ae1d326779ff04909b6ca (diff)
downloadruby2d-d426b3c21269df23cfbc4dd634c35d5d487aa090.tar.gz
ruby2d-d426b3c21269df23cfbc4dd634c35d5d487aa090.zip
Minor cleanup
-rw-r--r--ext/ruby2d/extconf.rb4
-rw-r--r--lib/ruby2d/application.rb1
-rw-r--r--lib/ruby2d/dsl.rb1
-rw-r--r--lib/ruby2d/image.rb9
-rw-r--r--lib/ruby2d/text.rb2
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