From ddd5251e5f58550bb4ef2eecb31202c0c0da9b97 Mon Sep 17 00:00:00 2001 From: Jonathan Hefner Date: Wed, 9 May 2018 15:06:44 -0500 Subject: [PATCH] Fix comment_lines regexp The previous regexp was likely a typo, and it prevented lines which begin with a pipe ("|") from being commented out. --- lib/thor/actions/file_manipulation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/thor/actions/file_manipulation.rb b/lib/thor/actions/file_manipulation.rb index 96e8c5be3..98cebf40a 100644 --- a/lib/thor/actions/file_manipulation.rb +++ b/lib/thor/actions/file_manipulation.rb @@ -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.