slack_webhooks 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/slack_webhooks/version.rb +1 -1
- data/lib/slack_webhooks.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 540c0909cdf9490eef7ec09dcbe3b0c5ba6a7734
|
4
|
+
data.tar.gz: 9e6b01d7c3b4c97cb7a34bc212ca56ffc7cf7f72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44fb27d5b04b40bbba83b2884d0978c2f6eb9436e8931b8f4b450f484f5964acdbc25219a6b39d2d65cbd529e38e85c8fa2e69be24dc98265e772b91e08c36ca
|
7
|
+
data.tar.gz: 505202361240f3d0156d9813e63ac8e07760be824054583eb613775fff5858c0772aedc609abc18d74d41f263f6ebae683bc928ad147abcc99fe30490baf363b
|
data/lib/slack_webhooks.rb
CHANGED
@@ -48,9 +48,10 @@ module SlackWebhooks
|
|
48
48
|
|
49
49
|
end
|
50
50
|
|
51
|
-
# Takes similar options as send
|
51
|
+
# Takes similar options as send. options can have attachments or whatever
|
52
52
|
def set_usage(text, options={})
|
53
|
-
options[
|
53
|
+
options[:attachments] ||= {}
|
54
|
+
options[:attachments].unshift {'text' => text}
|
54
55
|
self.usage_options = options
|
55
56
|
end
|
56
57
|
|
@@ -68,7 +69,10 @@ module SlackWebhooks
|
|
68
69
|
|
69
70
|
resp = nil
|
70
71
|
attachment = options.delete(:attachment)
|
71
|
-
|
72
|
+
if attachment
|
73
|
+
options[:attachments] ||= []
|
74
|
+
options[:attachments] << attachment
|
75
|
+
end
|
72
76
|
if self.icon_url != nil
|
73
77
|
options[:icon_url] = self.icon_url
|
74
78
|
end
|