slack_message 3.1.0 → 3.2.0

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
  SHA256:
3
- metadata.gz: 2b4cc88c84b2a958d75262b0d1fea97de8b7b694555159e4962a4a9fa16c55f6
4
- data.tar.gz: 750afd5d7321952cc9dbf344d6db3659f85d916f988ca7ac3e56ec615cde4b34
3
+ metadata.gz: bdc04bd65ae2c98be234fbea88cec4d5373553bdb758a28959ef7c2515e8420c
4
+ data.tar.gz: 68beb2e7a60e6cb6b4f2904e1f5335e934b447070b29c9362caca0ce2148fad5
5
5
  SHA512:
6
- metadata.gz: 7eb4393b8e51b899a65abe790f4e217522441274bc6cc418ea21e43257716d218ad87fbddfce2fd7521f4305840312967249f4faf20261f5f7b665ec01d55896
7
- data.tar.gz: ce790defaa92aeea75683771a85ef827386a1275524ac6006139aa3db58e387797ae5f8b8623e6896f07c5af0e6fd881b2878bac1cadf1be398333ab20066a2c
6
+ metadata.gz: f6f5ca7c5ced4e495439429eb9aba32fbb4567f64eff04ff3eff9ba5e05caab3faac995d18e830e58a9bb432c40a4cc4ecc4e383cff71bf7fa7e4cf4f8b47e75
7
+ data.tar.gz: 5ad0999dd393d908a3ddd1e8e83d82f01ff8296f5178f7817cabd73553987c37a82107034d50a20c52a671fd12af5d6771e20962dbc0dcccc7eb135865a9a465
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Changelog
2
2
 
3
- ## [3.1.0] - TBD
3
+ ## [3.2.0] - 2022-06-23
4
+ - Fix bugs introduced by accidental checkin of incomplete refactor
5
+
6
+ ## [3.1.0] - 2022-04-18
4
7
  - Methods from the calling context can now be called within a section block.
5
8
 
6
9
  ## [3.0.2] - 2022-04-16
@@ -22,13 +22,10 @@ module SlackMessage::Api
22
22
  raise SlackMessage::ApiError, "Received empty 200 response from Slack when looking up user info. Check your API key."
23
23
  end
24
24
 
25
- begin
26
- payload = JSON.parse(response.body)
27
- rescue
28
- raise SlackMessage::ApiError, "Unable to parse JSON response from Slack API\n#{response.body}"
29
- end
25
+ SlackMessage::ErrorHandling.raise_user_lookup_response_errors(response, email, profile)
26
+
27
+ payload = JSON.parse(response.body)
30
28
 
31
- SlackMessage::ErrorHandling.raise_user_lookup_errors(response, target, profile)
32
29
  payload["user"]["id"]
33
30
  end
34
31
 
@@ -102,7 +102,13 @@ class SlackMessage::ErrorHandling
102
102
  end
103
103
  end
104
104
 
105
- def self.raise_user_lookup_response_errors(payload)
105
+ def self.raise_user_lookup_response_errors(response, email, profile)
106
+ begin
107
+ payload = JSON.parse(response.body)
108
+ rescue
109
+ raise SlackMessage::ApiError, "Unable to parse JSON response from Slack API\n#{response.body}"
110
+ end
111
+
106
112
  error = payload["error"]
107
113
 
108
114
  if error == "users_not_found"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'slack_message'
3
- gem.version = "3.1.0"
3
+ gem.version = "3.2.0"
4
4
  gem.summary = "A nice DSL for composing rich messages in Slack"
5
5
  gem.authors = ["Joe Mastey"]
6
6
  gem.email = 'hello@joemastey.com'
@@ -60,13 +60,6 @@ RSpec.describe SlackMessage do
60
60
  end
61
61
  end
62
62
 
63
- fit do
64
- SlackMessage.build do
65
- notification_text 'one'
66
- notification_text 'two'
67
- end
68
- end
69
-
70
63
  it "can assert expectations against posts" do
71
64
  expect {
72
65
  SlackMessage.post_to('#lieutenant') { text "foo" }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack_message
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Mastey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-18 00:00:00.000000000 Z
11
+ date: 2022-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec