Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PDOC-283) Use AST to determine dyna_symbols #206

Merged
merged 1 commit into from
Jul 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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