From 9b971a15c0d7493d8daf8e61dce2ce8b04230b16 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 15 Jun 2009 00:08:25 -0400 Subject: [PATCH] Require English so we can use $LAST_MATCH_INFO instead of $~ --- lib/webrat/core/elements/link.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/webrat/core/elements/link.rb b/lib/webrat/core/elements/link.rb index 0edf8d4..66395f5 100644 --- a/lib/webrat/core/elements/link.rb +++ b/lib/webrat/core/elements/link.rb @@ -1,5 +1,6 @@ -require "webrat/core_extensions/blank" +require "English" +require "webrat/core_extensions/blank" require "webrat/core/elements/element" module Webrat @@ -53,7 +54,7 @@ module Webrat def authenticity_token return unless onclick && onclick.include?("s.setAttribute('name', 'authenticity_token');") && onclick =~ /s\.setAttribute\('value', '([a-f0-9]{40})'\);/ - $~.captures.first + $LAST_MATCH_INFO.captures.first end def onclick