cloudfactory 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- data/cf.gemspec +1 -0
- data/features/error_custom_task_form.feature +117 -0
- data/features/error_form_field.feature +58 -0
- data/features/error_task_form.feature +64 -0
- data/features/errors.feature +192 -0
- data/features/run.feature +136 -121
- data/features/support/cli_steps.rb +44 -0
- data/features/support/env.rb +2 -2
- data/lib/cf.rb +3 -4
- data/lib/cf/account.rb +12 -1
- data/lib/cf/cli.rb +2 -2
- data/lib/cf/cli/config.rb +2 -2
- data/lib/cf/cli/form.rb +5 -5
- data/lib/cf/cli/line.rb +40 -16
- data/lib/cf/cli/production.rb +50 -18
- data/lib/cf/cli/templates/sample-line/form.css +41 -17
- data/lib/cf/cli/templates/sample-line/form.html +27 -18
- data/lib/cf/cli/templates/sample-line/form.js +12 -3
- data/lib/cf/cli/templates/sample-line/line.yml.erb +42 -32
- data/lib/cf/client.rb +3 -3
- data/lib/cf/custom_task_form.rb +21 -91
- data/lib/cf/department.rb +1 -10
- data/lib/cf/final_output.rb +2 -16
- data/lib/cf/form_field.rb +11 -6
- data/lib/cf/human_worker.rb +93 -1
- data/lib/cf/input_format.rb +10 -62
- data/lib/cf/line.rb +46 -37
- data/lib/cf/robot_worker.rb +63 -2
- data/lib/cf/run.rb +37 -66
- data/lib/cf/station.rb +42 -104
- data/lib/cf/task_form.rb +17 -56
- data/lib/cf/version.rb +2 -2
- data/lib/generators/cf/form/form_generator.rb +3 -3
- data/lib/generators/cf/install/install_generator.rb +3 -3
- data/spec/custom_task_form_spec.rb +169 -1
- data/spec/generators/form_generator_spec.rb +2 -2
- data/spec/generators/install_generator_spec.rb +2 -2
- data/spec/run_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -0
- data/spec/station_spec.rb +13 -1
- data/spec/task_form_spec.rb +38 -6
- metadata +63 -44
@@ -5,8 +5,8 @@ require 'generator_spec/test_case'
|
|
5
5
|
|
6
6
|
require 'generators/cf/form/form_generator'
|
7
7
|
|
8
|
-
module Cf
|
9
|
-
module Generators
|
8
|
+
module Cf # :nodoc: all
|
9
|
+
module Generators # :nodoc: all
|
10
10
|
describe FormGenerator, "Passing both the Labels and Field:Type" do
|
11
11
|
include GeneratorSpec::TestCase
|
12
12
|
destination File.expand_path("../tmp", __FILE__)
|
@@ -5,8 +5,8 @@ require 'generator_spec/test_case'
|
|
5
5
|
|
6
6
|
require 'generators/cf/install/install_generator'
|
7
7
|
|
8
|
-
module Cf
|
9
|
-
module Generators
|
8
|
+
module Cf # :nodoc: all
|
9
|
+
module Generators # :nodoc: all
|
10
10
|
describe InstallGenerator, "using custom matcher" do
|
11
11
|
include GeneratorSpec::TestCase
|
12
12
|
destination File.expand_path("../tmp", __FILE__)
|
data/spec/run_spec.rb
CHANGED
@@ -250,8 +250,8 @@ module CF
|
|
250
250
|
end
|
251
251
|
|
252
252
|
it "should create production run with invalid data" do
|
253
|
-
|
254
|
-
VCR.use_cassette "run/block/create-run-invalid-file", :record => :new_episodes do
|
253
|
+
WebMock.allow_net_connect!
|
254
|
+
# VCR.use_cassette "run/block/create-run-invalid-file", :record => :new_episodes do
|
255
255
|
line = CF::Line.create("media_splitting_robot_4","Digitization") do |l|
|
256
256
|
CF::InputFormat.new({:line => l, :name => "url", :valid_type => "url", :required => "true"})
|
257
257
|
CF::Station.create({:line => l, :type => "work"}) do |s|
|
@@ -261,7 +261,7 @@ module CF
|
|
261
261
|
run = CF::Run.create(line, "media_splitting_robot_run_4", File.expand_path("../../fixtures/input_data/media_converter_robot.csv", __FILE__))
|
262
262
|
run.errors.should eql(["Extra Headers in file: [url_1]", "Insufficient Headers in file: [url]"])
|
263
263
|
|
264
|
-
end
|
264
|
+
# end
|
265
265
|
end
|
266
266
|
|
267
267
|
it "should create production run with used title data" do
|
data/spec/spec_helper.rb
CHANGED
data/spec/station_spec.rb
CHANGED
@@ -222,7 +222,7 @@ describe CF::Station do
|
|
222
222
|
end
|
223
223
|
end
|
224
224
|
|
225
|
-
context "create a station
|
225
|
+
context "create a station with errors" do
|
226
226
|
it "in plain ruby way and it should display an error message" do
|
227
227
|
# WebMock.allow_net_connect!
|
228
228
|
VCR.use_cassette "stations/plain-ruby/create-without-type", :record => :new_episodes do
|
@@ -252,5 +252,17 @@ describe CF::Station do
|
|
252
252
|
line.stations.first.errors.should eql("Input formats not assigned for the line #{line.title.downcase}")
|
253
253
|
end
|
254
254
|
end
|
255
|
+
|
256
|
+
it "Tournament station displaying errors due to invalid settings" do
|
257
|
+
# WebMock.allow_net_connect!
|
258
|
+
VCR.use_cassette "stations/block/tournament-station-error", :record => :new_episodes do
|
259
|
+
line = CF::Line.create("Digitized-91", "Digitization") do
|
260
|
+
CF::InputFormat.new({:line => self, :name => "image_url", :required => true, :valid_type => "url"})
|
261
|
+
CF::Station.new({:line => self, :type => "tournament"})
|
262
|
+
end
|
263
|
+
line.stations.first.type.should eq("Tournament")
|
264
|
+
line.stations.first.errors.should eql("[\"Jury worker can't be blank\"]")
|
265
|
+
end
|
266
|
+
end
|
255
267
|
end
|
256
268
|
end
|
data/spec/task_form_spec.rb
CHANGED
@@ -25,7 +25,7 @@ describe CF::TaskForm do
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
it "with blank data" do
|
29
29
|
WebMock.allow_net_connect!
|
30
30
|
# VCR.use_cassette "task_form/block/create", :record => :new_episodes do
|
31
31
|
line = CF::Line.create("Digiti-ard-2", "Digitization") do
|
@@ -35,12 +35,44 @@ describe CF::TaskForm do
|
|
35
35
|
CF::TaskForm.new({:station => station})
|
36
36
|
end
|
37
37
|
end
|
38
|
-
# debugger
|
39
38
|
form = line.stations[0].form
|
40
|
-
form.
|
41
|
-
form.
|
42
|
-
form.form_fields.
|
43
|
-
|
39
|
+
form.errors.should eql("[\"Title can't be blank\", \"Instruction can't be blank\"]")
|
40
|
+
form.instruction.should eq(nil)
|
41
|
+
form.form_fields.should eq([])
|
42
|
+
# end
|
43
|
+
end
|
44
|
+
|
45
|
+
it "without Title" do
|
46
|
+
WebMock.allow_net_connect!
|
47
|
+
# VCR.use_cassette "task_form/block/create", :record => :new_episodes do
|
48
|
+
line = CF::Line.create("Digiti-ard-21", "Digitization") do
|
49
|
+
CF::InputFormat.new({:line => self, :name => "image_url", :required => true, :valid_type => "url"})
|
50
|
+
CF::Station.create({:line => self, :type => "work"}) do |station|
|
51
|
+
CF::HumanWorker.new({:station => station, :number => 2, :reward => 20})
|
52
|
+
CF::TaskForm.new({:station => station, :instruction => "describe"})
|
53
|
+
end
|
54
|
+
end
|
55
|
+
form = line.stations[0].form
|
56
|
+
form.errors.should eql("[\"Title can't be blank\"]")
|
57
|
+
form.instruction.should eq("describe")
|
58
|
+
form.form_fields.should eq([])
|
59
|
+
# end
|
60
|
+
end
|
61
|
+
|
62
|
+
it "without Instruction" do
|
63
|
+
WebMock.allow_net_connect!
|
64
|
+
# VCR.use_cassette "task_form/block/create", :record => :new_episodes do
|
65
|
+
line = CF::Line.create("Digiti-ard-22", "Digitization") do
|
66
|
+
CF::InputFormat.new({:line => self, :name => "image_url", :required => true, :valid_type => "url"})
|
67
|
+
CF::Station.create({:line => self, :type => "work"}) do |station|
|
68
|
+
CF::HumanWorker.new({:station => station, :number => 2, :reward => 20})
|
69
|
+
CF::TaskForm.new({:station => station, :title => "title"})
|
70
|
+
end
|
71
|
+
end
|
72
|
+
form = line.stations[0].form
|
73
|
+
form.errors.should eql("[\"Instruction can't be blank\"]")
|
74
|
+
form.title.should eq("title")
|
75
|
+
form.form_fields.should eq([])
|
44
76
|
# end
|
45
77
|
end
|
46
78
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudfactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-08-
|
12
|
+
date: 2011-08-12 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156538240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156538240
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156537740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.0.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156537740
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: hashie
|
38
|
-
requirement: &
|
38
|
+
requirement: &2156537240 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.0.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2156537240
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rest-client
|
49
|
-
requirement: &
|
49
|
+
requirement: &2156536860 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2156536860
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: json
|
60
|
-
requirement: &
|
60
|
+
requirement: &2156684620 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2156684620
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: thor
|
71
|
-
requirement: &
|
71
|
+
requirement: &2156684120 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 0.14.6
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2156684120
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: highline
|
82
|
-
requirement: &
|
82
|
+
requirement: &2156683700 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *2156683700
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: httparty
|
93
|
-
requirement: &
|
93
|
+
requirement: &2156683160 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 0.7.8
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *2156683160
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: terminal-table
|
104
|
-
requirement: &
|
104
|
+
requirement: &2156682660 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: 1.4.2
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *2156682660
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: millisami-csv-hash
|
115
|
-
requirement: &
|
115
|
+
requirement: &2156682280 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *2156682280
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: ruby-debug19
|
126
|
-
requirement: &
|
126
|
+
requirement: &2156681820 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *2156681820
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: aruba
|
137
|
-
requirement: &
|
137
|
+
requirement: &2156681400 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *2156681400
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: rails
|
148
|
-
requirement: &
|
148
|
+
requirement: &2156680900 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ~>
|
@@ -153,10 +153,10 @@ dependencies:
|
|
153
153
|
version: 3.0.3
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *2156680900
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: bundler
|
159
|
-
requirement: &
|
159
|
+
requirement: &2156680400 !ruby/object:Gem::Requirement
|
160
160
|
none: false
|
161
161
|
requirements:
|
162
162
|
- - ~>
|
@@ -164,10 +164,10 @@ dependencies:
|
|
164
164
|
version: 1.0.0
|
165
165
|
type: :development
|
166
166
|
prerelease: false
|
167
|
-
version_requirements: *
|
167
|
+
version_requirements: *2156680400
|
168
168
|
- !ruby/object:Gem::Dependency
|
169
169
|
name: generator_spec
|
170
|
-
requirement: &
|
170
|
+
requirement: &2156679940 !ruby/object:Gem::Requirement
|
171
171
|
none: false
|
172
172
|
requirements:
|
173
173
|
- - ~>
|
@@ -175,10 +175,10 @@ dependencies:
|
|
175
175
|
version: 0.8.3
|
176
176
|
type: :development
|
177
177
|
prerelease: false
|
178
|
-
version_requirements: *
|
178
|
+
version_requirements: *2156679940
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
180
|
name: rspec-rails
|
181
|
-
requirement: &
|
181
|
+
requirement: &2156679560 !ruby/object:Gem::Requirement
|
182
182
|
none: false
|
183
183
|
requirements:
|
184
184
|
- - ! '>='
|
@@ -186,10 +186,10 @@ dependencies:
|
|
186
186
|
version: '0'
|
187
187
|
type: :development
|
188
188
|
prerelease: false
|
189
|
-
version_requirements: *
|
189
|
+
version_requirements: *2156679560
|
190
190
|
- !ruby/object:Gem::Dependency
|
191
191
|
name: cucumber
|
192
|
-
requirement: &
|
192
|
+
requirement: &2156679100 !ruby/object:Gem::Requirement
|
193
193
|
none: false
|
194
194
|
requirements:
|
195
195
|
- - ! '>='
|
@@ -197,10 +197,10 @@ dependencies:
|
|
197
197
|
version: '0'
|
198
198
|
type: :development
|
199
199
|
prerelease: false
|
200
|
-
version_requirements: *
|
200
|
+
version_requirements: *2156679100
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: rdoc
|
203
|
-
requirement: &
|
203
|
+
requirement: &2156678600 !ruby/object:Gem::Requirement
|
204
204
|
none: false
|
205
205
|
requirements:
|
206
206
|
- - ~>
|
@@ -208,10 +208,10 @@ dependencies:
|
|
208
208
|
version: 3.5.3
|
209
209
|
type: :development
|
210
210
|
prerelease: false
|
211
|
-
version_requirements: *
|
211
|
+
version_requirements: *2156678600
|
212
212
|
- !ruby/object:Gem::Dependency
|
213
213
|
name: vcr
|
214
|
-
requirement: &
|
214
|
+
requirement: &2156678180 !ruby/object:Gem::Requirement
|
215
215
|
none: false
|
216
216
|
requirements:
|
217
217
|
- - ! '>='
|
@@ -219,10 +219,10 @@ dependencies:
|
|
219
219
|
version: '0'
|
220
220
|
type: :development
|
221
221
|
prerelease: false
|
222
|
-
version_requirements: *
|
222
|
+
version_requirements: *2156678180
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: rake
|
225
|
-
requirement: &
|
225
|
+
requirement: &2156677720 !ruby/object:Gem::Requirement
|
226
226
|
none: false
|
227
227
|
requirements:
|
228
228
|
- - ! '>='
|
@@ -230,10 +230,10 @@ dependencies:
|
|
230
230
|
version: '0'
|
231
231
|
type: :development
|
232
232
|
prerelease: false
|
233
|
-
version_requirements: *
|
233
|
+
version_requirements: *2156677720
|
234
234
|
- !ruby/object:Gem::Dependency
|
235
235
|
name: webmock
|
236
|
-
requirement: &
|
236
|
+
requirement: &2156677300 !ruby/object:Gem::Requirement
|
237
237
|
none: false
|
238
238
|
requirements:
|
239
239
|
- - ! '>='
|
@@ -241,7 +241,18 @@ dependencies:
|
|
241
241
|
version: '0'
|
242
242
|
type: :development
|
243
243
|
prerelease: false
|
244
|
-
version_requirements: *
|
244
|
+
version_requirements: *2156677300
|
245
|
+
- !ruby/object:Gem::Dependency
|
246
|
+
name: timecop
|
247
|
+
requirement: &2156676880 !ruby/object:Gem::Requirement
|
248
|
+
none: false
|
249
|
+
requirements:
|
250
|
+
- - ! '>='
|
251
|
+
- !ruby/object:Gem::Version
|
252
|
+
version: '0'
|
253
|
+
type: :development
|
254
|
+
prerelease: false
|
255
|
+
version_requirements: *2156676880
|
245
256
|
description: A Ruby wrapper and CLI for to interact with Cloudfactory.com REST API
|
246
257
|
email:
|
247
258
|
- info@cloudfactory.com
|
@@ -257,6 +268,10 @@ files:
|
|
257
268
|
- Rakefile
|
258
269
|
- bin/cf
|
259
270
|
- cf.gemspec
|
271
|
+
- features/error_custom_task_form.feature
|
272
|
+
- features/error_form_field.feature
|
273
|
+
- features/error_task_form.feature
|
274
|
+
- features/errors.feature
|
260
275
|
- features/form_generation.feature
|
261
276
|
- features/form_preview.feature
|
262
277
|
- features/line_creation.feature
|
@@ -372,6 +387,10 @@ signing_key:
|
|
372
387
|
specification_version: 3
|
373
388
|
summary: A Ruby wrapper and CLI for Cloudfactory.com
|
374
389
|
test_files:
|
390
|
+
- features/error_custom_task_form.feature
|
391
|
+
- features/error_form_field.feature
|
392
|
+
- features/error_task_form.feature
|
393
|
+
- features/errors.feature
|
375
394
|
- features/form_generation.feature
|
376
395
|
- features/form_preview.feature
|
377
396
|
- features/line_creation.feature
|