diff options
author | Travis Fields <travis@puppetlabs.com> | 2015-04-09 11:02:29 -0700 |
---|---|---|
committer | Bryan Jen <bryan.jen@gmail.com> | 2015-04-09 15:24:39 -0700 |
commit | 0af0d7e5392a69f0ed72fa1b0225fe2a61188319 (patch) | |
tree | 19ab3a403a96a665927b66052bdd43348f99f779 /lib/puppet | |
parent | 35303ce0f7cf66feb7499d9671a7d2121a0f52b1 (diff) |
Add spec tests and pulled in PR #427
Changed append line to open in 'w' mode and have to rewrite lines in order to append new line
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/provider/file_line/ruby.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/provider/file_line/ruby.rb b/lib/puppet/provider/file_line/ruby.rb index a1acab8..e7854f0 100644 --- a/lib/puppet/provider/file_line/ruby.rb +++ b/lib/puppet/provider/file_line/ruby.rb @@ -87,7 +87,10 @@ Puppet::Type.type(:file_line).provide(:ruby) do # # @api private def append_line - File.open(resource[:path], 'a') do |fh| + File.open(resource[:path], 'w') do |fh| + lines.each do |l| + fh.puts(l) + end fh.puts resource[:line] end end |