summaryrefslogtreecommitdiff
path: root/lib/chef/mixin/unformatter.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-10-26 11:51:28 -0700
committerTim Smith <tsmith84@gmail.com>2020-10-26 11:51:28 -0700
commit8837ebfda2a4292976d44ec564f349f357349fc1 (patch)
tree765d2e98a4c0bead2030f411f07613207e5070b5 /lib/chef/mixin/unformatter.rb
parent4d13c5acaa8596eab50b7d62252a6d94ab290d61 (diff)
downloadchef-simplify_regex.tar.gz
Simplify some regexes by removing redundant character classessimplify_regex
New RuboCop here. There's no need for character classes when all we have is a single character. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/mixin/unformatter.rb')
-rw-r--r--lib/chef/mixin/unformatter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/mixin/unformatter.rb b/lib/chef/mixin/unformatter.rb
index fbe1bdccb4..c233549b17 100644
--- a/lib/chef/mixin/unformatter.rb
+++ b/lib/chef/mixin/unformatter.rb
@@ -21,7 +21,7 @@ class Chef
module Unformatter
def write(message)
- data = message.match(/(\[.+?\] )?([\w]+):(.*)$/)
+ data = message.match(/(\[.+?\] )?(\w+):(.*)$/)
send(data[2].downcase.chomp.to_sym, data[3].strip)
rescue NoMethodError
send(:info, message)