Add failing tests
Fix failing tests

Every task needs a manifest for it to be invoked correctly. This commit
ensures that manifest entries are present for tasks which call
Filter#generate_output.

It also ensures that needed? returns correctly when dynamic imports
are changed. This behavior is covered in the dependency related tests
in rake_acceptance_test.

Here is a more detailed description:

This commit fix a bug in a common use case. You have N dynamic files
which are concatentated into one file. File A imports B. A is
concatenated into C. This creates rake tasks like so: C => A => B. B is
a dynamic dependency. You modify B. Now A is dirty and C is dirty by
transitivity. C is the final task in the chain so it is invoked first.
First by invoking it's prereqs. Follow the chain:

C  = the final concatenated file: application.dyn
C' = the input to C. This is a temporary build file:
     tmp/main.dynamic. This is the output from generate_output
A  = the actual source file: app/main.dynamic

C => C' => A => B

M is the project manifest.

C: invoke
  C: invoke call chain
    C: invoke prereqs (C')
      C': invoke call chain
        C': invoke prereqs (A)
          A: invoke call chain
            A: invoke prereqs (B dynamically)
              B: invoke call chain
                B: invoke
              A: M[A] => B (with current m)
            A: needed? (This is not the task that generates A)
              * super? no, continue
              * M[A]? yes, continue
              * M[A] out of date? no, continue. **NOTE**: A.invoke_prerequisties sets
                M[A] => B.mtime to the current time so the dependencies are not out
                of date. The comparison is File.mtime(dep) > time. dep and time are
                set in invoke_prerequisites.
              * return false
            A: M[A].mtime => File.mtime(A)
          C': M[C'] => {} since there are no dynamic dependencies
        C': needed?
          * super? no, continue
          * M[C']? yes, continue
          * M[C'] out of date? no
          * return false
        C: M[C'].mtime => File.mtime(C')
      C: M[C] => {} since there are no dynamic dependencies
    C: needed?
      * super? no, continue
      * M[C]? yes, continue
      * M[C] out of date? No, there are no deps
      * return false
    C: M[C].mtime => File.mtime(C)

The import thing here is that the task to regenerate A is not invoked
because #needed? does not return correctly. See the **NOTE** in the
call tree. The solution here is to check dependencies against themselves
and against the main file. That would make A.needed? return correctly.

The next problem is that the task to generate A does not look at A's manifest.
Checking task prereqss will ensure the task is called if a dependency changes.

Finally, remove the calls to: `return unless has_dynamic_block?`. This ensures
that every file has a manifest entry. That way calls to `return unless manifest_entry`
don't return for tasks that don't have dynamic blocks. This ensures that tasks
calling Filter#generate_output are handled correctly. Conversely you could
accomplish this by calling `dynamic` and returning [] on those tasks.
Fix errors in gsub tests and gsub filter

@block was written incorrectly in the previous commit. This commit
also fixes test issues against that occur when running tests in random
order. Setting a fresh rake application each time fixes the issue. Tasks
are marked as already invoked when using the same application since the
same input and output files are used for every test.

This commit also fixes a problem with "global" regex variables in the
gsub block. $1, $2, $~ are supposed to be accessible inside the block.
This does not work when passing in a block from another context. $1 and
such are actually local variables not global variables. The matches are
passed in as block arguments instead. The documenation has been updated
to reflect this important quirk.
Fix error with invoke_clean

Invoke clean causes input files to be rescaned. Previous invocations
will create tmporary files. Careless setup and globbing can create an
ever expanding pipeline since intermediate build files are inputs for
the next build. This commit fixes this issue by checking that every
input file is not inside the pipeline's tmp directory. This check
applies to files added via match or input.
Single entry point for TmpInputError
Fix already initialized constant warnings
Merge pull request #103 from twinturbo/invocation-fix

Invocation fix