Skip to content

Commit

Permalink
fix application's path has blank/chinese bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hungtatai committed Aug 25, 2014
1 parent cc0d37b commit 1eec019
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1eec019

Please sign in to comment.