Skip to content

Commit

Permalink
Open keylog files in binary mode
Browse files Browse the repository at this point in the history
  • Loading branch information
urticadioica committed Jan 17, 2017
1 parent 3f360eb commit c4c40b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/vimgolf/lib/vimgolf/challenge.rb
Expand Up @@ -91,7 +91,7 @@ def upload

proxy.start(url.host, url.port) do |http|
request = Net::HTTP::Post.new(url.request_uri)
request.set_form_data({"challenge_id" => @id, "apikey" => Config.load['key'], "entry" => IO.read(log_path)})
request.set_form_data({"challenge_id" => @id, "apikey" => Config.load['key'], "entry" => IO.binread(log_path)})
request["Accept"] = "application/json"

res = http.request(request)
Expand Down
2 changes: 1 addition & 1 deletion lib/vimgolf/lib/vimgolf/cli.rb
Expand Up @@ -114,7 +114,7 @@ def play(challenge)
system(*vimcmd) # assembled as an array, bypasses the shell

if $?.exitstatus.zero?
log = Keylog.new(IO.read(challenge.log_path))
log = Keylog.new(IO.binread(challenge.log_path))

VimGolf.ui.info "\nHere are your keystrokes:"
VimGolf.ui.print_log log
Expand Down

0 comments on commit c4c40b1

Please sign in to comment.