Class: AsProject::WinUser

Inherits:
User
  • Object
show all
Defined in:
lib/path_finder.rb

Direct Known Subclasses

CygwinUser, VistaUser

Constant Summary collapse

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

Instance Method Summary collapse

Methods inherited from User

#asproject_player_trust, #downloads, #file_exists?, #flash_player_config, #flash_player_config_content, #flash_player_log, #flash_player_trust, #get_or_create, #get_player_url

Constructor Details

#initializeWinUser

Returns a new instance of WinUser.



410
411
412
413
414
415
416
417
418
# File 'lib/path_finder.rb', line 410

def initialize
  super
  @flash_player_7_url = "/pub/flashplayer/updaters/7/flash_player_update3_mx2004_win.zip"
  @flash_player_8_url = "/pub/flashplayer/updaters/8/flash_player_update3_flash8_win.zip"
  @flash_player_9_url = "/pub/flashplayer/updaters/9/sa_flashplayer_9_debug.exe"
  
  @zip_target = File.join('Players', 'Debug', 'SAFlashPlayer.exe')
  @win_asproject = 'AsProject'
end

Instance Method Details

#asproject_homeObject



456
457
458
459
460
461
462
# File 'lib/path_finder.rb', line 456

def asproject_home
  if(library == home)
    return super
  end
  ap_home = File.join(library, @win_asproject);
  return get_or_create(ap_home)
end

#flash_player_homeObject



438
439
440
# File 'lib/path_finder.rb', line 438

def flash_player_home
  return File.join(home, @@APPLICATION_DATA, 'Macromedia', 'Flash Player')
end

#flash_player_path(version) ⇒ Object



442
443
444
# File 'lib/path_finder.rb', line 442

def flash_player_path(version)
  return File.join(asproject_home, 'players', 'FlashPlayer' + version.to_s + '.exe')
end

#homeObject



430
431
432
433
434
435
436
# File 'lib/path_finder.rb', line 430

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

#libraryObject



446
447
448
449
450
451
452
453
454
# File 'lib/path_finder.rb', line 446

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

#remote_file_task(name, task) ⇒ Object



420
421
422
423
424
425
426
427
428
# File 'lib/path_finder.rb', line 420

def remote_file_task(name, task)
  return WinRemoteFileTask.new(name, self) do |t|
    if(task.win_url.nil?)
      raise UsageError.new("There was a problem finding a target for #{task.name}, it doesn't appear as if this task was expected to run on your system...")
    end
    t.url = task.win_url
    t.extracted_file = task.win_extracted_file
  end
end