Class: Sprout::CygwinUser

Inherits:
WinUser show all
Defined in:
lib/sprout/user.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from WinUser

#format_application_name, #get_paths, #library, #should_repair_executable

Methods inherited from UnixUser

#application_home, #execute, #execute_silent, #execute_thread, #format_application_name, #get_exe_path, #get_paths, #get_process_runner, #home=, #in_path?, #library, #platform, #repair_executable, #should_repair_executable

Constructor Details

#initializeCygwinUser

Returns a new instance of CygwinUser.



362
363
364
365
366
367
# File 'lib/sprout/user.rb', line 362

def initialize
  super
  @home = nil
  @win_home = nil
  @win_home_cyg_path = nil
end

Instance Method Details

#clean_path(path) ⇒ Object



372
373
374
375
376
377
# File 'lib/sprout/user.rb', line 372

def clean_path(path)
  if(path.index(' '))
    return %{'#{path}'}
  end
  return path
end

#homeObject



386
387
388
389
390
391
392
393
394
395
# File 'lib/sprout/user.rb', line 386

def home
  if(@home.nil?)
    path = win_home.split('\\').join("/")
    path = path.split(":").join("")
    parts = path.split("/")
    path = parts.shift().downcase + "/" + parts.join("/")
    @home = "/cygdrive/" + path
  end
return @home
end

#setup_userObject



369
370
# File 'lib/sprout/user.rb', line 369

def setup_user
end

#win_homeObject



379
380
381
382
383
384
# File 'lib/sprout/user.rb', line 379

def win_home
  if(@win_home.nil?)
    @win_home = ENV['HOMEDRIVE'] + ENV['HOMEPATH']
  end
  return @win_home
end