Sha256: 009a6309492dd42ae7d95a62f0dc0d45429ddd62617906081754054dbfaeec03

Contents?: true

Size: 527 Bytes

Versions: 1

Compression:

Stored size: 527 Bytes

Contents

# -*- mode: ruby -*-
require 'base64'

Populus.config do
  set :slack_webhook, "https://hooks.slack.com/services/XXXXXX"
end

Populus.watch :event, name: "sample" do
  cond {|data| data.any?{|d| !d['Payload'].nil? } }
  runs do |data|
    event = data.find{|d| !d['Payload'].nil? }
    Populus.logger.info "From populus!!!"
    Populus.logger.info Base64.decode64(event['Payload'])

    notify_to_slack(<<-EOF, channel: '#bot_test', username: "Populus")
Hello!!!
Consul event payload:
>>> `#{event.inspect}`"
    EOF
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
populus-0.0.4 examples/echo.popl