From 1eec019802fe6511615510fcb1225ac5624aed40 Mon Sep 17 00:00:00 2001 From: HondaDai Date: Mon, 25 Aug 2014 16:50:29 +0800 Subject: [PATCH] fix application's path has blank/chinese bug --- src/main.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rb b/src/main.rb index e8c2b306..90314e22 100644 --- a/src/main.rb +++ b/src/main.rb @@ -25,7 +25,9 @@ def set_lib_path $LOAD_PATH << 'src' require 'uri' - resources_dir = File.join(File.dirname( File.dirname(File.dirname( URI.parse(__FILE__).path ))), 'Resources') + require 'cgi' + main_file_path = CGI.unescape(URI.parse(URI.escape(__FILE__)).path) + resources_dir = File.join(File.dirname( File.dirname(File.dirname( main_file_path ))), 'Resources') if File.exists?( File.join(resources_dir, 'lib','ruby')) @lib_path = File.join(resources_dir, 'lib') else