From a33d90dcfc97f321ecc47e722444f785e38758f8 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Fri, 3 Jan 2014 16:04:37 -0800 Subject: [PATCH 1/2] Fix String#[] on 1.8 --- lib/roflbalt.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/roflbalt.rb b/lib/roflbalt.rb index e0c14b8..b3f6c0c 100644 --- a/lib/roflbalt.rb +++ b/lib/roflbalt.rb @@ -327,13 +327,13 @@ def char rx, ry, ticks ' @ ', '\+/', ' \\\\', - ][ry][rx] + ][ry][rx..rx] elsif !@walking [ ' O/', '/| ', '/ >', - ][ry][rx] + ][ry][rx..rx] else [ [ @@ -346,7 +346,7 @@ def char rx, ry, ticks ',|\\', ' >\\', ], - ][ticks / 4 % 2][ry][rx] + ][ticks / 4 % 2][ry][rx..rx] end end def acceleration @@ -410,7 +410,7 @@ def template ] end def pixel x, y, rx, ry, ticks - Pixel.new template[ry][rx], 244, 234 + Pixel.new template[ry][rx..rx], 244, 234 end end @@ -430,7 +430,7 @@ def template ] end def pixel x, y, rx, ry, ticks - Pixel.new template[ry][rx], FG, BG + Pixel.new template[ry][rx..rx], FG, BG end end @@ -470,7 +470,7 @@ def pixel x, y, rx, ry, ticks Pixel.new char(rx, ry, ticks), 246, @background.color(x, y) end def char rx, ry, ticks - @frames[ticks % 2][ry][rx] || " " + @frames[ticks % 2][ry][rx..rx] || " " rescue " " # Roflcopter crashes from time to time.. end From 4014690058c543754c2339c49c80c7363d1d48d4 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Fri, 3 Jan 2014 16:08:22 -0800 Subject: [PATCH 2/2] Add tests --- test/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/.gitkeep diff --git a/test/.gitkeep b/test/.gitkeep new file mode 100644 index 0000000..e69de29