Sha256: f88290ab2d9ceda923ddce152508c83961f835fbee05f869b6484f1ddc8050b4

Contents?: true

Size: 395 Bytes

Versions: 3

Compression:

Stored size: 395 Bytes

Contents

require 'rib'

module Rib; module Beep
  extend Plugin
  Shell.use(self)

  # --------------- Rib API ---------------

  def before_loop
    super
    return self if Beep.disabled?
    beep if started_at && (Time.now - started_at) > beep_threshold
    Beep.disable
    self
  end

  private
  def beep
    print "\a"
  end

  def beep_threshold
    config[:beep_threshold] ||= 5
  end
end; end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rib-1.5.4 lib/rib/more/beep.rb
rib-1.5.3 lib/rib/more/beep.rb
rib-1.5.2 lib/rib/more/beep.rb