mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Fix CodeRay 1.0.0 compatbility
This commit is contained in:
parent
0dbefe1b12
commit
96f2f555ce
1 changed files with 3 additions and 1 deletions
|
@ -379,7 +379,9 @@ class Pry
|
|||
def method_name_from_first_line(first_ln)
|
||||
return nil if first_ln.strip !~ /^def /
|
||||
|
||||
CodeRay.scan(first_ln, :ruby).each_cons(2) do |t1, t2|
|
||||
tokens = CodeRay.scan(first_ln, :ruby)
|
||||
tokens = tokens.tokens.each_slice(2) if tokens.respond_to?(:tokens)
|
||||
tokens.each_cons(2) do |t1, t2|
|
||||
if t2.last == :method || t2.last == :ident && t1 == [".", :operator]
|
||||
return t2.first
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue