Class: Sprout::SWFMillInputTask

Inherits:
Rake::FileTask
  • Object
show all
Defined in:
lib/sprout/tasks/swfmill_input_task.rb

Overview

The SWFMillInputTask will generate an XML document by combining an ERB template with a selected directory. The resulting XML document should be appropriate as input for the SWFMill tool.

The good news is that you should probably never need to see this task since the SWFMillTask will automatically create it when that task is given a directory as input.

Constant Summary collapse

DEFAULT_TEMPLATE =
'Template.erb'
DEFAULT_INPUT_EXPR =
'/**/*'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#inputObject

Directory to scan for files that get added to the template



19
20
21
# File 'lib/sprout/tasks/swfmill_input_task.rb', line 19

def input
  @input
end

#input_exprObject

:nodoc:



57
58
59
# File 'lib/sprout/tasks/swfmill_input_task.rb', line 57

def input_expr # :nodoc:
  @input_expr ||= DEFAULT_INPUT_EXPR
end

#templateObject

:nodoc:



61
62
63
# File 'lib/sprout/tasks/swfmill_input_task.rb', line 61

def template # :nodoc:
  @template ||= default_template
end

Class Method Details

.define_task(args) {|t| ... } ⇒ Object

:nodoc:

Yields:

  • (t)


25
26
27
28
29
# File 'lib/sprout/tasks/swfmill_input_task.rb', line 25

def self.define_task(args, &block) # :nodoc:
  t = super
  yield t if block_given?
  t.define(args, &block)
end

Instance Method Details

#define(args, &block) ⇒ Object

:nodoc:



31
32
33
34
35
36
37
38
39
40
# File 'lib/sprout/tasks/swfmill_input_task.rb', line 31

def define(args, &block) # :nodoc:
  @input_files = FileList[input + input_expr]
  file template

  file @input_files
  prerequisites << @input_files
  prerequisites << template
  
  CLEAN.add output
end

#execute(*args) ⇒ Object

:nodoc:



42
43
44
45
# File 'lib/sprout/tasks/swfmill_input_task.rb', line 42

def execute(*args) # :nodoc:
  ensure_template
  resolve_template(template, output, @input_files, input)
end

#outputObject

:nodoc:



53
54
55
# File 'lib/sprout/tasks/swfmill_input_task.rb', line 53

def output # :nodoc:
  @output ||= name.to_s
end

#output=(output) ⇒ Object

The output XML document to generate. This should be appropriate input for the SWFMillTask.



49
50
51
# File 'lib/sprout/tasks/swfmill_input_task.rb', line 49

def output=(output)
  @output = output
end