Class: Sprout::WinUser

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

Overview

:nodoc:

Direct Known Subclasses

CygwinUser, VistaUser

Constant Summary collapse

@@LOCAL_SETTINGS =
"Local\ Settings"
@@APPLICATION_DATA =
"Application\ Data"

Instance Method Summary collapse

Methods inherited from UnixUser

#application_home, #execute, #execute_silent, #execute_thread, #get_exe_path, #get_process_runner, #home=, #in_path?, #platform, #repair_executable

Constructor Details

#initializeWinUser

Returns a new instance of WinUser.



310
311
312
313
# File 'lib/sprout/user.rb', line 310

def initialize
  super
  @home = nil
end

Instance Method Details

#clean_path(path) ⇒ Object



347
348
349
350
351
352
353
# File 'lib/sprout/user.rb', line 347

def clean_path(path)
  path = path.split('/').join("\\")
  if(path.index(' '))
    return %{"#{path}"}
  end
  return path
end

#format_application_name(name) ⇒ Object



355
356
357
# File 'lib/sprout/user.rb', line 355

def format_application_name(name)
  return name.capitalize
end

#get_pathsObject



326
327
328
# File 'lib/sprout/user.rb', line 326

def get_paths
  return ENV['PATH'].split(';')
end

#homeObject



318
319
320
321
322
323
324
# File 'lib/sprout/user.rb', line 318

def home
  usr = super
  if(usr.index "My Documents")
    usr = File.dirname(usr)
  end
  return usr
end

#libraryObject



330
331
332
333
334
335
336
337
338
# File 'lib/sprout/user.rb', line 330

def library
  # For some reason, my homepath returns inside 'My Documents'...
  application_data = File.join(home, @@LOCAL_SETTINGS, @@APPLICATION_DATA)
  if(File.exists?(application_data))
    return application_data
  else
    return super
  end
end

#setup_userObject



315
316
# File 'lib/sprout/user.rb', line 315

def setup_user
end

#should_repair_executable(path) ⇒ Object

Override from UnixUser and block behavior. I know this is smelly… Fixes?



343
344
345
# File 'lib/sprout/user.rb', line 343

def should_repair_executable(path)
  false
end