Permalink
Browse files

Add Pipeline#project

  • Loading branch information...
1 parent 66c934d commit 650606fe3b5e12118fd9af426422077002210079 @dudleyf dudleyf committed Jul 18, 2012
Showing with 11 additions and 1 deletion.
  1. +4 −0 lib/rake-pipeline.rb
  2. +2 −1 lib/rake-pipeline/project.rb
  3. +5 −0 spec/project_spec.rb
View
@@ -130,6 +130,9 @@ class Pipeline
attr_writer :input_files
+ # @return [Project] the Project that created this pipeline
+ attr_reader :project
+
# @param [Hash] options
# @option options [Hash] :inputs
# set the pipeline's {#inputs}.
@@ -145,6 +148,7 @@ def initialize(options={})
@clean_mutex = Mutex.new
@inputs = options[:inputs] || {}
@tmpdir = options[:tmpdir] || "tmp"
+ @project = options[:project]
if options[:output_root]
self.output_root = options[:output_root]
@@ -216,7 +216,8 @@ def build_pipeline(input, glob=nil, &block)
:before_filters => @before_filters,
:after_filters => @after_filters,
:output_root => default_output_root,
- :tmpdir => digested_tmpdir
+ :tmpdir => digested_tmpdir,
+ :project => self
}, &block)
if input.kind_of?(Array)
View
@@ -237,6 +237,11 @@ def rakep_tmpdirs
pipeline.output_root.should == project.default_output_root
end
+ it "sets the pipeline's project to itself" do
+ pipeline = project.build_pipeline(inputs) {}
+ pipeline.project.should == project
+ end
+
it "creates a pipeline with a given set of inputs" do
pipeline = project.build_pipeline(inputs) {}
pipeline.inputs.should == inputs

0 comments on commit 650606f

Please sign in to comment.