Installation script's target directory

Doug Kearns dougkearns at gmail.com
Tue Aug 9 07:51:26 EDT 2005


Thanks Hugh,

On Tue, Aug 09, 2005 at 12:34:41PM +0100, Hugh Sasse wrote:

<snip>

> Windows98 I get 
> rb(main):001:0> require 'win32/registry'
> => true
> irb(main):002:0> dirs = []
> => []
> irb(main):003:0> path = ''
> => ""
> irb(main):004:0> 
> Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Vim\Gvim') d
> o |reg|
> irb(main):005:1*   path = reg['path', Win32::Registry::REG_SZ]
> irb(main):006:1> end
> => "C:\\VIM\\VIM63\\gvim.exe"
> irb(main):007:0> unless path.empty?
> irb(main):008:1>   system_dir = path.sub(/\\vim\d\d\\gvim.exe/, '')

  irb(main):008:1>   system_dir = path.sub(/\\vim\d\d\\gvim.exe/i, '')

> irb(main):009:1>   dirs << system_dir + '/vimfiles'
> irb(main):010:1> end
> => ["C:\\VIM\\VIM63\\gvim.exe/vimfiles"]
> irb(main):011:0> dirs
> => ["C:\\VIM\\VIM63\\gvim.exe/vimfiles"]
> irb(main):012:0>

I always forget that it's case insensitive...

<snip>

Thanks again,
Doug


More information about the vim-ruby-devel mailing list