Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix bug with nested matchers #110

Merged
merged 1 commit into from

2 participants

Adam Hawkins Yehuda Katz
Adam Hawkins

Filters need a pipeline assigned to read a manifest from. Match calls
Pipeline#copy. #copy evaluates the block before assigning attributes
like pipeline and rake application. This commit changes copy to build up
the new instance correctly then evaluate the DSL block.

twinturbo Fix bug with nested matchers
Filters need a pipeline assigned to read a manifest from. Match calls
Pipeline#copy. #copy evaluates the block before assigning attributes
like pipeline and rake application. This commit changes copy to build up
the new instance correctly then evaluate the DSL block.
4ef66b1
Yehuda Katz wycats merged commit 082e4c2 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 26, 2012
  1. Fix bug with nested matchers

    twinturbo authored
    Filters need a pipeline assigned to read a manifest from. Match calls
    Pipeline#copy. #copy evaluates the block before assigning attributes
    like pipeline and rake application. This commit changes copy to build up
    the new instance correctly then evaluate the DSL block.
This page is out of date. Refresh to see the latest.
Showing with 22 additions and 1 deletion.
  1. +2 −1  lib/rake-pipeline.rb
  2. +20 −0 spec/rake_acceptance_spec.rb
3  lib/rake-pipeline.rb
View
@@ -217,11 +217,12 @@ def build(options={}, &block)
# @return [Pipeline] the new pipeline
# @api private
def copy(target_class=self.class, &block)
- pipeline = target_class.build(&block)
+ pipeline = target_class.new
pipeline.inputs = inputs
pipeline.tmpdir = tmpdir
pipeline.rake_application = rake_application
pipeline.project = project
+ pipeline.build &block
pipeline
end
20 spec/rake_acceptance_spec.rb
View
@@ -603,4 +603,24 @@ def output_should_exist(expected=EXPECTED_JS_OUTPUT)
it_should_behave_like "a pipeline with dynamic files"
end
end
+
+ it "should work with nested matchers" do
+ project = Rake::Pipeline::Project.build do
+ tmpdir "temporary"
+ output "public"
+
+ input tmp, "app/**/*.js" do
+ match "**/*" do
+ match "**/*.js" do
+ filter strip_asserts_filter
+ concat "javascripts/application.js"
+ end
+ end
+ end
+ end
+
+ project.invoke_clean
+
+ output_should_exist
+ end
end
Something went wrong with that request. Please try again.