New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MatchData#named_captures: NoMethodError: undefined method `named_captures' #1512

Closed
deepj opened this Issue Dec 7, 2018 · 2 comments

Comments

2 participants
@deepj
Copy link

deepj commented Dec 7, 2018

MatchData#named_captures is available since Ruby 2.4. See https://github.com/ruby/ruby/blob/v2_4_0/NEWS

To reproduce:

/(?<fname>.+) (?<lname>.+)/.match('John Doe').named_captures

Error

NoMethodError: undefined method `named_captures' for #<MatchData "John Doe" fname:"John" lname:"Doe">:MatchData
	from (irb):11
	from ~/.rubies/truffleruby-1.0.0-rc10/bin/irb:29:in `<main>'

@nirvdrum nirvdrum self-assigned this Dec 10, 2018

@nirvdrum nirvdrum added this to the 1.0.0-rc11 milestone Dec 11, 2018

@nirvdrum

This comment has been minimized.

Copy link
Member

nirvdrum commented Dec 11, 2018

Thanks for bug report. This was added in 82b3f94.

@nirvdrum nirvdrum closed this Dec 11, 2018

@nirvdrum

This comment has been minimized.

Copy link
Member

nirvdrum commented Jan 15, 2019

@deepj We released 1.0.0 RC 11 earlier today, which should include a fix for this issue. Please comment here if you see otherwise. Thanks again for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment