From 9716717f75e49b6c109a8608701c5b47b4050db3 Mon Sep 17 00:00:00 2001 From: Loren Segal Date: Thu, 27 Jun 2019 15:47:58 -0700 Subject: [PATCH] Fix tests for Ruby <2.6 --- lib/yard/handlers/ruby/alias_handler.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/yard/handlers/ruby/alias_handler.rb b/lib/yard/handlers/ruby/alias_handler.rb index fe07de8f8..965cd86a8 100644 --- a/lib/yard/handlers/ruby/alias_handler.rb +++ b/lib/yard/handlers/ruby/alias_handler.rb @@ -7,14 +7,15 @@ class YARD::Handlers::Ruby::AliasHandler < YARD::Handlers::Ruby::Base process do names = [] if statement.type == :alias - names = statement.map {|o| o.jump(:ident, :op, :kw, :const, :string_content).source } + nodes = [:ident, :op, :kw, :const, :tstring_content, :string_content] + names = statement.map {|o| o.jump(*nodes).source } elsif statement.call? statement.parameters(false).each do |obj| case obj.type when :symbol_literal names << obj.jump(:ident, :op, :kw, :const).source when :string_literal, :dyna_symbol - names << obj.jump(:string_content).source + names << obj.jump(:string_content, :tstring_content).source end end end