Class: AsProject::RemoteFileTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/tasks/remote_file_task.rb

Overview

The RemoteFileTask was created to resolve external tool dependencies for relatively stable tools like mtasc, swfmill and mxmlc The intention is that common tools will have RemoteFileTasks deployed with AsProject and will include mac/win/unix targets so that users on each platform will seamlessly download and target these tools.

Direct Known Subclasses

FlashPlayer, MTASC, SWFMill

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :remote_file_task, do_not_define = false) {|_self| ... } ⇒ RemoteFileTask

Returns a new instance of RemoteFileTask.

Yields:

  • (_self)

Yield Parameters:



27
28
29
30
31
32
33
# File 'lib/tasks/remote_file_task.rb', line 27

def initialize(name=:remote_file_task, do_not_define=false)
  @name = name
  @user_task = nil
  @remote_task_name = name.to_s
  yield self if block_given?
  define unless do_not_define
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def name
  @name
end

#osx_extracted_fileObject

Returns the value of attribute osx_extracted_file.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def osx_extracted_file
  @osx_extracted_file
end

#osx_mounted_pathObject

Returns the value of attribute osx_mounted_path.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def osx_mounted_path
  @osx_mounted_path
end

#osx_urlObject

Returns the value of attribute osx_url.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def osx_url
  @osx_url
end

#remote_task_nameObject

Returns the value of attribute remote_task_name.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def remote_task_name
  @remote_task_name
end

#unix_extracted_fileObject

Returns the value of attribute unix_extracted_file.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def unix_extracted_file
  @unix_extracted_file
end

#unix_urlObject

Returns the value of attribute unix_url.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def unix_url
  @unix_url
end

#user_taskObject

Returns the value of attribute user_task.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def user_task
  @user_task
end

#win_extracted_fileObject

Returns the value of attribute win_extracted_file.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def win_extracted_file
  @win_extracted_file
end

#win_urlObject

Returns the value of attribute win_url.



16
17
18
# File 'lib/tasks/remote_file_task.rb', line 16

def win_url
  @win_url
end

Instance Method Details

#clean_path(path) ⇒ Object



64
65
66
67
# File 'lib/tasks/remote_file_task.rb', line 64

def clean_path(path)
  define_user_task
  return user_task.clean_path(path)
end

#defineObject



35
36
37
38
# File 'lib/tasks/remote_file_task.rb', line 35

def define
  define_user_task
  self
end

#define_user_taskObject



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/tasks/remote_file_task.rb', line 48

def define_user_task
  if(@user_task.nil?)
    if(remote_task_name.nil?)
      raise UsageError.new('RemoteFileTask created without a remote_task_name value...')
    end
    @user = PathFinder.new().user
    @user_task = @user.remote_file_task(remote_task_name, self)
    task name => remote_task_name
  end
  @user_task
end

#execute(params) ⇒ Object



60
61
62
# File 'lib/tasks/remote_file_task.rb', line 60

def execute(params)
  user_task.execute(params)
end

#extracted_file_pathObject



44
45
46
# File 'lib/tasks/remote_file_task.rb', line 44

def extracted_file_path
  return @user_task.extracted_file_path
end

#userObject



40
41
42
# File 'lib/tasks/remote_file_task.rb', line 40

def user
  return @user
end