Skip to content

(PDOC-126) Remove %Q ruby quotation syntax from parsed strings #118

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

Merged
merged 2 commits into from
Oct 28, 2016

Conversation

whopper
Copy link
Contributor

@whopper whopper commented Oct 26, 2016

Previously, YARD would parse ruby strings which used %Q notation
and return the syntax literally. This commit adds a new Util
module with a scrub_string method to check for such a string
and remove the errant %Q and %q's.

# @param [String] str The string to scrub.
# @return [String] A scrubbed string.
def self.scrub_string(str)
match = str.match(/^%[Qq]{(.*)}/m)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add the end of string anchor to this regex

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scotje fixed!

Previously, YARD would parse ruby strings which used %Q notation
and return the syntax literally. This commit adds a new Util
module with a `scrub_string` method to check for such a string
and remove the errant %Q and %q's.
@whopper whopper force-pushed the PDOC-126/master/ruby_quotes branch from 368465d to c4705d9 Compare October 28, 2016 18:54
@scotje scotje merged commit b8970b4 into puppetlabs:master Oct 28, 2016
@eputnam eputnam added the bugfix label Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants