require 'guard/compat/plugin'
module ::Guard
class RubyHtmlSyntaxFixer < Plugin
def run_on_modifications(paths)
paths.each do |path|
text = File.read(path)
text.gsub!('replace text', 'with something cool')
File.open(path, 'w') {|file| file.puts text }
end
end
end
end
guard 'ruby_html_syntax_fixer' do
watch(%r{app/views/.+\.(erb|haml|slim)})
end