dev 1.0.235 → 1.0.236
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dev/SystemCall.rb +17 -3
- metadata +1 -1
data/lib/dev/SystemCall.rb
CHANGED
@@ -238,19 +238,33 @@ class SystemCall
|
|
238
238
|
db = SQLite3::Database.new filename
|
239
239
|
@timeout=0 if @timeout.nil?
|
240
240
|
@dir=Rake.original_dir() if(@dir.nil?)
|
241
|
-
values = "VALUES('" + @start_time.strftime('%Y-%m-%dT%H:%M:%S') +
|
241
|
+
values = "VALUES(null,'" + @start_time.strftime('%Y-%m-%dT%H:%M:%S') +
|
242
242
|
"','" + @end_time.strftime('%Y-%m-%dT%H:%M:%S') +
|
243
243
|
"','" + Time.at(elapsed).gmtime.strftime('%H:%M:%S') +
|
244
244
|
"'," + @status.to_s +
|
245
245
|
",'" + cmd + #@command.gsub("'","''") +
|
246
246
|
"','" + arguments +
|
247
247
|
"','" + @dir.to_s +
|
248
|
-
"','" + @output.gsub("'", "''") +
|
249
|
-
"','" + @error.gsub("'", "''") +
|
248
|
+
#"','" + @output.gsub("'", "''") +
|
249
|
+
#"','" + @error.gsub("'", "''") +
|
250
250
|
"','" + executable +
|
251
251
|
"'," + @timeout.to_s + ")"
|
252
252
|
sql="insert into Commands #{values};"
|
253
253
|
db.execute(sql)
|
254
|
+
if(@status != 0)
|
255
|
+
id=nil
|
256
|
+
db.execute("select * from Commands where startTime='" +
|
257
|
+
@start_time.strftime('%Y-%m-%dT%H:%M:%S') +
|
258
|
+
"' AND exitCode=" + @status.to_s + ";") do |row|
|
259
|
+
id=row[0]
|
260
|
+
end
|
261
|
+
if(!id.nil?)
|
262
|
+
sql="insert or replace INTO Output VALUES(" + id.to_s +
|
263
|
+
",'" + @output.gsub("'","''") +
|
264
|
+
"','" + @error.gsub("'","''") + "')";
|
265
|
+
db.execute(sql)
|
266
|
+
end
|
267
|
+
end
|
254
268
|
db.close
|
255
269
|
db=nil
|
256
270
|
rescue
|