Skip to content

Commit

Permalink
Merge pull request #206 from glennsarti/pdoc-283-fix-symbols-again
Browse files Browse the repository at this point in the history
(PDOC-283) Use AST to determine dyna_symbols
  • Loading branch information
binford2k committed Jul 2, 2019
2 parents b3b24fe + e224ebb commit 05a519e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/puppet-strings/yard/handlers/ruby/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@ def node_as_string(node)
when :label
node.source[0..-2]
when :dyna_symbol
# YARD 0.9.20 changed how dyna_symbols are represented
# https://github.com/lsegal/yard/commit/225ded9ef38c6d2be5a3b0fc7effbc7d6644768d
if yard_version >= Gem::Version.new('0.9.20')
node.source[2..-2]
else
node.source
end
content = node.jump(:tstring_content)
content.nil? ? node.source : content.source
when :string_literal
content = node.jump(:tstring_content)
return content.source if content != node
Expand Down

0 comments on commit 05a519e

Please sign in to comment.