lib/chamber/file.rb in chamber-2.8.0 vs lib/chamber/file.rb in chamber-2.9.0

- old
+ new

@@ -1,5 +1,6 @@ +# frozen_string_literal: true require 'pathname' require 'yaml' require 'erb' ### @@ -81,10 +82,17 @@ escaped_value = Regexp.escape(value) file_contents. sub!( /^(\s*)_secure_#{escaped_name}(\s*):(\s*)['"]?#{escaped_value}['"]?$/, - "\\1_secure_#{name_pieces.last}\\2:\\3#{secure_value}") + "\\1_secure_#{name_pieces.last}\\2:\\3#{secure_value}", + ) + + file_contents. + sub!( + /^(\s*)_secure_#{escaped_name}(\s*):(\s*)\|((?:\n\1\s{2}.*)+)/, + "\\1_secure_#{name_pieces.last}\\2:\\3#{secure_value}", + ) end write(file_contents) end