Skip to content

Commit 2cfd959

Browse files
author
Nuo Yan
committed
initial work (updated) chef-78
1 parent 194de95 commit 2cfd959

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

chef/lib/chef/util/FileEdit.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ def write_file
7070
private
7171

7272
#helper method to search_file_replace_delete_line, search_file_replace_delete, and insert_line_after_match
73+
#command is the switch of delete, replace, and insert ('d', 'r', 'i')
74+
#method is to control operation on whole line or only the match (1 for line, 2 for match)
7375
def search_match(regex, replace, command, method)
74-
75-
raise ArgumentError, "command should be 'r' or 'd'" unless (command == 'r' or command == 'd' or command == 'i')
7676

7777
#check if regex is Regexp object or simple string and store the Regexp object in exp.
7878
(regex.kind_of? Regexp)? exp = regex : exp = Regexp.new(regex)

0 commit comments

Comments
 (0)