class Guard::Herbalizer

Public Instance Methods

run_all() click to toggle source
# File lib/guard/herbalizer.rb, line 17
def run_all
  run_on_changes(Watcher.match_files(self, Dir.glob(File.join('**', '*'))))
end
run_on_changes(paths) click to toggle source
# File lib/guard/herbalizer.rb, line 6
def run_on_changes(paths)
  paths.each do |file|
    destination = file.gsub(/\.haml\Z/, '')
    IO.popen(["herbalizer", file], "r") do |input|
      File.open(destination, 'w') do |output|
        output.write(input.read)
      end
    end
  end
end