Skip to content

Instantly share code, notes, and snippets.

@xrl
Created October 27, 2015 21:55
Show Gist options
  • Save xrl/82e68db6537b5fcdbfa8 to your computer and use it in GitHub Desktop.
Save xrl/82e68db6537b5fcdbfa8 to your computer and use it in GitHub Desktop.
Poor man's diff utility
require 'pp'
here = Dir.glob("logstash/conf.d/*")
there = Dir.glob("../cookbooks/cookbooks/forwarder/templates/default/elasticsearch/*.erb")
pp here.collect{|h| h = h.split("/").last; match = there.select{|t| t.include?(h); }; [h,match] }.collect{|h,t| "diff logstash/conf.d/#{h} #{t.first}"}.each{|x| puts x; system(x)}; nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment