def call(args = Array.new, options = Hash.new)
      unless self.dependencies.empty?
        info "Invoking task #{name}"
        self.invoke_dependencies(*args, options)
      end
      unless self.blocks.empty?
        note "Executing task #{name} with arguments #{args.inspect} and options #{options.inspect}"
        debug "Config #{self.config.inspect}"
        self.blocks.each do |block|
          block.call(*args, options)
        end
        ## we can't use arity, because it returns 0 for lambda { |options = Hash.new| }.arity
        ## if we define method with one optional argument, it will returns -1
        #
        ## better argv parsing maybe, task(:spec) do |*paths, options| is fine, but task(:spec) do |path, options| will fail if no path specified ... but actually task(:spec) do |path = "spec", options| might be fine, try it ... BTW task(["-i", "--interactive"]) do |task, *args, options| doesn't work ... putting options as a first argument should solve everything, but it's not very intuitive :/
        #if RUBY_VERSION >= "1.9.2"
        #  raise ArgumentError, "Task can't take block arguments" if args.length + 1 > block.parameters.select { |type, name| type.eql?(:req) || type.eql?(:opt) }.length
        #  raise ArgumentError, "Task can't take block arguments" if block.parameters.any? { |type, name| type.eql?(:block) }
        #end
        #
        #if RUBY_VERSION >= "1.9.2" && block.parameters.empty?
        #  block.call
        #else
        #  block.call(*args, options)
        #end
      end
    end
def call(args = Array.new, options = Hash.new)
      unless self.dependencies.empty?
        info "Invoking task #{name}"
        self.invoke_dependencies(*args, options)
      end
      unless self.blocks.empty?
        note "Executing task #{name} with arguments #{args.inspect} and options #{options.inspect}"
        debug "Config #{self.config.inspect}"
        self.blocks.each do |block|
          block.call(*args, options)
        end
        ## we can't use arity, because it returns 0 for lambda { |options = Hash.new| }.arity
        ## if we define method with one optional argument, it will returns -1
        #
        ## better argv parsing maybe, task(:spec) do |*paths, options| is fine, but task(:spec) do |path, options| will fail if no path specified ... but actually task(:spec) do |path = "spec", options| might be fine, try it ... BTW task(["-i", "--interactive"]) do |task, *args, options| doesn't work ... putting options as a first argument should solve everything, but it's not very intuitive :/
        #if RUBY_VERSION >= "1.9.2"
        #  raise ArgumentError, "Task can't take block arguments" if args.length + 1 > block.parameters.select { |type, name| type.eql?(:req) || type.eql?(:opt) }.length
        #  raise ArgumentError, "Task can't take block arguments" if block.parameters.any? { |type, name| type.eql?(:block) }
        #end
        #
        #if RUBY_VERSION >= "1.9.2" && block.parameters.empty?
        #  block.call
        #else
        #  block.call(*args, options)
        #end
      end
    end
NOTE: the reason why we don't have splat for args is that when we have Task["-T"]
 which doesn't have any args and options, we wall just call it without any arguments,
 but when we use splat, then we will have to call it at least with Hash.new for options