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.
- checksums.yaml +4 -4
- data/lib/iNotifyou.rb +19 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f29e8206d063aeb4e5edb1657fed449631e068b
|
4
|
+
data.tar.gz: 46cf8ea8d06d67c9d92b04184eaef90410d62b68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
3
|
-
|
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.
|
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:
|
43
|
+
summary: Just a simple gem, post message to Slack
|
44
44
|
test_files: []
|