Skip to content

Commit

Permalink
Require English so we can use $LAST_MATCH_INFO instead of $~
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Jun 15, 2009
1 parent 6720bbb commit 9b971a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 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
Expand Down Expand Up @@ -53,7 +54,7 @@ def absolute_href
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
Expand Down

0 comments on commit 9b971a1

Please sign in to comment.