Method: Puffy::Puppet#diff
- Defined in:
- lib/puffy/puppet.rb
#diff ⇒ void
This method returns an undefined value.
Show differences between saved and generated rules
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/puffy/puppet.rb', line 39 def diff each_fragment do |fragment_name, fragment_content| human_fragment_name = fragment_name.delete_prefix(@path).delete_prefix('/') IO.popen("diff -u1 -N --unidirectional-new-file --ignore-matching-lines='^#' --label a/#{human_fragment_name} #{fragment_name} --label b/#{human_fragment_name} -", 'r+') do |io| io.write(fragment_content) io.close_write out = io.read $stdout.write out end end end |