lib/cloud_powers/helper.rb in cloud_powers-0.2.1 vs lib/cloud_powers/helper.rb in cloud_powers-0.2.2
- old
+ new
@@ -149,8 +149,17 @@
type: 'status-update',
content: 'running',
extraInfo: updated_extra_info
}.merge(opts)
end
+
+ def valid_json?(json)
+ begin
+ JSON.parse(json)
+ true
+ rescue Exception => e
+ false
+ end
+ end
end
end
end