diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 11:44:16 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 12:41:14 -0700 |
commit | 7bf98ad06b30b7feb4ea3fbbe45a5b733467a5d3 (patch) | |
tree | b0995ded1a63654d3f54140bd880c69f86afd52f /lib/chef/resource/windows_task.rb | |
parent | 9802d7c075c8b7dae42dbcecd92d492f7fa128ac (diff) | |
download | chef-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/resource/windows_task.rb')
-rw-r--r-- | lib/chef/resource/windows_task.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/resource/windows_task.rb b/lib/chef/resource/windows_task.rb index 0ce5bf2031..6220400069 100644 --- a/lib/chef/resource/windows_task.rb +++ b/lib/chef/resource/windows_task.rb @@ -31,7 +31,7 @@ class Chef allowed_actions :create, :delete, :run, :end, :enable, :disable, :change default_action :create - property :task_name, String, regex: [/\A[^\/\:\*\?\<\>\|]+\z/], + property :task_name, String, regex: [%r{\A[^/\:\*\?\<\>\|]+\z}], description: "An optional property to set the task name if it differs from the resource block's name. Example: 'Task Name' or '/Task Name'", name_property: true @@ -216,7 +216,7 @@ class Chef # make sure the start_day is in MM/DD/YYYY format: http://rubular.com/r/cgjHemtWl5 if start_day - raise ArgumentError, "`start_day` property must be in the MM/DD/YYYY format." unless /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)\d\d$/ =~ start_day + raise ArgumentError, "`start_day` property must be in the MM/DD/YYYY format." unless %r{^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$} =~ start_day end end |