employer 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/lib/employer/cli.rb +11 -0
- data/lib/employer/pipeline.rb +5 -0
- data/lib/employer/version.rb +1 -1
- data/spec/employer/pipeline_spec.rb +12 -0
- metadata +1 -1
data/README.md
CHANGED
data/lib/employer/cli.rb
CHANGED
@@ -28,6 +28,17 @@ module Employer
|
|
28
28
|
workshop.run
|
29
29
|
end
|
30
30
|
|
31
|
+
desc "clear", "Clear jobs"
|
32
|
+
option :config, default: "config/employer.rb", desc: "Config file to use"
|
33
|
+
def clear
|
34
|
+
unless File.exists?(options[:config])
|
35
|
+
STDERR.puts "#{options[:config]} does not exist."
|
36
|
+
exit 1
|
37
|
+
end
|
38
|
+
|
39
|
+
Employer::Workshop.pipeline(options[:config]).clear
|
40
|
+
end
|
41
|
+
|
31
42
|
desc "config", "Generate config file"
|
32
43
|
option :config, default: "config/employer.rb", desc: "Path to config file"
|
33
44
|
def config
|
data/lib/employer/pipeline.rb
CHANGED
data/lib/employer/version.rb
CHANGED
@@ -54,6 +54,18 @@ describe Employer::Pipeline do
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
+
describe "#clear" do
|
58
|
+
it "clears all jobs using its backend" do
|
59
|
+
backend.should_receive(:clear)
|
60
|
+
pipeline.backend = backend
|
61
|
+
pipeline.clear
|
62
|
+
end
|
63
|
+
|
64
|
+
it "fails when no backend is set" do
|
65
|
+
expect { pipeline.clear }.to raise_error(Employer::Errors::PipelineBackendRequired)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
57
69
|
describe "#complete" do
|
58
70
|
it "completes job using its backend" do
|
59
71
|
backend.should_receive(:complete).with(job)
|