dtsato-pipeline 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +12 -0
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/pipeline/stage/base.rb +4 -2
- data/pipeline.gemspec +7 -2
- data/spec/pipeline/stage/base_spec.rb +16 -0
- metadata +7 -2
data/CHANGELOG
CHANGED
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ begin
|
|
15
15
|
gem.rdoc_options = ["--main", "README.rdoc", "--inline-source", "--line-numbers"]
|
16
16
|
gem.extra_rdoc_files = ["README.rdoc"]
|
17
17
|
|
18
|
-
gem.test_files = Dir['spec/**/*']
|
18
|
+
gem.test_files = Dir['spec/**/*'] + Dir['spec/*']
|
19
19
|
|
20
20
|
gem.add_dependency('activerecord', '>= 2.0')
|
21
21
|
gem.add_dependency('collectiveidea-delayed_job', '>= 1.8.0')
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/pipeline/stage/base.rb
CHANGED
@@ -11,7 +11,7 @@ module Pipeline
|
|
11
11
|
transactional_attr :status
|
12
12
|
private :status=
|
13
13
|
|
14
|
-
belongs_to :pipeline, :class_name => "Pipeline::Base"
|
14
|
+
belongs_to :pipeline, :class_name => "Pipeline::Base", :foreign_key => 'pipeline_instance_id'
|
15
15
|
|
16
16
|
@@chain = []
|
17
17
|
def self.>>(next_stage)
|
@@ -25,8 +25,10 @@ module Pipeline
|
|
25
25
|
chain
|
26
26
|
end
|
27
27
|
|
28
|
+
class_inheritable_accessor :default_name, :instance_writer => false
|
29
|
+
|
28
30
|
def after_initialize
|
29
|
-
self.name ||= self.class.to_s
|
31
|
+
self.name ||= (default_name || self.class).to_s
|
30
32
|
self[:status] = :not_started if new_record?
|
31
33
|
end
|
32
34
|
|
data/pipeline.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{pipeline}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Danilo Sato"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-08-05}
|
10
10
|
s.description = %q{Pipeline is a Rails plugin/gem to run asynchronous processes in a configurable pipeline.}
|
11
11
|
s.email = %q{danilo@dtsato.com}
|
12
12
|
s.extra_rdoc_files = [
|
@@ -65,6 +65,11 @@ Gem::Specification.new do |s|
|
|
65
65
|
"spec/pipeline/stage/base_spec.rb",
|
66
66
|
"spec/rcov.opts",
|
67
67
|
"spec/spec.opts",
|
68
|
+
"spec/spec_helper.rb",
|
69
|
+
"spec/database_integration_helper.rb",
|
70
|
+
"spec/pipeline",
|
71
|
+
"spec/rcov.opts",
|
72
|
+
"spec/spec.opts",
|
68
73
|
"spec/spec_helper.rb"
|
69
74
|
]
|
70
75
|
|
@@ -37,6 +37,14 @@ module Pipeline
|
|
37
37
|
Base.new.name.should == "Pipeline::Stage::Base"
|
38
38
|
SampleStage.new.name.should == "SampleStage"
|
39
39
|
end
|
40
|
+
|
41
|
+
it "should allow overriding name at class level" do
|
42
|
+
SampleStage.default_name = "My custom stage name"
|
43
|
+
SampleStage.new.name.should == "My custom stage name"
|
44
|
+
|
45
|
+
SampleStage.default_name = :some_symbol
|
46
|
+
SampleStage.new.name.should == "some_symbol"
|
47
|
+
end
|
40
48
|
|
41
49
|
it "should allow specifying a name on creation" do
|
42
50
|
Base.new(:name => "My Name").name.should == "My Name"
|
@@ -76,6 +84,14 @@ module Pipeline
|
|
76
84
|
stage.should be_an_instance_of(SampleStage)
|
77
85
|
end
|
78
86
|
|
87
|
+
it "should belong to pipeline instance" do
|
88
|
+
pipeline = Pipeline::Base.create
|
89
|
+
@stage.pipeline = pipeline
|
90
|
+
@stage.save!
|
91
|
+
|
92
|
+
Base.find(@stage.id).pipeline.should == pipeline
|
93
|
+
end
|
94
|
+
|
79
95
|
end
|
80
96
|
|
81
97
|
describe "- execution (success)" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dtsato-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danilo Sato
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-08-05 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -117,3 +117,8 @@ test_files:
|
|
117
117
|
- spec/rcov.opts
|
118
118
|
- spec/spec.opts
|
119
119
|
- spec/spec_helper.rb
|
120
|
+
- spec/database_integration_helper.rb
|
121
|
+
- spec/pipeline
|
122
|
+
- spec/rcov.opts
|
123
|
+
- spec/spec.opts
|
124
|
+
- spec/spec_helper.rb
|