Class: AsProject::SWFMill

Inherits:
RemoteFileTask show all
Defined in:
lib/tasks/swfmill.rb

Instance Attribute Summary collapse

Attributes inherited from RemoteFileTask

#osx_extracted_file, #osx_url, #unix_extracted_file, #unix_url, #user_task, #win_extracted_file, #win_url

Instance Method Summary collapse

Methods inherited from RemoteFileTask

#clean_path, #define_user_task, #execute

Constructor Details

#initialize(name, do_not_define = false) ⇒ SWFMill

Returns a new instance of SWFMill.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/tasks/swfmill.rb', line 14

def initialize(name, do_not_define=false)
  @simple = true
  @input = nil
  @output = nil
  @options = []
  @version = '0.2.12' 
  @win_url = "http://www.swfmill.org/releases/swfmill-#{version}-win32.zip"
  @win_extracted_file = "/swfmill-#{version}-win32/swfmill.exe"
#      @osx_url = "http://www.swfmill.org/releases/swfmill-0.2.12-macosx.tar.gz"
#      @osx_extracted_file = nil
#      @unix_url = nil
#      @unix_extracted_file = nil
  super(name, true)
  define unless do_not_define
end

Instance Attribute Details

#inputObject

Returns the value of attribute input.



8
9
10
# File 'lib/tasks/swfmill.rb', line 8

def input
  @input
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/tasks/swfmill.rb', line 8

def name
  @name
end

#outputObject

Returns the value of attribute output.



8
9
10
# File 'lib/tasks/swfmill.rb', line 8

def output
  @output
end

#simpleObject

Returns the value of attribute simple.



8
9
10
# File 'lib/tasks/swfmill.rb', line 8

def simple
  @simple
end

#versionObject

Returns the value of attribute version.



8
9
10
# File 'lib/tasks/swfmill.rb', line 8

def version
  @version
end

Instance Method Details

#defineObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/tasks/swfmill.rb', line 34

def define
  super
  
  if(@input.nil?)
    raise Error.new('SWFMill task requires that input be set')
  end
  
  if(@output.nil?)
    raise Error.new('SWFMill task requires that output be set')
  end
  file input
  file output => [input] do |f|
    user_task.execute(option_list.join(' '))
#        sh %{swfmill #{option_list}}
  end

  desc "#{name} using SWFMill"
  task name => [input, output]
  
  CLEAN.add(output)

  self
end

#option_listObject



58
59
60
61
62
63
64
# File 'lib/tasks/swfmill.rb', line 58

def option_list
  result = @options.dup
  result << "simple" if simple
  result << input if input
  result << output if output
  return result
end

#remote_task_nameObject



30
31
32
# File 'lib/tasks/swfmill.rb', line 30

def remote_task_name
  return "swfmill-#{version}"
end