Class: Sprout::Executable::Path

Inherits:
Param
  • Object
show all
Defined in:
lib/sprout/executable/path.rb

Overview

Concrete Sprout::Executable::Param object for Path values.

Path parameters will create a FileList of prerequisites by concatenating the value with the file_expression that is set on the parameter or Sprout::Executable.

See Also:

Constant Summary

Constant Summary

Constants inherited from Param

Sprout::Executable::Param::DEFAULT_DELIMITER, Sprout::Executable::Param::DEFAULT_OPTION_PARSER_TYPE_NAME, Sprout::Executable::Param::DEFAULT_PREFIX, Sprout::Executable::Param::DEFAULT_SHORT_PREFIX

Instance Attribute Summary

Attributes inherited from Param

#belongs_to, #delimiter, #description, #file_expression, #hidden_name, #hidden_value, #name, #prefix, #reader, #required, #shell_name, #short_name, #to_shell_proc, #type, #value, #writer

Instance Method Summary (collapse)

Methods inherited from Param

#clean_path, #default, #default=, #default_option_parser_declaration, #file_is_output?, #hidden_name?, #hidden_value?, #initialize, #option_parser_declaration, #option_parser_name, #option_parser_short_name, #option_parser_type_name, #option_parser_type_output, #prepare, #prepared?, #required?, #shell_value, #short_prefix, #to_rdoc, #to_shell, #validate, #visible?

Constructor Details

This class inherits a constructor from Sprout::Executable::Param

Instance Method Details

- (Object) prepare_prerequisites



15
16
17
18
19
20
21
22
23
# File 'lib/sprout/executable/path.rb', line 15

def prepare_prerequisites
  if(value && !file_is_output?(value))
    files = FileList[value + file_expression]
    files.each do |f|
      Rake::FileTask.define_task f
      belongs_to.prerequisites << f
    end
  end
end