Class: AsProject::SWFMill
- Inherits:
-
RemoteFileTask
- Object
- Rake::TaskLib
- RemoteFileTask
- AsProject::SWFMill
- Defined in:
- lib/tasks/swfmill.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
Returns the value of attribute input.
-
#input_expr ⇒ Object
Returns the value of attribute input_expr.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output ⇒ Object
Returns the value of attribute output.
-
#simple ⇒ Object
Returns the value of attribute simple.
-
#template ⇒ Object
Returns the value of attribute template.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from RemoteFileTask
#osx_extracted_file, #osx_mounted_path, #osx_url, #unix_extracted_file, #unix_url, #user_task, #win_extracted_file, #win_url
Instance Method Summary collapse
- #define ⇒ Object
- #define_xml_task(path) ⇒ Object
-
#initialize(name, do_not_define = false) ⇒ SWFMill
constructor
A new instance of SWFMill.
- #option_list ⇒ Object
- #remote_task_name ⇒ Object
Methods inherited from RemoteFileTask
#clean_path, #define_user_task, #execute, #extracted_file_path, #user
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 29 30 |
# File 'lib/tasks/swfmill.rb', line 14 def initialize(name, do_not_define=false) @simple = true @input = nil @template = nil @input_expr = 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://swfmill.org/releases/swfmill-#{version}-macosx.tar.gz" @osx_extracted_file = "swfmill-#{version}-macosx/swfmill" @unix_url = nil @unix_extracted_file = nil super(name, true) define unless do_not_define end |
Instance Attribute Details
#input ⇒ Object
Returns the value of attribute input.
6 7 8 |
# File 'lib/tasks/swfmill.rb', line 6 def input @input end |
#input_expr ⇒ Object
Returns the value of attribute input_expr.
6 7 8 |
# File 'lib/tasks/swfmill.rb', line 6 def input_expr @input_expr end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/tasks/swfmill.rb', line 6 def name @name end |
#output ⇒ Object
Returns the value of attribute output.
6 7 8 |
# File 'lib/tasks/swfmill.rb', line 6 def output @output end |
#simple ⇒ Object
Returns the value of attribute simple.
6 7 8 |
# File 'lib/tasks/swfmill.rb', line 6 def simple @simple end |
#template ⇒ Object
Returns the value of attribute template.
6 7 8 |
# File 'lib/tasks/swfmill.rb', line 6 def template @template end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/tasks/swfmill.rb', line 6 def version @version end |
Instance Method Details
#define ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/tasks/swfmill.rb', line 36 def define super if(@input.nil?) raise SWFMillError.new('SWFMill task requires that input be set') end if(@output.nil?) raise SWFMillError.new('SWFMill task requires that output be set') end if(File.directory?(input)) @input = define_xml_task(input).xml_file end file input file output => input do |f| = [] option_list.each do |item| << clean_path(item) end execute(.join(' ')) end desc "#{name} using SWFMill" task name => [input, output] CLEAN.add(output) self end |
#define_xml_task(path) ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/tasks/swfmill.rb', line 68 def define_xml_task(path) # build the input xml file automatically # Based on a directory full of images... if(@template.nil?) raise SWFMillError.new('If input is a directory, you must assign a template to use for the generated xml document') end return SWFMillInput.new(path, template, input_expr) end |
#option_list ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/tasks/swfmill.rb', line 78 def option_list result = @options.dup result << "simple" if simple result << input if input result << output if output return result end |
#remote_task_name ⇒ Object
32 33 34 |
# File 'lib/tasks/swfmill.rb', line 32 def remote_task_name return "swfmill-#{version}" end |