Module: Herald::Watcher::Notifier::Stdout

Defined in:
lib/herald/notifiers/stdout.rb

Instance Method Summary collapse

Instance Method Details

#notify(item) ⇒ Object

print to $stdout



18
19
20
21
# File 'lib/herald/notifiers/stdout.rb', line 18

def notify(item)
  $stdout.puts item.data.inspect
  $stdout.flush
end

#parse_options(options) ⇒ Object



7
8
9
10
11
12
# File 'lib/herald/notifiers/stdout.rb', line 7

def parse_options(options)
  # option to send stdout to file
  if file = options.delete(:file)
    $stdout = File.new(file, 'w')
  end
end

#testObject

is always working, so true



15
# File 'lib/herald/notifiers/stdout.rb', line 15

def test; true; end