lib/git-fyncy/synchronizer.rb
def listen
      daemonize if @background
      @logger.log "GIT FYNCY: Listening @ #{Time.now.ctime}"
      relpath = method :relative_path
      files_to_remove = Set.new
      begin
        Listen.to!('.') do |modified, added, removed|
          begin
            self.sync
            rel_removed = removed.map(&relpath)
            files_to_remove.merge rel_removed
            files_to_remove.clear if @remote.rm files_to_remove
          rescue => e
            @logger.log e.inspect
          end
        end
      rescue SignalException
        exit 42
      ensure
        @logger.log "\n"
      end
    end
# Listen to file changes, forking to the background first if background is
# true.
Listen to file changes, forking to the background first if background is
true.
Listen to file changes forking to the background first if background is true .
def listen
      daemonize if @background
      @logger.log "GIT FYNCY: Listening @ #{Time.now.ctime}"
      relpath = method :relative_path
      files_to_remove = Set.new
      begin
        Listen.to!('.') do |modified, added, removed|
          begin
            self.sync
            rel_removed = removed.map(&relpath)
            files_to_remove.merge rel_removed
            files_to_remove.clear if @remote.rm files_to_remove
          rescue => e
            @logger.log e.inspect
          end
        end
      rescue SignalException
        exit 42
      ensure
        @logger.log "\n"
      end
    end
def listen daemonize if @background @logger . log "GIT FYNCY: Listening @ #{Time.now.ctime}" relpath = method :relative_path files_to_remove = Set . new begin Listen . to! ( '.' ) do | modified , added , removed | begin self . sync rel_removed = removed . map ( & relpath ) files_to_remove . merge rel_removed files_to_remove . clear if @remote . rm files_to_remove rescue => e @logger . log e . inspect end end rescue SignalException exit 42 ensure @logger . log "\n" end end
Listen to file changes, forking to the background first if background is
true.
Listen to file changes forking to the background first if background is true .