slackoff 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/slackoff.rb +31 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7283d29b3f2f7fc735ebb719ed0f4838df32dd58
4
+ data.tar.gz: 7f142f4c5083c3f985c0fbe6ae845af5ba9f7526
5
+ SHA512:
6
+ metadata.gz: 639a3047a14aa39d7bc5f8e65eeed21c7ecb377a3e8244e5c4a5ef9f55631b99a2f093949feb3fe82cc1bb431476c384a8b56f6e43c964178712e02674a0d7b3
7
+ data.tar.gz: ae5d6d5ab17f9b103febdd8304028df330978837313930f0f6b15ded01f2ac6b8f74d8002df66003a11309f879cb1d4c021d02bf45d207996890aa7a5ca9a007
data/lib/slackoff.rb ADDED
@@ -0,0 +1,31 @@
1
+ require 'net/http'
2
+ require 'json'
3
+ ##
4
+ # Represents a single slack instance.
5
+ module Slackoff
6
+ class Slack
7
+ def incoming_webhook(url)
8
+ uri = URI(url)
9
+ connection = Slackoff::HTTPS.new(uri)
10
+ connection
11
+ end
12
+ end
13
+
14
+ class HTTPS
15
+ # URI should already be encoded as a ruby URI
16
+ def initialize(uri)
17
+ @uri = uri
18
+ end
19
+
20
+ # body is a hash of data
21
+ def send(body)
22
+ http = Net::HTTP.new(@uri.host, @uri.port)
23
+ http.use_ssl = true
24
+
25
+ request = Net::HTTP::Post.new(@uri.request_uri)
26
+ request.body = body.to_json
27
+ response = http.request request
28
+ return response
29
+ end
30
+ end
31
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slackoff
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Cody Poll
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A gem for interacting with slack
14
+ email: CJPoll@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/slackoff.rb
20
+ homepage: http://github.com/cjpoll/slackoff
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.2.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: A gem for interacting with slack
44
+ test_files: []
45
+ has_rdoc: