Sha256: 87be0ac05ae87a99178ca89dc9250d2c8dd9fb87a5f8c7fc3989cf1e3055f259
Contents?: true
Size: 566 Bytes
Versions: 6
Compression:
Stored size: 566 Bytes
Contents
require "eventmachine" module Mado class FileHandler < EventMachine::FileWatch def initialize(sockets) @sockets = sockets end def file_modified @sockets.each { |socket| socket.send(convert_markdown) } if File.exist?(path) end def file_moved # @sockets.each { |socket| socket.send(convert_markdown) } end def file_deleted @sockets.each { |socket| socket.send(convert_markdown) } if File.exist?(path) end private def convert_markdown Mado::Markdown.convert_markdown(path) end end end
Version data entries
6 entries across 6 versions & 1 rubygems