]> gitweb.fluxo.info Git - puppet-stdlib.git/commit
(PUP-2571) add 'before' functionality to file_line
authorStephen Benjamin <stephen@bitbin.de>
Wed, 14 May 2014 18:33:57 +0000 (20:33 +0200)
committerStephen Benjamin <stephen@bitbin.de>
Wed, 14 May 2014 18:33:57 +0000 (20:33 +0200)
commit6eaa592cd8d5af097a4624b3d1cead74408aabf2
tree436a27d393345adb11b3d13a349257648b6f0813
parent08b00d9229961d7b3c3cba997bfb35c8d47e4c4b
(PUP-2571) add 'before' functionality to file_line

file_line supports adding lines after a match, but there are use cases when
having "before" would be useful. For example, in Debian-based OS's, the last
line of /etc/rc.local is "exit 0" it's an incredible pain to deal with
that scenario today.

This commit adds a 'before' parameter to the file_line type, and implements
it for the ruby provider.
lib/puppet/provider/file_line/ruby.rb
lib/puppet/type/file_line.rb
spec/unit/puppet/provider/file_line/ruby_spec.rb
spec/unit/puppet/type/file_line_spec.rb