Regex matching calling method
Want to capture the calling method? Plus three different methods of extracting the match.
2.2.6 :009 > c = caller(1..1).first
=> "/Users/roblacey/repos/something/blah.rb:192:in `pages'"
# scan(pattern) → array
2.2.6 :014 > c.scan(/`([^']*)'$/).join
=> "pages"
# match(pattern) → matchdata or nil
2.2.6 :015 > c.match(/`([^']*)'$/).try(:[], 1)
=> "pages"
# str[regexp, capture]
2.2.6 :017 > c[/`([^']*)'$/, 1]
=> "pages"