wycats / rake-pipeline-web-filters

MIT License
116 stars 36 forks source link

SassFilter dies if its input files don't exist at setup time #19

Closed dudleyf closed 12 years ago

dudleyf commented 12 years ago

The SassFilter will only work if its input files exist when the pipeline gets setup. If the SassFilter is the first filter in the pipeline, then the input root is the original source file, so it exists, so it can be read to extract its dependencies. If another filter matches the same input before the SassFilter, however, then the file's input root will be a temporary directory, and the file won't be there until the pipeline is actually invoked. The SassFilter needs to read the file at setup time, not at invoke time.

For example:

input "app/assets" do
  match("stylesheets/app.scss") do
    sass
  end
end

works. The SassFilter reads app/assets/stylesheets/app.scss when the pipeline is setup. This:

input "app/assets" do
  match("stylesheets/app.scss") do
    copy
    sass
  end
end

dies horribly because the SassFilter is trying to read my-tmp-dir/rake-pipeline-tmp-1/stylesheets/app.scss, which isn't created until the pipeline is invoked.

dudleyf commented 12 years ago

I've reverted the changes to the SassFilter that caused this problem.