Permalink
Commits on Oct 25, 2012
  1. Change support matrix

    wycats committed Oct 25, 2012
  2. Merge pull request #103 from twinturbo/invocation-fix

    Invocation fix
    wycats committed Oct 25, 2012
  3. Merge pull request #106 from twinturbo/test-running

    Run tests in random order
    wycats committed Oct 25, 2012
  4. Run tests in random order

    Also update the rake file to exec rspec without any arguments so they
    will be filled in from the .rspec file.
    
    Also use dots instead of spec doc. Easier to read test failures and
    output.
    twinturbo committed Oct 25, 2012
  5. Fix already initialized constant warnings

    twinturbo committed Oct 25, 2012
  6. Single entry point for TmpInputError

    twinturbo committed Oct 25, 2012
  7. 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.
    twinturbo committed Oct 25, 2012
  8. 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.
    twinturbo committed Oct 25, 2012
  9. 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.
    twinturbo committed Oct 23, 2012
  10. Add failing tests

    twinturbo committed Oct 22, 2012
  11. Merge pull request #105 from twinturbo/gsub-fix

    Gsub fix
    wycats committed Oct 25, 2012
  12. 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.
    twinturbo committed Oct 25, 2012
Commits on Oct 24, 2012
  1. Merge pull request #94 from twinturbo/examples

    Add a getting started guide and examples of common tasks
    wycats committed Oct 24, 2012
  2. Merge pull request #96 from twinturbo/tmp-error

    Raise an error if tmpdir is an input
    wycats committed Oct 24, 2012
  3. Merge pull request #97 from twinturbo/sets

    Sets are faster for signifcantly large N
    wycats committed Oct 24, 2012
  4. Merge pull request #102 from twinturbo/sorting-pipeline

    Add a sorting helper
    wycats committed Oct 24, 2012
  5. Add a sorting helper

    twinturbo committed Oct 19, 2012
  6. Merge pull request #101 from twinturbo/gsub-filter

    GsubFilter for stripping and replacing
    wycats committed Oct 24, 2012
  7. Update DSL and docs

    twinturbo committed Oct 19, 2012
  8. Add a gsub filter

    twinturbo committed Oct 19, 2012
  9. Merge pull request #104 from twinturbo/drop-matcher

    Reject matcher
    wycats committed Oct 24, 2012
  10. Reject matcher

    twinturbo committed Oct 24, 2012
Commits on Oct 19, 2012
  1. Try to fix Travis

    wycats committed Oct 19, 2012
  2. Modifying pipeline guide

    twinturbo committed Oct 19, 2012
Commits on Oct 16, 2012
  1. Test new files are only generated if required

    twinturbo committed Oct 16, 2012
  2. Load and save the manifest around every invocation

    This ensures that the manifest is always correct across multiple
    invocations and processes
    twinturbo committed Oct 16, 2012
  3. Refactor code to reduce manifest passing

    This commit introduces Filer#manifest which returns the set manifest or
    the pipeline's manifest. This makes testing easier because you can use
    Filer#manifest= to set on for that test. Pipeline#manifest delegates to
    the project.
    
    I think there is still problems with this code. The connection between
    Project, Pipeline, Filter, and DynamicFileTask is too complicated. This is
    especially annoying because DynamicFileTask requires a manifest to
    function properly. However, the manifest must be passed down from the
    project (then through a pipeline and into a filter) which builds the
    actual DynamicFileTask instances. I think this is a code smell.
    Introducing more collaboraters is making the tests more complex. Using a
    singleton is one possible solution. I will think about this later.
    twinturbo committed Oct 16, 2012
  4. Fix test failures introduced by previous commit

    twinturbo committed Oct 16, 2012
  5. Remove #last_manifest

    This commit is the first step in fixing some internal logic errors.
    The code previously used two manifests. These were both the same
    file even though the last manifest was only ever read and never written.
    The current manifest was never read and only written. This caused
    problems. This commit changes DynamicFileTask to use only one manifest.
    
    It also changes DynamicFileTask to be more resilient to internal
    mistakes. This commit assures that a manifest is assigned to a
    DynamicFileTask instance. Previously empty manifests were created as
    needed. This was a problem because the proper manifest was not being
    assigned correctly. This commit also changes DynamicFileTask#needed? to
    raise an error when there is no manifest. This ensures that this
    implementation error will never happen. It does make tests more verbose,
    but I think the change is worth it
    twinturbo committed Oct 16, 2012
  6. #copy assigns project correctly

    twinturbo committed Oct 16, 2012
Commits on Oct 15, 2012
  1. Temp directory naming is an instance concern

    twinturbo committed Oct 15, 2012
  2. Fix already initialized constant warnings

    twinturbo committed Oct 15, 2012
  3. Add Pipeline#fingerprint

    twinturbo committed Oct 15, 2012
Commits on Oct 12, 2012
  1. Sets are faster for signifcantly large N

    twinturbo committed Oct 12, 2012
  2. Raise an error if tmpdir is an input

    twinturbo committed Oct 12, 2012