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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f81be4fee7a28cfce27bb064f4c87a25ccb7ebed
4
- data.tar.gz: c27a52cbbafb90d1093a72690f03700585900f21
3
+ metadata.gz: 540c0909cdf9490eef7ec09dcbe3b0c5ba6a7734
4
+ data.tar.gz: 9e6b01d7c3b4c97cb7a34bc212ca56ffc7cf7f72
5
5
  SHA512:
6
- metadata.gz: cd049a0f8002751034825c90c8d086af9e44583ab475dd1d3705bb71ae63af3a7d0e91133be07ebc578340a1dd002c4d294c102b4eac0db453a332cd5326e0d1
7
- data.tar.gz: 5b1fbbaddacd7a14ace22ee75836e95b542b7e72e0ae70e784cc00f9a0f1b9870547789f5ac558177751edb725de45dc6079751489ab417c5073b48b330c860e
6
+ metadata.gz: 44fb27d5b04b40bbba83b2884d0978c2f6eb9436e8931b8f4b450f484f5964acdbc25219a6b39d2d65cbd529e38e85c8fa2e69be24dc98265e772b91e08c36ca
7
+ data.tar.gz: 505202361240f3d0156d9813e63ac8e07760be824054583eb613775fff5858c0772aedc609abc18d74d41f263f6ebae683bc928ad147abcc99fe30490baf363b
@@ -1,3 +1,3 @@
1
1
  module SlackWebhooks
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -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['text'] = text
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
- options[:attachments] = [attachment]
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack_webhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Reeder