reconfiguring-sinatra-watcher.rb 417 Bytes
Newer Older
1 2
#!/usr/bin/env ruby

3 4
require File.join(File.dirname(__FILE__), '..','lib','noah','custom_watcher')
require 'em-http-request'
5

6
class HttpPostWatch < Noah::CustomWatcher
7
  redis_host "redis://127.0.0.1:6379/0"
8
  pattern "//noah/configuration/redis_server"
9
  destination Proc.new {|x| ::EM::HttpRequest.new('http://localhost:4567/webhook', :connection_timeout => 2, :inactivity_timeout => 4).post :body => x}
10 11
  run!
end