lib/slackistrano.rb in slackistrano-1.0.0 vs lib/slackistrano.rb in slackistrano-1.1.0
- old
+ new
@@ -14,12 +14,12 @@
post_as_slackbot(team: team, token: token, webhook: webhook, payload: payload)
else
post_as_webhook(team: team, token: token, webhook: webhook, payload: payload)
end
rescue => e
- puts "There was an error notifying Slack."
- puts e.inspect
+ error("[slackistrano] Error notifying Slack!")
+ error("[slackistrano] Error: #{e.inspect}")
end
#
#
#
@@ -27,11 +27,11 @@
uri = URI(URI.encode("https://#{team}.slack.com/services/hooks/slackbot?token=#{token}&channel=#{payload[:channel]}"))
text = payload[:attachments].collect { |a| a[:text] }.join("\n")
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
- http.request_post uri.request_uri, text
+ http.request_post uri, text
end
end
#
#
@@ -46,8 +46,6 @@
uri = URI(webhook)
Net::HTTP.post_form(uri, params)
end
-
end
-