Skip to content

Commit ddd5251

Browse files
Fix comment_lines regexp
The previous regexp was likely a typo, and it prevented lines which begin with a pipe ("|") from being commented out.
1 parent f0b510c commit ddd5251

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/thor/actions/file_manipulation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def uncomment_lines(path, flag, *args)
307307
def comment_lines(path, flag, *args)
308308
flag = flag.respond_to?(:source) ? flag.source : flag
309309

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

313313
# Removes a file at the given location.

0 commit comments

Comments
 (0)