Skip to content

Commit

Permalink
Fix comment_lines regexp
Browse files Browse the repository at this point in the history
The previous regexp was likely a typo, and it prevented lines which
begin with a pipe ("|") from being commented out.
  • Loading branch information
jonathanhefner committed May 9, 2018
1 parent f0b510c commit ddd5251
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/thor/actions/file_manipulation.rb
Expand Up @@ -307,7 +307,7 @@ def uncomment_lines(path, flag, *args)
def comment_lines(path, flag, *args)
flag = flag.respond_to?(:source) ? flag.source : flag

gsub_file(path, /^(\s*)([^#|\n]*#{flag})/, '\1# \2', *args)
gsub_file(path, /^(\s*)([^#\n]*#{flag})/, '\1# \2', *args)
end

# Removes a file at the given location.
Expand Down

0 comments on commit ddd5251

Please sign in to comment.