aboutsummaryrefslogtreecommitdiff
path: root/lib/result_event.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/result_event.rb')
-rw-r--r--lib/result_event.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/result_event.rb b/lib/result_event.rb
index 478ccd7..31c807d 100644
--- a/lib/result_event.rb
+++ b/lib/result_event.rb
@@ -20,12 +20,12 @@ class ResultEvent
end
end
- points= -1
+ points= "-1"
result["Result"]["elements"].each do |e|
case e["MIMEtype"]
when "text/plain"
- if (val=e["value"]).strip.start_with?("*** Score:")
- points= val.strip.split(":")[1].to_i
+ if e["value"] =~ /\*\*\*\s*Score:\s*((\d+)\.?(\d*))/
+ points= $~[1]
break
end
end