iNotifyou 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/iNotifyou.rb +19 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3165a6321ab41f03f67029463188ead58da57882
4
- data.tar.gz: 856fe3cfb1cc6572b6fb086c05c5a3698c3d7ea4
3
+ metadata.gz: 9f29e8206d063aeb4e5edb1657fed449631e068b
4
+ data.tar.gz: 46cf8ea8d06d67c9d92b04184eaef90410d62b68
5
5
  SHA512:
6
- metadata.gz: 3ab51c216b926bad781bc9d92bd0ff41379b7d529fc7ad7ad0a91dd6a1e100d175f30cfe9004dfaf5ebe625f0620ba60ee6bd47c4fd06a3196f2f823fd2e6782
7
- data.tar.gz: 0850958a8876e417e5475c99b8d37bc3cf1eb8740f886df75556690afe684110a5b95bccfd28d86cfa3cf207c4b9a48e1563cc87391ca051c772996c23a8ad4e
6
+ metadata.gz: 71abaca41d73b111677d1c959cdef6bdfd4940ff6e9de9fbaa25398554806d110c5f0230d1089004c4b8662e73d14d5849bca7afbf0577c4a72aa33637435cc1
7
+ data.tar.gz: 0a0bbe2a03daf3b2a1ab4317d2d85c6cd4a318dca562b63f0fdd0810d6e6033f5c1631fcac91ac3a4b9a2f3d19d24384c1db6d14e2e50ba3c8d5f1d6eb7745d4
data/lib/iNotifyou.rb CHANGED
@@ -1,5 +1,22 @@
1
+ require 'json'
1
2
  class INotifyou
2
- def self.notify
3
- puts "Hello world!"
3
+ SLACK_URL = 'https://hooks.slack.com/services/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'
4
+
5
+ def initialize url
6
+ @slack_url = url
7
+ end
8
+
9
+ def notify msg, channel
10
+ if @slack_url == ''
11
+ puts "Please enter a valid url"
12
+ return
13
+ end
14
+
15
+ hash = {:text => msg, :channel => channel}
16
+ json = JSON.generate(hash)
17
+ payload = "payload=#{json}"
18
+
19
+ `curl -X POST --data-urlencode '#{payload}' #{@slack_url}`
20
+
4
21
  end
5
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iNotifyou
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiền Vương
@@ -40,5 +40,5 @@ rubyforge_project:
40
40
  rubygems_version: 2.2.2
41
41
  signing_key:
42
42
  specification_version: 4
43
- summary: My iNotify gem
43
+ summary: Just a simple gem, post message to Slack
44
44
  test_files: []