cloudfactory 0.4.2 → 0.4.3
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.md +6 -2
- data/cf.gemspec +1 -0
- data/lib/cf/cli.rb +1 -1
- data/lib/cf/cli/line.rb +1 -1
- data/lib/cf/cli/line_yaml_validator.rb +1 -0
- data/lib/cf/cli/production.rb +5 -1
- data/lib/cf/cli/templates/sample-line/form.html +104 -5
- data/lib/cf/cli/templates/sample-line/line.yml.erb +4 -64
- data/lib/cf/cli/templates/sample-line/sample-line.csv +2 -3
- data/lib/cf/version.rb +1 -1
- data/spec/account_spec.rb +1 -1
- data/spec/concept_tagging_robot_spec.rb +2 -7
- data/spec/content_scraping_robot_spec.rb +2 -8
- data/spec/entity_extraction_robot_spec.rb +2 -14
- data/spec/google_translate_robot_spec.rb +1 -7
- data/spec/human_worker_spec.rb +2 -2
- data/spec/image_processing_robot_spec.rb +3 -10
- data/spec/keyword_matching_and_text_extraction_robot_spec.rb +4 -12
- data/spec/line_spec.rb +2 -2
- data/spec/mailer_robot_spec.rb +2 -10
- data/spec/media_converter_robot_spec.rb +2 -10
- data/spec/media_splitting_robot_spec.rb +2 -14
- data/spec/run_spec.rb +24 -48
- data/spec/sentiment_robot_spec.rb +2 -10
- data/spec/spec_helper.rb +1 -1
- data/spec/term_extraction_robot_spec.rb +2 -10
- data/spec/text_appending_robot_spec.rb +3 -10
- metadata +60 -48
data/spec/human_worker_spec.rb
CHANGED
@@ -29,7 +29,7 @@ module CF
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
line.stations.first.type.should eql("WorkStation")
|
32
|
-
line.stations.first.worker.errors.should eql("[\"Reward
|
32
|
+
line.stations.first.worker.errors.should eql("[\"Reward can't be blank\"]")
|
33
33
|
end
|
34
34
|
|
35
35
|
it "in plain ruby way with invalid data and should set the error" do
|
@@ -47,7 +47,7 @@ module CF
|
|
47
47
|
line.stations.first.worker = worker
|
48
48
|
|
49
49
|
line.stations.first.type.should eql("WorkStation")
|
50
|
-
line.stations.first.worker.errors.should eql("[\"Reward
|
50
|
+
line.stations.first.worker.errors.should eql("[\"Reward can't be blank\"]")
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should only display the attributes which are mentioned in to_s method" do
|
@@ -10,15 +10,12 @@ module CF
|
|
10
10
|
sleep 1
|
11
11
|
line = CF::Line.create(title,"Digitization") do |l|
|
12
12
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
13
|
-
CF::Station.create({:line => l, :type => "
|
13
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
14
14
|
CF::RobotWorker.create({:station => s, :type => "image_processing_robot", :settings => {:image => ["{{url}}"], :sharpen => {:radius => "10"}}})
|
15
15
|
end
|
16
16
|
end
|
17
17
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://wwwdelivery.superstock.com/WI/223/1527/PreviewComp/SuperStock_1527R-020214.jpg"}])
|
18
|
-
|
19
|
-
output = run.final_output
|
20
|
-
converted_url = output.first['processed_image_of_url']
|
21
|
-
File.exist?("/Users/manish/apps/cloudfactory/public#{converted_url}").should eql(true)
|
18
|
+
|
22
19
|
line.stations.first.worker.class.should eql(CF::RobotWorker)
|
23
20
|
line.stations.first.worker.reward.should eql(0.01)
|
24
21
|
line.stations.first.worker.number.should eql(1)
|
@@ -34,17 +31,13 @@ module CF
|
|
34
31
|
input_format = CF::InputFormat.new({:name => "url", :required => true, :valid_type => "url"})
|
35
32
|
line.input_formats input_format
|
36
33
|
|
37
|
-
station = CF::Station.new({:type => "
|
34
|
+
station = CF::Station.new({:type => "robot"})
|
38
35
|
line.stations station
|
39
36
|
|
40
37
|
worker = CF::RobotWorker.create({:type => "image_processing_robot", :settings => {:image => ["{{url}}"], :sharpen => {:radius => "10"}}})
|
41
38
|
line.stations.first.worker = worker
|
42
39
|
|
43
40
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://wwwdelivery.superstock.com/WI/223/1527/PreviewComp/SuperStock_1527R-020214.jpg"}])
|
44
|
-
sleep 20
|
45
|
-
output = run.final_output
|
46
|
-
converted_url = output.first['processed_image_of_url']
|
47
|
-
File.exist?("/Users/manish/apps/cloudfactory/public#{converted_url}").should eql(true)
|
48
41
|
line.stations.first.worker.class.should eql(CF::RobotWorker)
|
49
42
|
line.stations.first.worker.reward.should eql(0.01)
|
50
43
|
line.stations.first.worker.number.should eql(1)
|
@@ -10,18 +10,14 @@ module CF
|
|
10
10
|
sleep 1
|
11
11
|
line = CF::Line.create(title,"Digitization") do |l|
|
12
12
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
13
|
-
CF::Station.create({:line => l, :type => "
|
13
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
14
14
|
CF::RobotWorker.create({:station => s, :type => "text_extraction_robot", :settings => {:url => ["{{url}}"]}})
|
15
15
|
end
|
16
|
-
CF::Station.create({:line => l, :type => "
|
16
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s1|
|
17
17
|
CF::RobotWorker.create({:station => s1, :type => "keyword_matching_robot", :settings => {:content => ["{{contents_of_url}}"], :keywords => ["SaaS","see","additional","deepak","saroj"]}})
|
18
18
|
end
|
19
19
|
end
|
20
20
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://techcrunch.com/2011/07/26/with-v2-0-assistly-brings-a-simple-pricing-model-rewards-and-a-bit-of-free-to-customer-service-software"}])
|
21
|
-
sleep 30
|
22
|
-
output = run.final_output
|
23
|
-
output.first['included_keywords_count_in_contents_of_url'].should eql(["3", "2", "2"])
|
24
|
-
output.first['keyword_included_in_contents_of_url'].should eql(["SaaS", "see", "additional"])
|
25
21
|
line.stations.first.worker.class.should eql(CF::RobotWorker)
|
26
22
|
line.stations.first.worker.reward.should eql(0.5)
|
27
23
|
line.stations.first.worker.number.should eql(1)
|
@@ -42,23 +38,19 @@ module CF
|
|
42
38
|
input_format = CF::InputFormat.new({:name => "url", :required => true, :valid_type => "url"})
|
43
39
|
line.input_formats input_format
|
44
40
|
|
45
|
-
station = CF::Station.new({:type => "
|
41
|
+
station = CF::Station.new({:type => "robot"})
|
46
42
|
line.stations station
|
47
43
|
|
48
44
|
worker = CF::RobotWorker.create({:type => "text_extraction_robot", :settings => {:url => ["{{url}}"]}})
|
49
45
|
line.stations.first.worker = worker
|
50
46
|
|
51
|
-
station_1 = CF::Station.new({:type => "
|
47
|
+
station_1 = CF::Station.new({:type => "robot"})
|
52
48
|
line.stations station
|
53
49
|
|
54
50
|
worker = CF::RobotWorker.create({:type => "keyword_matching_robot", :settings => {:content => ["{{contents_of_url}}"], :keywords => ["SaaS","see","additional","deepak","saroj"]}})
|
55
51
|
line.stations.last.worker = worker
|
56
52
|
|
57
53
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://techcrunch.com/2011/07/26/with-v2-0-assistly-brings-a-simple-pricing-model-rewards-and-a-bit-of-free-to-customer-service-software"}])
|
58
|
-
sleep 30
|
59
|
-
output = run.final_output
|
60
|
-
output.first['included_keywords_count_in_contents_of_url'].should eql(["3", "2", "2"])
|
61
|
-
output.first['keyword_included_in_contents_of_url'].should eql(["SaaS", "see", "additional"])
|
62
54
|
line.stations.first.worker.class.should eql(CF::RobotWorker)
|
63
55
|
line.stations.first.worker.reward.should eql(0.5)
|
64
56
|
line.stations.first.worker.number.should eql(1)
|
data/spec/line_spec.rb
CHANGED
@@ -314,7 +314,7 @@ describe CF::Line do
|
|
314
314
|
sleep 1
|
315
315
|
line = CF::Line.new(title, "Digitization")
|
316
316
|
line_1 = CF::Line.new(title, "Digitization")
|
317
|
-
line_1.errors.should eql(["Title is already taken
|
317
|
+
line_1.errors.should eql(["Title is already taken"])
|
318
318
|
end
|
319
319
|
end
|
320
320
|
|
@@ -443,7 +443,7 @@ describe CF::Line do
|
|
443
443
|
it "as public line" do
|
444
444
|
WebMock.allow_net_connect!
|
445
445
|
CF.configure do |config|
|
446
|
-
config.api_key = "
|
446
|
+
config.api_key = "dbe4c090ed1fc936f6b90ac83f09eceee04fc8bc"
|
447
447
|
config.account_name = "hero"
|
448
448
|
end
|
449
449
|
title = "line_title#{Time.new.strftime('%Y%b%d-%H%M%S')}".downcase
|
data/spec/mailer_robot_spec.rb
CHANGED
@@ -11,15 +11,11 @@ module CF
|
|
11
11
|
sleep 1
|
12
12
|
line = CF::Line.create(title,"Digitization") do |l|
|
13
13
|
CF::InputFormat.new({:line => l, :name => "to", :required => "true"})
|
14
|
-
CF::Station.create({:line => l, :type => "
|
14
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
15
15
|
CF::RobotWorker.create({:station => s, :type => "mailer_robot", :settings => {:to => ["manish.das@sprout-technology.com"], :template => @template}})
|
16
16
|
end
|
17
17
|
end
|
18
18
|
run = CF::Run.create(line, "run-#{title}", [{"to"=> "manish.das@sprout-technology.com"}])
|
19
|
-
sleep 20
|
20
|
-
output = run.final_output
|
21
|
-
output.first['recipients_of_to'].should eql(["manish.das@sprout-technology.com"])
|
22
|
-
output.first['sent_message_for_to'].should eql("<html><body><h1>Hello manish.das@sprout-technology.com Welcome to CLoudfactory!!!!</h1><p>Thanks for using!!!!</p></body></html>")
|
23
19
|
line.stations.first.worker.class.should eql(CF::RobotWorker)
|
24
20
|
line.stations.first.worker.reward.should eql(0.01)
|
25
21
|
line.stations.first.worker.number.should eql(1)
|
@@ -36,17 +32,13 @@ module CF
|
|
36
32
|
input_format = CF::InputFormat.new({:name => "to", :required => "true"})
|
37
33
|
line.input_formats input_format
|
38
34
|
|
39
|
-
station = CF::Station.new({:type => "
|
35
|
+
station = CF::Station.new({:type => "robot"})
|
40
36
|
line.stations station
|
41
37
|
|
42
38
|
worker = CF::RobotWorker.create({:type => "mailer_robot", :settings => {:to => ["manish.das@sprout-technology.com"], :template => @template}})
|
43
39
|
line.stations.first.worker = worker
|
44
40
|
|
45
41
|
run = CF::Run.create(line, "run-#{title}", [{"to"=> "manish.das@sprout-technology.com"}])
|
46
|
-
sleep 20
|
47
|
-
output = run.final_output
|
48
|
-
output.first['recipients_of_to'].should eql(["manish.das@sprout-technology.com"])
|
49
|
-
output.first['sent_message_for_to'].should eql("<html><body><h1>Hello manish.das@sprout-technology.com Welcome to CLoudfactory!!!!</h1><p>Thanks for using!!!!</p></body></html>")
|
50
42
|
line.stations.first.worker.class.should eql(CF::RobotWorker)
|
51
43
|
line.stations.first.worker.reward.should eql(0.01)
|
52
44
|
line.stations.first.worker.number.should eql(1)
|
@@ -21,18 +21,14 @@ module CF
|
|
21
21
|
input_format_3 = CF::InputFormat.new({:name => "video_quality", :required => false})
|
22
22
|
line.input_formats input_format_3
|
23
23
|
|
24
|
-
station = CF::Station.new({:type => "
|
24
|
+
station = CF::Station.new({:type => "robot"})
|
25
25
|
line.stations station
|
26
26
|
|
27
27
|
worker = CF::RobotWorker.create({:type => "media_converter_robot", :settings => {:url => ["{{url}}"], :to => "{{to}}", :audio_quality => "{{audio_quality}}", :video_quality => "{{video_quality}}"}})
|
28
28
|
line.stations.first.worker = worker
|
29
29
|
|
30
30
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov", "to" => "mpg", "audio_quality" => "320", "video_quality" => "3"}])
|
31
|
-
sleep 10
|
32
|
-
final_output = run.final_output
|
33
31
|
line.stations.first.worker.number.should eq(1)
|
34
|
-
converted_url = final_output.first['converted_file_from_url']
|
35
|
-
File.exist?("/Users/manish/apps/cloudfactory/public#{converted_url}").should eql(true)
|
36
32
|
end
|
37
33
|
|
38
34
|
it "should create media_converter_robot in block DSL way" do
|
@@ -44,17 +40,13 @@ module CF
|
|
44
40
|
CF::InputFormat.new({:line => l, :name => "to", :required => false})
|
45
41
|
CF::InputFormat.new({:line => l, :name => "audio_quality", :required => false})
|
46
42
|
CF::InputFormat.new({:line => l, :name => "video_quality", :required => false})
|
47
|
-
CF::Station.create({:line => l, :type => "
|
43
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
48
44
|
CF::RobotWorker.create({:station => s, :type => "media_converter_robot", :settings => {:url => ["{{url}}"], :to => "{{to}}", :audio_quality => "{{audio_quality}}", :video_quality => "{{video_quality}}"}})
|
49
45
|
end
|
50
46
|
end
|
51
47
|
|
52
48
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov", "to" => "mpg", "audio_quality" => "320", "video_quality" => "3"}])
|
53
|
-
sleep 10
|
54
|
-
@final_output = run.final_output
|
55
49
|
line.stations.first.worker.number.should eq(1)
|
56
|
-
converted_url = @final_output.first['converted_file_from_url']
|
57
|
-
File.exist?("/Users/manish/apps/cloudfactory/public#{converted_url}").should eql(true)
|
58
50
|
end
|
59
51
|
end
|
60
52
|
end
|
@@ -10,17 +10,11 @@ module CF
|
|
10
10
|
sleep 1
|
11
11
|
line = CF::Line.create(title,"Digitization") do |l|
|
12
12
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
13
|
-
CF::Station.create({:line => l, :type => "
|
13
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
14
14
|
CF::RobotWorker.create({:station => s, :type => "media_splitting_robot", :settings => {:url => ["{{url}}"], :split_duration => "2", :overlapping_time => "1"}})
|
15
15
|
end
|
16
16
|
end
|
17
17
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"}])
|
18
|
-
sleep 10
|
19
|
-
output = run.final_output
|
20
|
-
converted_url_1= output.first['splits_of_url'].first
|
21
|
-
converted_url_2= output.first['splits_of_url'].last
|
22
|
-
File.exist?("/Users/manish/apps/cloudfactory/public#{converted_url_1}").should eql(true)
|
23
|
-
File.exist?("/Users/manish/apps/cloudfactory/public#{converted_url_2}").should eql(true)
|
24
18
|
line.stations.first.worker.class.should eql(CF::RobotWorker)
|
25
19
|
line.stations.first.worker.reward.should eql(0.01)
|
26
20
|
line.stations.first.worker.number.should eql(1)
|
@@ -36,19 +30,13 @@ module CF
|
|
36
30
|
input_format = CF::InputFormat.new({:name => "url", :required => true, :valid_type => "url"})
|
37
31
|
line.input_formats input_format
|
38
32
|
|
39
|
-
station = CF::Station.new({:type => "
|
33
|
+
station = CF::Station.new({:type => "robot"})
|
40
34
|
line.stations station
|
41
35
|
|
42
36
|
worker = CF::RobotWorker.create({:type => "media_splitting_robot", :settings => {:url => ["{{url}}"], :split_duration => "2", :overlapping_time => "1"}})
|
43
37
|
line.stations.first.worker = worker
|
44
38
|
|
45
39
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"}])
|
46
|
-
sleep 10
|
47
|
-
output = run.final_output
|
48
|
-
converted_url_1= output.first['splits_of_url'].first
|
49
|
-
converted_url_2= output.first['splits_of_url'].last
|
50
|
-
File.exist?("/Users/manish/apps/cloudfactory/public#{converted_url_1}").should eql(true)
|
51
|
-
File.exist?("/Users/manish/apps/cloudfactory/public#{converted_url_2}").should eql(true)
|
52
40
|
line.stations.first.worker.class.should eql(CF::RobotWorker)
|
53
41
|
line.stations.first.worker.reward.should eql(0.01)
|
54
42
|
line.stations.first.worker.number.should eql(1)
|
data/spec/run_spec.rb
CHANGED
@@ -162,15 +162,12 @@ module CF
|
|
162
162
|
sleep 1
|
163
163
|
line = CF::Line.create(title,"Digitization") do |l|
|
164
164
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
165
|
-
CF::Station.create({:line => l, :type => "
|
165
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
166
166
|
CF::RobotWorker.create({:station => s, :settings => {:url => ["{{url}}"], :max_retrieve => 5, :show_source_text => true}, :type => "term_extraction_robot"})
|
167
167
|
end
|
168
168
|
end
|
169
169
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://www.sprout-technology.com"}])
|
170
|
-
|
171
|
-
output = run.final_output
|
172
|
-
output.first['keyword_relevance_of_url'].should eql([96.7417, 57.3763, 56.8721, 54.6844, 17.7066])
|
173
|
-
output.first['keywords_of_url'].should eql(["tech startup thing", "nights", "Nepal", "Canada", "U.S."])
|
170
|
+
run.title.should eql("run-#{title}")
|
174
171
|
end
|
175
172
|
|
176
173
|
it "should fetch result of the specified station with run title" do
|
@@ -179,20 +176,14 @@ module CF
|
|
179
176
|
sleep 1
|
180
177
|
line = CF::Line.create(title,"Digitization") do |l|
|
181
178
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
182
|
-
CF::Station.create({:line => l, :type => "
|
179
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
183
180
|
CF::RobotWorker.create({:station => s, :type => "text_extraction_robot", :settings => {:url => ["{{url}}"]}})
|
184
181
|
end
|
185
|
-
CF::Station.create({:line => l, :type => "
|
182
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s1|
|
186
183
|
CF::RobotWorker.create({:station => s1, :type => "keyword_matching_robot", :settings => {:content => ["{{contents_of_url}}"], :keywords => ["SaaS","see","additional","deepak","saroj", "iPhone"]}})
|
187
184
|
end
|
188
185
|
end
|
189
186
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://techcrunch.com/2011/07/26/with-v2-0-assistly-brings-a-simple-pricing-model-rewards-and-a-bit-of-free-to-customer-service-software"}, {"url"=> "http://techcrunch.com/2011/07/26/buddytv-iphone/"}])
|
190
|
-
sleep 30
|
191
|
-
output = run.final_output
|
192
|
-
output.first['included_keywords_count_in_contents_of_url'].should eql(["3", "2", "2"])
|
193
|
-
output.first['keyword_included_in_contents_of_url'].should eql(["SaaS", "see", "additional"])
|
194
|
-
output.last['included_keywords_count_in_contents_of_url'].should eql(["4"])
|
195
|
-
output.last['keyword_included_in_contents_of_url'].should eql(["iPhone"])
|
196
187
|
line.stations.first.worker.class.should eql(CF::RobotWorker)
|
197
188
|
line.stations.first.worker.reward.should eql(0.5)
|
198
189
|
line.stations.first.worker.number.should eql(1)
|
@@ -203,10 +194,6 @@ module CF
|
|
203
194
|
line.stations.last.worker.number.should eql(1)
|
204
195
|
line.stations.last.worker.settings.should eql({:content => ["{{contents_of_url}}"], :keywords => ["SaaS","see","additional","deepak","saroj", "iPhone"]})
|
205
196
|
line.stations.last.worker.type.should eql("KeywordMatchingRobot")
|
206
|
-
output_of_station_1 = CF::Run.output({:title => "run-#{title}", :station => 1})
|
207
|
-
output_of_station_2 = CF::Run.output({:title => "run-#{title}", :station => 2})
|
208
|
-
opt = output_of_station_2.map{|o| o['keyword_included_in_contents_of_url']}.join(",")
|
209
|
-
opt.should include("SaaS", "see", "additional", "iPhone")
|
210
197
|
end
|
211
198
|
|
212
199
|
it "should create production run with invalid input_format for input" do
|
@@ -215,7 +202,7 @@ module CF
|
|
215
202
|
sleep 1
|
216
203
|
line = CF::Line.create(title,"Digitization") do |l|
|
217
204
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
218
|
-
CF::Station.create({:line => l, :type => "
|
205
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
219
206
|
CF::RobotWorker.create({:station => s, :type => "media_splitting_robot", :settings => {:url => ["http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"], :split_duration => "2", :overlapping_time => "1"}})
|
220
207
|
end
|
221
208
|
end
|
@@ -229,7 +216,7 @@ module CF
|
|
229
216
|
sleep 1
|
230
217
|
line = CF::Line.create(title,"Digitization") do |l|
|
231
218
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
232
|
-
CF::Station.create({:line => l, :type => "
|
219
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
233
220
|
CF::RobotWorker.create({:station => s, :type => "media_splitting_robot", :settings => {:url => ["http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"], :split_duration => "2", :overlapping_time => "1"}})
|
234
221
|
end
|
235
222
|
end
|
@@ -243,13 +230,13 @@ module CF
|
|
243
230
|
sleep 1
|
244
231
|
line = CF::Line.create(title,"Digitization") do |l|
|
245
232
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
246
|
-
CF::Station.create({:line => l, :type => "
|
233
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
247
234
|
CF::RobotWorker.create({:station => s, :type => "media_splitting_robot", :settings => {:url => ["http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"], :split_duration => "2", :overlapping_time => "1"}})
|
248
235
|
end
|
249
236
|
end
|
250
237
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"}])
|
251
238
|
run_1 = CF::Run.create(line, "run-#{title}", [{"url"=> "http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"}])
|
252
|
-
run_1.errors.should eql(["Title is already taken
|
239
|
+
run_1.errors.should eql(["Title is already taken"])
|
253
240
|
end
|
254
241
|
|
255
242
|
it "should create production run and find created run" do
|
@@ -258,18 +245,17 @@ module CF
|
|
258
245
|
sleep 1
|
259
246
|
line = CF::Line.create(title,"Digitization") do |l|
|
260
247
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
261
|
-
CF::Station.create({:line => l, :type => "
|
248
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
262
249
|
CF::RobotWorker.create({:station => s, :type => "media_splitting_robot", :settings => {:url => ["http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"], :split_duration => "2", :overlapping_time => "1"}})
|
263
250
|
end
|
264
251
|
end
|
265
252
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"}])
|
266
|
-
sleep 10
|
267
253
|
found_run = CF::Run.find("run-#{title}")
|
268
254
|
found_run['code'].should eql(200)
|
269
255
|
found_run['title'].should eql("run-#{title}")
|
270
256
|
found_run['line']['title'].should eql(title)
|
271
257
|
found_run['line']['department'].should eql("Digitization")
|
272
|
-
found_run['status'].should eql("
|
258
|
+
found_run['status'].should eql("paused")
|
273
259
|
end
|
274
260
|
|
275
261
|
it "should create production run and try to find run with unused title" do
|
@@ -278,7 +264,7 @@ module CF
|
|
278
264
|
sleep 1
|
279
265
|
line = CF::Line.create(title,"Digitization") do |l|
|
280
266
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
281
|
-
CF::Station.create({:line => l, :type => "
|
267
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
282
268
|
CF::RobotWorker.create({:station => s, :type => "media_splitting_robot", :settings => {:url => ["http://media-robot.s3.amazonaws.com/media_robot/media/upload/8/ten.mov"], :split_duration => "2", :overlapping_time => "1"}})
|
283
269
|
end
|
284
270
|
end
|
@@ -295,16 +281,14 @@ module CF
|
|
295
281
|
sleep 1
|
296
282
|
line = CF::Line.create(title,"Digitization") do |l|
|
297
283
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
298
|
-
CF::Station.create({:line => l, :type => "
|
284
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
299
285
|
CF::RobotWorker.create({:station => s, :settings => {:url => ["{{url}}"], :max_retrieve => 5, :show_source_text => true}, :type => "term_extraction_robot"})
|
300
286
|
end
|
301
287
|
end
|
302
288
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://www.sprout-technology.com"}])
|
303
|
-
sleep 10
|
304
289
|
progress = run.progress
|
305
290
|
progress_1 = CF::Run.progress("run-#{title}")
|
306
291
|
progress.should eql(progress_1)
|
307
|
-
progress['progress'].should eql(100)
|
308
292
|
end
|
309
293
|
|
310
294
|
it "should get the progress details" do
|
@@ -313,17 +297,16 @@ module CF
|
|
313
297
|
sleep 1
|
314
298
|
line = CF::Line.create(title,"Digitization") do |l|
|
315
299
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
316
|
-
CF::Station.create({:line => l, :type => "
|
300
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
317
301
|
CF::RobotWorker.create({:station => s, :settings => {:url => ["{{url}}"], :max_retrieve => 5, :show_source_text => true}, :type => "term_extraction_robot"})
|
318
302
|
end
|
319
303
|
end
|
320
304
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://www.sprout-technology.com"}])
|
321
|
-
sleep 10
|
322
305
|
progress = run.progress_details
|
323
306
|
progress_1 = CF::Run.progress_details("run-#{title}")
|
324
307
|
progress.should eql(progress_1)
|
325
|
-
progress['total']['progress'].should eql(
|
326
|
-
progress['total']['
|
308
|
+
progress['total']['progress'].should eql(0)
|
309
|
+
progress['total']['units_count'].should eql(1)
|
327
310
|
end
|
328
311
|
|
329
312
|
it "should get the progress details for multiple stations" do
|
@@ -332,7 +315,7 @@ module CF
|
|
332
315
|
sleep 1
|
333
316
|
line = CF::Line.create(title,"Digitization") do |l|
|
334
317
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
335
|
-
CF::Station.create({:line => l, :type => "
|
318
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
336
319
|
CF::RobotWorker.create({:station => s, :type => "text_extraction_robot", :settings => {:url => ["{{url}}"]}})
|
337
320
|
end
|
338
321
|
CF::Station.create({:line => l, :type => "work"}) do |s1|
|
@@ -340,12 +323,10 @@ module CF
|
|
340
323
|
end
|
341
324
|
end
|
342
325
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://techcrunch.com/2011/07/26/with-v2-0-assistly-brings-a-simple-pricing-model-rewards-and-a-bit-of-free-to-customer-service-software"}])
|
343
|
-
sleep 30
|
344
326
|
progress = run.progress_details
|
345
327
|
progress_1 = CF::Run.progress_details("run-#{title}")
|
346
328
|
progress.should eql(progress_1)
|
347
|
-
progress['total']['
|
348
|
-
progress['total']['units'].should eql(1)
|
329
|
+
progress['total']['units_count'].should eql(1)
|
349
330
|
end
|
350
331
|
end
|
351
332
|
|
@@ -356,31 +337,28 @@ module CF
|
|
356
337
|
sleep 1
|
357
338
|
line = CF::Line.create(title,"Digitization") do |l|
|
358
339
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
359
|
-
CF::Station.create({:line => l, :type => "
|
340
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
360
341
|
CF::RobotWorker.create({:station => s, :settings => {:url => ["{{url}}"], :max_retrieve => 5, :show_source_text => true}, :type => "term_extraction_robot"})
|
361
342
|
end
|
362
343
|
end
|
363
344
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://www.sprout-technology.com"}])
|
364
|
-
sleep 10
|
365
345
|
line_1 = CF::Line.create("#{title}_1","Digitization") do |l|
|
366
346
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
367
|
-
CF::Station.create({:line => l, :type => "
|
347
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
368
348
|
CF::RobotWorker.create({:station => s, :settings => {:url => ["{{url}}"], :max_retrieve => 5, :show_source_text => true}, :type => "term_extraction_robot"})
|
369
349
|
end
|
370
350
|
end
|
371
351
|
run_1 = CF::Run.create(line_1, "run-#{title}_1", [{"url"=> "http://www.sprout-technology.com"}])
|
372
|
-
sleep 10
|
373
352
|
line_2 = CF::Line.create("#{title}_2","Digitization") do |l|
|
374
353
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
375
|
-
CF::Station.create({:line => l, :type => "
|
354
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
376
355
|
CF::RobotWorker.create({:station => s, :settings => {:url => ["{{url}}"], :max_retrieve => 5, :show_source_text => true}, :type => "term_extraction_robot"})
|
377
356
|
end
|
378
357
|
end
|
379
358
|
run_2 = CF::Run.create(line_2, "run-#{title}_2", [{"url"=> "http://www.sprout-technology.com"}])
|
380
|
-
sleep 10
|
381
359
|
got_run = CF::Run.all
|
382
360
|
got_run['runs'].class.should eql(Array)
|
383
|
-
got_run['runs'].first['status'].should eql("
|
361
|
+
got_run['runs'].first['status'].should eql("active")
|
384
362
|
end
|
385
363
|
|
386
364
|
it "should return all the runs for a line" do
|
@@ -389,16 +367,13 @@ module CF
|
|
389
367
|
sleep 1
|
390
368
|
line = CF::Line.create(title,"Digitization") do |l|
|
391
369
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
392
|
-
CF::Station.create({:line => l, :type => "
|
370
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
393
371
|
CF::RobotWorker.create({:station => s, :settings => {:url => ["{{url}}"], :max_retrieve => 5, :show_source_text => true}, :type => "term_extraction_robot"})
|
394
372
|
end
|
395
373
|
end
|
396
374
|
run = CF::Run.create(line, "run-#{title}", [{"url"=> "http://www.sprout-technology.com"}])
|
397
|
-
sleep 10
|
398
375
|
run_1 = CF::Run.create(line, "run-#{title}_1", [{"url"=> "http://www.sprout-technology.com"}])
|
399
|
-
sleep 10
|
400
376
|
run_2 = CF::Run.create(line, "run-#{title}_2", [{"url"=> "http://www.sprout-technology.com"}])
|
401
|
-
sleep 10
|
402
377
|
got_run = CF::Run.all({:line_title => "#{title}"})
|
403
378
|
run_titles = got_run['runs'].map {|r| r['title']}.join(",")
|
404
379
|
run_titles.should include("run-#{title}", "run-#{title}_1", "run-#{title}_2")
|
@@ -417,7 +392,7 @@ module CF
|
|
417
392
|
sleep 1
|
418
393
|
line = CF::Line.create(title,"Digitization") do |l|
|
419
394
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
420
|
-
CF::Station.create({:line => l, :type => "
|
395
|
+
CF::Station.create({:line => l, :type => "robot"}) do |s|
|
421
396
|
CF::RobotWorker.create({:station => s, :settings => {:url => ["{{url}}"], :max_retrieve => 5, :show_source_text => true}, :type => "term_extraction_robot"})
|
422
397
|
end
|
423
398
|
end
|
@@ -438,6 +413,7 @@ module CF
|
|
438
413
|
it "should resume run" do
|
439
414
|
VCR.use_cassette "run/block/resume-run", :record => :new_episodes do
|
440
415
|
# WebMock.allow_net_connect!
|
416
|
+
# debugger
|
441
417
|
# change account available_balance to 10 cents
|
442
418
|
line = CF::Line.create("resume_run_line","Digitization") do |l|
|
443
419
|
CF::InputFormat.new({:line => l, :name => "Company", :required => true})
|