cloudfactory 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.5.4 (2012-04-04)
2
+ * Zipped file is removed after production run is successfully started.
3
+ * Display error message if the csv file is greater than 2MB.
4
+
1
5
  ## 0.5.3 (2012-03-16)
2
6
  * CSV file is zipped before send to CF platform
3
7
  * The CSV file is deleted from the zipped file after successful posting of file to CF platform
data/cf.gemspec CHANGED
@@ -72,7 +72,8 @@ EOF
72
72
  s.add_dependency "terminal-table", "~> 1.4"
73
73
  s.add_dependency "millisami-csv-hash"
74
74
  s.add_dependency "awesome_print"
75
-
75
+ s.add_dependency "rubyzip"
76
+
76
77
  s.add_development_dependency 'pry'
77
78
  s.add_development_dependency 'pry-nav'
78
79
  s.add_development_dependency "aruba"
@@ -153,6 +153,8 @@ module Cf # :nodoc: all
153
153
  end
154
154
 
155
155
  #### zipping csv file
156
+ say("CSV file size is greater than 2 MB. Aborting production start.", :red) and return if (File.size(input_data_file).to_f/(1024*1000) > 2)
157
+ say("Zipping csv file...", :green)
156
158
  zipfile_name = "input/input.zip"
157
159
  Zip::ZipFile.open(zipfile_name, Zip::ZipFile::CREATE) do |zipfile|
158
160
  begin
@@ -180,11 +182,10 @@ module Cf # :nodoc: all
180
182
  run = CF::Run.create(line_title, run_title, zipfile_name, gold_standards)
181
183
  if run.errors.blank?
182
184
  display_success_run(run)
183
- ## remove the input.csv file from the zip file so that next time when production run is started it wont conflict
184
- Zip::ZipFile.open(zipfile_name, Zip::ZipFile::CREATE) {
185
- |zipfile|
186
- zipfile.remove("input.csv")
187
- }
185
+ ## remove the input/input.zip file so that next time when production run is started it wont conflict
186
+ if File.exist?(zipfile_name) then
187
+ FileUtils.rm_rf zipfile_name
188
+ end
188
189
  else
189
190
  say("Error: #{run.errors}", :red)
190
191
  end
data/lib/cf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CF # :nodoc: all
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
data/spec/station_spec.rb CHANGED
@@ -80,7 +80,7 @@ describe CF::Station do
80
80
  end
81
81
  line.stations.first.type.should eq("TournamentStation")
82
82
  line.stations.first.jury_worker.should eql({"max_judges"=>10, "tournament_restarts"=>0, "number"=>2})
83
- line.stations.first.auto_judge.should eql({"enabled"=>true, "finalize_percentage"=>51})
83
+ line.stations.first.auto_judge.should eql({"enabled"=>true})
84
84
  line.stations.first.worker.number.should eql(3)
85
85
  line.stations.first.worker.reward.should eql(20)
86
86
  line.stations.first.form.title.should eq("Enter text from a business card image")
@@ -27,7 +27,7 @@ module CF
27
27
  run = CF::Run.create(line, "text_appending_robot_run", [{"Company"=>"Sprout","Website"=>"www.sprout.com"}])
28
28
  # debugger
29
29
  line.stations.last.worker.class.should eql(CF::RobotWorker)
30
- line.stations.first.worker.reward.should eql(20)
30
+ line.stations.first.worker.reward.should eql("20")
31
31
  line.stations.first.worker.number.should eql(1)
32
32
  line.stations.last.worker.settings.should eql({:append => ["{{description}}"], :separator => "||"})
33
33
  line.stations.last.worker.type.should eql("TextAppendingRobot")
@@ -68,7 +68,7 @@ module CF
68
68
  # debugger
69
69
 
70
70
  line.stations.last.worker.class.should eql(CF::RobotWorker)
71
- line.stations.first.worker.reward.should eql(20)
71
+ line.stations.first.worker.reward.should eql("20")
72
72
  line.stations.first.worker.number.should eql(1)
73
73
  line.stations.last.worker.settings.should eql({:append => ["{{description}}"], :separator => "||"})
74
74
  line.stations.last.worker.type.should eql("TextAppendingRobot")
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.5.3
4
+ version: 0.5.4
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: 2012-03-16 00:00:00.000000000 Z
12
+ date: 2012-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
16
- requirement: &2158616800 !ruby/object:Gem::Requirement
16
+ requirement: &2162539380 !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: *2158616800
24
+ version_requirements: *2162539380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &2158616300 !ruby/object:Gem::Requirement
27
+ requirement: &2162538880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2158616300
35
+ version_requirements: *2162538880
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hashie
38
- requirement: &2158638060 !ruby/object:Gem::Requirement
38
+ requirement: &2162538200 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2158638060
46
+ version_requirements: *2162538200
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rest-client
49
- requirement: &2158637680 !ruby/object:Gem::Requirement
49
+ requirement: &2162537640 !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: *2158637680
57
+ version_requirements: *2162537640
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: json
60
- requirement: &2158637220 !ruby/object:Gem::Requirement
60
+ requirement: &2162537040 !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: *2158637220
68
+ version_requirements: *2162537040
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thor
71
- requirement: &2158636720 !ruby/object:Gem::Requirement
71
+ requirement: &2162536500 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0.14'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2158636720
79
+ version_requirements: *2162536500
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: highline
82
- requirement: &2158636280 !ruby/object:Gem::Requirement
82
+ requirement: &2162535960 !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: *2158636280
90
+ version_requirements: *2162535960
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: httparty
93
- requirement: &2158635700 !ruby/object:Gem::Requirement
93
+ requirement: &2162535180 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0.7'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *2158635700
101
+ version_requirements: *2162535180
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: terminal-table
104
- requirement: &2158635060 !ruby/object:Gem::Requirement
104
+ requirement: &2162534520 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '1.4'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *2158635060
112
+ version_requirements: *2162534520
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: millisami-csv-hash
115
- requirement: &2158634540 !ruby/object:Gem::Requirement
115
+ requirement: &2162534100 !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: *2158634540
123
+ version_requirements: *2162534100
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: awesome_print
126
- requirement: &2158633740 !ruby/object:Gem::Requirement
126
+ requirement: &2162533600 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,21 @@ dependencies:
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *2158633740
134
+ version_requirements: *2162533600
135
+ - !ruby/object:Gem::Dependency
136
+ name: rubyzip
137
+ requirement: &2162533040 !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ type: :runtime
144
+ prerelease: false
145
+ version_requirements: *2162533040
135
146
  - !ruby/object:Gem::Dependency
136
147
  name: pry
137
- requirement: &2158633220 !ruby/object:Gem::Requirement
148
+ requirement: &2162532520 !ruby/object:Gem::Requirement
138
149
  none: false
139
150
  requirements:
140
151
  - - ! '>='
@@ -142,10 +153,10 @@ dependencies:
142
153
  version: '0'
143
154
  type: :development
144
155
  prerelease: false
145
- version_requirements: *2158633220
156
+ version_requirements: *2162532520
146
157
  - !ruby/object:Gem::Dependency
147
158
  name: pry-nav
148
- requirement: &2158632800 !ruby/object:Gem::Requirement
159
+ requirement: &2162531860 !ruby/object:Gem::Requirement
149
160
  none: false
150
161
  requirements:
151
162
  - - ! '>='
@@ -153,10 +164,10 @@ dependencies:
153
164
  version: '0'
154
165
  type: :development
155
166
  prerelease: false
156
- version_requirements: *2158632800
167
+ version_requirements: *2162531860
157
168
  - !ruby/object:Gem::Dependency
158
169
  name: aruba
159
- requirement: &2158631960 !ruby/object:Gem::Requirement
170
+ requirement: &2162547620 !ruby/object:Gem::Requirement
160
171
  none: false
161
172
  requirements:
162
173
  - - ! '>='
@@ -164,10 +175,10 @@ dependencies:
164
175
  version: '0'
165
176
  type: :development
166
177
  prerelease: false
167
- version_requirements: *2158631960
178
+ version_requirements: *2162547620
168
179
  - !ruby/object:Gem::Dependency
169
180
  name: rails
170
- requirement: &2158630980 !ruby/object:Gem::Requirement
181
+ requirement: &2162547120 !ruby/object:Gem::Requirement
171
182
  none: false
172
183
  requirements:
173
184
  - - ~>
@@ -175,10 +186,10 @@ dependencies:
175
186
  version: 3.0.3
176
187
  type: :development
177
188
  prerelease: false
178
- version_requirements: *2158630980
189
+ version_requirements: *2162547120
179
190
  - !ruby/object:Gem::Dependency
180
191
  name: bundler
181
- requirement: &2158630080 !ruby/object:Gem::Requirement
192
+ requirement: &2162546660 !ruby/object:Gem::Requirement
182
193
  none: false
183
194
  requirements:
184
195
  - - ! '>='
@@ -186,10 +197,10 @@ dependencies:
186
197
  version: '0'
187
198
  type: :development
188
199
  prerelease: false
189
- version_requirements: *2158630080
200
+ version_requirements: *2162546660
190
201
  - !ruby/object:Gem::Dependency
191
202
  name: generator_spec
192
- requirement: &2158645680 !ruby/object:Gem::Requirement
203
+ requirement: &2162545820 !ruby/object:Gem::Requirement
193
204
  none: false
194
205
  requirements:
195
206
  - - ~>
@@ -197,10 +208,10 @@ dependencies:
197
208
  version: '0.8'
198
209
  type: :development
199
210
  prerelease: false
200
- version_requirements: *2158645680
211
+ version_requirements: *2162545820
201
212
  - !ruby/object:Gem::Dependency
202
213
  name: rspec
203
- requirement: &2158645260 !ruby/object:Gem::Requirement
214
+ requirement: &2162545220 !ruby/object:Gem::Requirement
204
215
  none: false
205
216
  requirements:
206
217
  - - ! '>='
@@ -208,10 +219,10 @@ dependencies:
208
219
  version: '0'
209
220
  type: :development
210
221
  prerelease: false
211
- version_requirements: *2158645260
222
+ version_requirements: *2162545220
212
223
  - !ruby/object:Gem::Dependency
213
224
  name: cucumber
214
- requirement: &2158644620 !ruby/object:Gem::Requirement
225
+ requirement: &2162544500 !ruby/object:Gem::Requirement
215
226
  none: false
216
227
  requirements:
217
228
  - - ! '>='
@@ -219,10 +230,10 @@ dependencies:
219
230
  version: '0'
220
231
  type: :development
221
232
  prerelease: false
222
- version_requirements: *2158644620
233
+ version_requirements: *2162544500
223
234
  - !ruby/object:Gem::Dependency
224
235
  name: rdoc
225
- requirement: &2158643900 !ruby/object:Gem::Requirement
236
+ requirement: &2162543780 !ruby/object:Gem::Requirement
226
237
  none: false
227
238
  requirements:
228
239
  - - ~>
@@ -230,10 +241,10 @@ dependencies:
230
241
  version: 3.5.3
231
242
  type: :development
232
243
  prerelease: false
233
- version_requirements: *2158643900
244
+ version_requirements: *2162543780
234
245
  - !ruby/object:Gem::Dependency
235
246
  name: vcr
236
- requirement: &2158643220 !ruby/object:Gem::Requirement
247
+ requirement: &2162543160 !ruby/object:Gem::Requirement
237
248
  none: false
238
249
  requirements:
239
250
  - - ! '>='
@@ -241,10 +252,10 @@ dependencies:
241
252
  version: '0'
242
253
  type: :development
243
254
  prerelease: false
244
- version_requirements: *2158643220
255
+ version_requirements: *2162543160
245
256
  - !ruby/object:Gem::Dependency
246
257
  name: rake
247
- requirement: &2158642560 !ruby/object:Gem::Requirement
258
+ requirement: &2162542500 !ruby/object:Gem::Requirement
248
259
  none: false
249
260
  requirements:
250
261
  - - ! '>='
@@ -252,10 +263,10 @@ dependencies:
252
263
  version: '0'
253
264
  type: :development
254
265
  prerelease: false
255
- version_requirements: *2158642560
266
+ version_requirements: *2162542500
256
267
  - !ruby/object:Gem::Dependency
257
268
  name: webmock
258
- requirement: &2158641900 !ruby/object:Gem::Requirement
269
+ requirement: &2162542080 !ruby/object:Gem::Requirement
259
270
  none: false
260
271
  requirements:
261
272
  - - ! '>='
@@ -263,10 +274,10 @@ dependencies:
263
274
  version: '0'
264
275
  type: :development
265
276
  prerelease: false
266
- version_requirements: *2158641900
277
+ version_requirements: *2162542080
267
278
  - !ruby/object:Gem::Dependency
268
279
  name: timecop
269
- requirement: &2158641340 !ruby/object:Gem::Requirement
280
+ requirement: &2162541640 !ruby/object:Gem::Requirement
270
281
  none: false
271
282
  requirements:
272
283
  - - ! '>='
@@ -274,7 +285,7 @@ dependencies:
274
285
  version: '0'
275
286
  type: :development
276
287
  prerelease: false
277
- version_requirements: *2158641340
288
+ version_requirements: *2162541640
278
289
  description: A Ruby wrapper and CLI for to interact with Cloudfactory.com REST API
279
290
  email:
280
291
  - administrator@sprout-technology.com
@@ -470,4 +481,3 @@ test_files:
470
481
  - spec/term_extraction_robot_spec.rb
471
482
  - spec/test_run_spec.rb
472
483
  - spec/text_appending_robot_spec.rb
473
- has_rdoc: