Sha256: 881027aed024e62428324cbf1a4d01f723241527b90c601a36d76b597fd70519

Contents?: true

Size: 456 Bytes

Versions: 11

Compression:

Stored size: 456 Bytes

Contents

require 'slackistrano/version'
require 'net/http'
require 'json'

load File.expand_path("../slackistrano/tasks/slack.rake", __FILE__)

module Slackistrano
  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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
slackistrano-0.0.12 lib/slackistrano.rb
slackistrano-0.0.11 lib/slackistrano.rb
slackistrano-0.0.10 lib/slackistrano.rb
slackistrano-0.0.9 lib/slackistrano.rb
slackistrano-0.0.8 lib/slackistrano.rb
slackistrano-0.0.7 lib/slackistrano.rb
slackistrano-0.0.6 lib/slackistrano.rb
slackistrano-0.0.5 lib/slackistrano.rb
slackistrano-0.0.4 lib/slackistrano.rb
slackistrano-0.0.3 lib/slackistrano.rb
slackistrano-0.0.2 lib/slackistrano.rb