Sha256: 182e93863143bd1ac4b610a251a48454ed3457fb2ebc47bc2133b6522f174234

Contents?: true

Size: 497 Bytes

Versions: 7

Compression:

Stored size: 497 Bytes

Contents

require "guard/jobs/base"

module Guard
  module Jobs
    class Sleep < Base
      def foreground
        ::Guard::UI.debug "Guards jobs done. Sleeping..."
        sleep
        ::Guard::UI.debug "Sleep interrupted by events."
        :stopped
      rescue Interrupt
        ::Guard::UI.debug "Sleep interrupted by user."
        :exit
      end

      def background
        Thread.main.wakeup
      end

      def handle_interrupt
        Thread.main.raise Interrupt
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
guard-2.8.2 lib/guard/jobs/sleep.rb
guard-2.8.1 lib/guard/jobs/sleep.rb
guard-2.8.0 lib/guard/jobs/sleep.rb
guard-2.7.3 lib/guard/jobs/sleep.rb
guard-2.7.2 lib/guard/jobs/sleep.rb
guard-2.7.1 lib/guard/jobs/sleep.rb
guard-2.7.0 lib/guard/jobs/sleep.rb