lib/tdp/tdp_dsl.rb
# Define a new task, configuration or template
#
# Example:
#  define Task: :name do
#    ...some ruby code
#  end
#
Define a new task, configuration or template
Example:
define Task: :name do
some ruby code
end
Define a new task configuration or template Example : define Task : : name do some ruby code end
def define( hsh, &action )
      raise ArgumentError, "Class and name not given" if hsh.nil?
      raise ArgumentError, "Action not given" if action.nil?
      klass = hsh.keys[0]
      name = hsh[klass]
      TDP.application.add_item(klass, name, action)
    end
def define ( hsh , & action ) raise ArgumentError , "Class and name not given" if hsh . nil? raise ArgumentError , "Action not given" if action . nil? klass = hsh . keys [ 0 ] name = hsh [ klass ] TDP . application . add_item ( klass , name , action ) end
Define a new task, configuration or template
Example:
define Task: :name do
...some ruby code
end
Define a new task configuration or template Example : define Task : : name do ... some ruby code end
hsh
<not_specific>
action
<not_specific>