slack_message 3.1.0 → 3.2.0
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/CHANGELOG.md +4 -1
- data/lib/slack_message/api.rb +3 -6
- data/lib/slack_message/error_handling.rb +7 -1
- data/slack_message.gemspec +1 -1
- data/spec/slack_message_spec.rb +0 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdc04bd65ae2c98be234fbea88cec4d5373553bdb758a28959ef7c2515e8420c
|
4
|
+
data.tar.gz: 68beb2e7a60e6cb6b4f2904e1f5335e934b447070b29c9362caca0ce2148fad5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6f5ca7c5ced4e495439429eb9aba32fbb4567f64eff04ff3eff9ba5e05caab3faac995d18e830e58a9bb432c40a4cc4ecc4e383cff71bf7fa7e4cf4f8b47e75
|
7
|
+
data.tar.gz: 5ad0999dd393d908a3ddd1e8e83d82f01ff8296f5178f7817cabd73553987c37a82107034d50a20c52a671fd12af5d6771e20962dbc0dcccc7eb135865a9a465
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [3.
|
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
|
data/lib/slack_message/api.rb
CHANGED
@@ -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
|
-
|
26
|
-
|
27
|
-
|
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(
|
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"
|
data/slack_message.gemspec
CHANGED
data/spec/slack_message_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2022-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|