summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-05 11:44:16 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-05 12:41:14 -0700
commit7bf98ad06b30b7feb4ea3fbbe45a5b733467a5d3 (patch)
treeb0995ded1a63654d3f54140bd880c69f86afd52f /lib/chef/mixin
parent9802d7c075c8b7dae42dbcecd92d492f7fa128ac (diff)
downloadchef-7bf98ad06b30b7feb4ea3fbbe45a5b733467a5d3.tar.gz
Style/RegexpLiteral
given how many regexps we have with /'s in the match this seems like a very good one. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r--lib/chef/mixin/convert_to_class_name.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/mixin/convert_to_class_name.rb b/lib/chef/mixin/convert_to_class_name.rb
index a65fa87655..c5944c3985 100644
--- a/lib/chef/mixin/convert_to_class_name.rb
+++ b/lib/chef/mixin/convert_to_class_name.rb
@@ -25,7 +25,7 @@ class Chef
def convert_to_class_name(str)
str = normalize_snake_case_name(str)
rname = nil
- regexp = %r{^(.+?)(_(.+))?$}
+ regexp = /^(.+?)(_(.+))?$/
mn = str.match(regexp)
if mn