smart_todo 1.3.0 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e7fe4f3876be333b1df4dcd44d965e57a0725e65900f96a518bd6a49d608165
4
- data.tar.gz: 02b5370dfc45cc2337d973db79a3a6bddccb8ae295d2ec529eebbb166247873b
3
+ metadata.gz: dc3a4665a0110180692321fbdd788be8df4155de16bf75b2967f4c330a759e72
4
+ data.tar.gz: 414a198aa06035126890b002f6552779c73d9f6f84eeeaa904ba2132daa7d4d9
5
5
  SHA512:
6
- metadata.gz: b1bcacca903ebeb350b7abbb8af580de31904bae313c08aac9ffd53351ea8d13897bda85d6ede9e12971dcf5fa3f5a68b2ebb1f71bcbfddd443c34e6ee6c65fc
7
- data.tar.gz: 970874dccc0323c3b009ec22a083c5096172390fe7c34bb698958cd9e89deb958f5be69dc26145c945a1aac7d740875656ea8a9eb0372dfecbd7ca04745a0a2a
6
+ metadata.gz: 8e0c57b0849a90cd1be9699d264167e7286d622eb42e02cc7dd13231ab41d76d815a455a65571f3890dda7c79dc0228692b0c72c37c50337826df137d0c0f0df
7
+ data.tar.gz: a62b94332abe655cb418d0238eaa24e86db0e48b109877b8192265a244795624a2188cffeb0be429f0204683394b992ce73a0932efc322b4c3ba589cadcd0af4
@@ -2,9 +2,9 @@ name: CI
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ master ]
5
+ branches: [ main ]
6
6
  pull_request:
7
- branches: [ master ]
7
+ branches: [ main ]
8
8
 
9
9
  jobs:
10
10
  build:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_todo (1.3.0)
4
+ smart_todo (1.3.1)
5
5
  rexml
6
6
 
7
7
  GEM
data/dev.yml CHANGED
@@ -4,8 +4,12 @@ type:
4
4
  - ruby
5
5
 
6
6
  up:
7
- - ruby: 2.7.4
7
+ - ruby: 3.0.2
8
8
  - bundler
9
9
 
10
+ console:
11
+ desc: 'start a console'
12
+ run: bin/console
13
+
10
14
  test:
11
15
  bundle exec rake test
@@ -8,7 +8,7 @@ module SmartTodo
8
8
 
9
9
  # @return void
10
10
  def dispatch
11
- puts slack_message({})
11
+ puts slack_message({}, nil)
12
12
  end
13
13
  end
14
14
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "cgi"
3
4
  require "net/http"
4
5
  require "json"
5
6
 
@@ -37,14 +38,14 @@ module SmartTodo
37
38
  # @param email [String]
38
39
  # @return [Hash]
39
40
  #
40
- # @raise [Net::HTTPError] in case the reques to Slack failed
41
- # @raise [SlackClient::Error] in case Slack returs a { ok: false } in the body
41
+ # @raise [Net::HTTPError] in case the request to Slack failed
42
+ # @raise [SlackClient::Error] in case Slack returns a { ok: false } in the body
42
43
  #
43
44
  # @see https://api.slack.com/methods/users.lookupByEmail
44
45
  def lookup_user_by_email(email)
45
46
  headers = { "Content-Type" => "application/x-www-form-urlencoded" }
46
47
 
47
- request(:get, "/api/users.lookupByEmail?email=#{email}", nil, headers)
48
+ request(:get, "/api/users.lookupByEmail?email=#{CGI.escape(email)}", nil, headers)
48
49
  end
49
50
 
50
51
  # Send a message to a Slack channel or to a user
@@ -53,8 +54,8 @@ module SmartTodo
53
54
  # @param text [String] The message to send
54
55
  # @return [Hash]
55
56
  #
56
- # @raise [Net::HTTPError] in case the reques to Slack failed
57
- # @raise [SlackClient::Error] in case Slack returs a { ok: false } in the body
57
+ # @raise [Net::HTTPError] in case the request to Slack failed
58
+ # @raise [SlackClient::Error] in case Slack returns a { ok: false } in the body
58
59
  #
59
60
  # @see https://api.slack.com/methods/chat.postMessage
60
61
  def post_message(channel, text)
@@ -68,8 +69,8 @@ module SmartTodo
68
69
  # @param data [String] JSON encoded data when making a POST request
69
70
  # @param headers [Hash]
70
71
  #
71
- # @raise [Net::HTTPError] in case the reques to Slack failed
72
- # @raise [SlackClient::Error] in case Slack returs a { ok: false } in the body
72
+ # @raise [Net::HTTPError] in case the request to Slack failed
73
+ # @raise [SlackClient::Error] in case Slack returns a { ok: false } in the body
73
74
  def request(method, endpoint, data = nil, headers = {})
74
75
  response = case method
75
76
  when :post, :patch
@@ -87,8 +88,8 @@ module SmartTodo
87
88
  # (Net::HTTPOK, Net::HTTPNotFound ...)
88
89
  # @return [Hash]
89
90
  #
90
- # @raise [Net::HTTPError] in case the reques to Slack failed
91
- # @raise [SlackClient::Error] in case Slack returs a { ok: false } in the body
91
+ # @raise [Net::HTTPError] in case the request to Slack failed
92
+ # @raise [SlackClient::Error] in case Slack returns a { ok: false } in the body
92
93
  def slack_response!(response)
93
94
  raise(Net::HTTPError.new("Request to slack failed", response)) unless response.code_type < Net::HTTPSuccess
94
95
  body = JSON.parse(response.body)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmartTodo
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_todo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-22 00:00:00.000000000 Z
11
+ date: 2021-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rexml