Module: Slackistrano

Defined in:
lib/slackistrano.rb,
lib/slackistrano/version.rb

Constant Summary collapse

VERSION =
'0.0.10'

Class Method Summary collapse

Class Method Details

.post(team: nil, token: nil, payload: {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/slackistrano.rb', line 8

def self.post(team: nil, token: nil, payload: {})
  uri = URI("https://#{team}.slack.com/services/hooks/incoming-webhook")
  res = Net::HTTP.post_form(uri, 'token' => token, 'payload' => payload.to_json)
rescue => e
  puts "There was an error notifying Slack."
  puts e.inspect
end