Skip to content
Browse files

Make the ruby code 1.9 compatible, which some folks have on their sys…

…tems.
  • Loading branch information...
1 parent 4e0a3c6 commit 98604790a01ebcd5313c9589f08e984c783d48e1 @philc committed Mar 27, 2011
Showing with 6 additions and 6 deletions.
  1. +4 −4 src/event_handler.rb
  2. +1 −1 test/event_handler_test.rb
  3. +1 −1 test/keystroke_test.rb
View
8 src/event_handler.rb
@@ -8,8 +8,8 @@
ENABLE_DEBUG_LOGGING = false
-$LOAD_PATH.push(File.dirname(__FILE__) + "/")
-$LOAD_PATH.push(File.dirname(__FILE__) + "/lib/")
+$LOAD_PATH.push(File.expand_path(File.dirname(__FILE__) + "/"))
+$LOAD_PATH.push(File.expand_path(File.dirname(__FILE__) + "/lib/"))
require "rubygems"
require "keystroke"
@@ -50,8 +50,8 @@ def initialize
def handle_message(message)
message_json = JSON.parse(message)
case message_json["message"]
- when "keydown": handle_keydown_message(message_json)
- when "getKeybindings": handle_get_keybindings_message
+ when "keydown" then handle_keydown_message(message_json)
+ when "getKeybindings" then handle_get_keybindings_message
end
end
View
2 test/event_handler_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.dirname(__FILE__), "test_helper")
+require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))
require "event_handler"
class EventHandlerTest < Test::Unit::TestCase
View
2 test/keystroke_test.rb
@@ -1,4 +1,4 @@
-require File.join(File.dirname(__FILE__), "test_helper")
+require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))
require "keystroke"
class KeyStrokeTest < Test::Unit::TestCase

0 comments on commit 9860479

Please sign in to comment.
Something went wrong with that request. Please try again.