Skip to content

Commit

Permalink
Fix tests for Ruby <2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lsegal committed Jun 27, 2019
1 parent 593973c commit 9716717
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/yard/handlers/ruby/alias_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9716717

Please sign in to comment.