stealth-twilio 1.3.3 → 1.5.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: a333f36afd40400ce4b58e79eaa443c6720eb36f1602117b7a1522ff759ee0dd
4
- data.tar.gz: 7073c50991bfad7b01f2b34db11775ee6467a2e972c666c54d5c610098ab73b7
3
+ metadata.gz: 31111a0f4b454d21f6e7185b2dbb7c1096f8cba37ccfe3f8ebae603cc9a59ec3
4
+ data.tar.gz: 06cbdac36831b7ac8fe16c5b3a965550a500fe042eb3fba7b775f24ecd6580b4
5
5
  SHA512:
6
- metadata.gz: a334abb9b111e210f3e490b1c46e6a10c34b6c9493045c2ff6eaf75f30d7d1dfdc7bcf0e75b6ec60cf68e68d7ae20fff7be1280aad6990a33b5d3e7b4e3b656f
7
- data.tar.gz: 7ce2a6e9e5a88054da0ce77a805f66784eb49efbd5f133c4eff28e416e5075df250be094724aa1af72e629d655e4101a44ef2788eb4409621652003c13ed9944
6
+ metadata.gz: e541a94f861278886e11b1d12154070854cb695b78d28f602bb2285ea19e65dfb4e19bacceb555e27eca386ed0048311139d16b88b09df23a89ca23b7cfbab24
7
+ data.tar.gz: b7cd4e48704484dbf01ad75321350f613059fd5e2a6a7f508837e318ee9df839d902dfe20b735be206ab179b0360911d4f17806c32a66b3c6eb2b85936612e10
data/Gemfile.lock CHANGED
@@ -1,44 +1,49 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stealth-twilio (1.3.3)
4
+ stealth-twilio (1.4.0)
5
5
  stealth (>= 2.0.0.beta)
6
6
  twilio-ruby (~> 5.5)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (6.0.3.3)
11
+ activesupport (6.1.4.6)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 0.7, < 2)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
16
- zeitwerk (~> 2.2, >= 2.2.2)
17
- concurrent-ruby (1.1.7)
18
- connection_pool (2.2.3)
13
+ i18n (>= 1.6, < 2)
14
+ minitest (>= 5.1)
15
+ tzinfo (~> 2.0)
16
+ zeitwerk (~> 2.3)
17
+ concurrent-ruby (1.1.9)
18
+ connection_pool (2.2.5)
19
19
  diff-lcs (1.4.4)
20
- faraday (1.0.1)
20
+ faraday (1.3.0)
21
+ faraday-net_http (~> 1.0)
21
22
  multipart-post (>= 1.2, < 3)
22
- i18n (1.8.5)
23
+ ruby2_keywords
24
+ faraday-net_http (1.0.1)
25
+ i18n (1.10.0)
23
26
  concurrent-ruby (~> 1.0)
24
- jwt (2.2.2)
25
- mini_portile2 (2.4.0)
26
- minitest (5.14.2)
27
+ jwt (2.3.0)
28
+ mini_portile2 (2.8.0)
29
+ minitest (5.15.0)
27
30
  multi_json (1.15.0)
28
31
  multipart-post (2.1.1)
29
32
  mustermann (1.1.1)
30
33
  ruby2_keywords (~> 0.0.1)
31
- nio4r (2.5.4)
32
- nokogiri (1.10.10)
33
- mini_portile2 (~> 2.4.0)
34
- puma (4.3.6)
34
+ nio4r (2.5.8)
35
+ nokogiri (1.13.3)
36
+ mini_portile2 (~> 2.8.0)
37
+ racc (~> 1.4)
38
+ puma (5.6.2)
35
39
  nio4r (~> 2.0)
40
+ racc (1.6.0)
36
41
  rack (2.2.3)
37
- rack-protection (2.1.0)
42
+ rack-protection (2.2.0)
38
43
  rack
39
44
  rack-test (1.1.0)
40
45
  rack (>= 1.0, < 3)
41
- redis (4.2.2)
46
+ redis (4.6.0)
42
47
  rspec (3.9.0)
43
48
  rspec-core (~> 3.9.0)
44
49
  rspec-expectations (~> 3.9.0)
@@ -54,43 +59,42 @@ GEM
54
59
  rspec-support (3.9.3)
55
60
  rspec_junit_formatter (0.4.1)
56
61
  rspec-core (>= 2, < 4, != 2.12.0)
57
- ruby2_keywords (0.0.2)
58
- sidekiq (6.1.2)
62
+ ruby2_keywords (0.0.5)
63
+ sidekiq (6.4.1)
59
64
  connection_pool (>= 2.2.2)
60
65
  rack (~> 2.0)
61
66
  redis (>= 4.2.0)
62
- sinatra (2.1.0)
67
+ sinatra (2.2.0)
63
68
  mustermann (~> 1.0)
64
69
  rack (~> 2.2)
65
- rack-protection (= 2.1.0)
70
+ rack-protection (= 2.2.0)
66
71
  tilt (~> 2.0)
67
- stealth (2.0.0.beta1)
72
+ stealth (2.0.0.beta4)
68
73
  activesupport (~> 6.0)
69
74
  multi_json (~> 1.12)
70
- puma (>= 4.2, < 5.0)
75
+ puma (>= 4.2, < 6.0)
71
76
  sidekiq (~> 6.0)
72
77
  sinatra (~> 2.0)
73
78
  thor (~> 1.0)
74
- thor (1.0.1)
75
- thread_safe (0.3.6)
79
+ thor (1.2.1)
76
80
  tilt (2.0.10)
77
- twilio-ruby (5.40.2)
81
+ twilio-ruby (5.65.0)
78
82
  faraday (>= 0.9, < 2.0)
79
83
  jwt (>= 1.5, <= 2.5)
80
84
  nokogiri (>= 1.6, < 2.0)
81
- tzinfo (1.2.7)
82
- thread_safe (~> 0.1)
83
- zeitwerk (2.4.0)
85
+ tzinfo (2.0.4)
86
+ concurrent-ruby (~> 1.0)
87
+ zeitwerk (2.5.4)
84
88
 
85
89
  PLATFORMS
86
90
  ruby
87
91
 
88
92
  DEPENDENCIES
89
93
  rack-test (~> 1.1)
90
- rspec (~> 3.6)
94
+ rspec (~> 3)
91
95
  rspec_junit_formatter (~> 0.3)
92
96
  stealth (>= 2.0.0.beta)
93
97
  stealth-twilio!
94
98
 
95
99
  BUNDLED WITH
96
- 2.1.4
100
+ 2.2.32
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2017-2020 Mauricio Gomes, Mav Automation Ventures Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.3
1
+ 1.5.0
@@ -39,18 +39,24 @@ module Stealth
39
39
  case e.message
40
40
  when /21610/ # Attempt to send to unsubscribed recipient
41
41
  raise Stealth::Errors::UserOptOut
42
+ when /21211/ # Invalid 'To' Phone Number
43
+ raise Stealth::Errors::InvalidSessionID
42
44
  when /21612/ # 'To' phone number is not currently reachable via SMS
43
- raise Stealth::Errors::UserOptOut
45
+ raise Stealth::Errors::InvalidSessionID
44
46
  when /21614/ # 'To' number is not a valid mobile number
45
- raise Stealth::Errors::UserOptOut
46
- when /30004/ # Message blocked
47
- raise Stealth::Errors::UserOptOut
48
- when /21211/ # Invalid 'To' Phone Number
49
47
  raise Stealth::Errors::InvalidSessionID
50
48
  when /30003/ # Unreachable destination handset
51
49
  raise Stealth::Errors::InvalidSessionID
50
+ when /30004/ # Message Blocked
51
+ raise Stealth::Errors::MessageFiltered
52
52
  when /30005/ # Unknown destination handset
53
53
  raise Stealth::Errors::InvalidSessionID
54
+ when /30006/ # Landline or unreachable carrier
55
+ raise Stealth::Errors::InvalidSessionID
56
+ when /30007/ # Message filtered
57
+ raise Stealth::Errors::MessageFiltered
58
+ when /30008/ # Unknown error 🤷‍♂️
59
+ raise Stealth::Errors::UnknownServiceError
54
60
  else
55
61
  raise
56
62
  end
@@ -8,7 +8,7 @@ module Stealth
8
8
 
9
9
  ALPHA_ORDINALS = ('A'..'Z').to_a.freeze
10
10
 
11
- attr_reader :recipient_id, :reply
11
+ attr_reader :recipient_id, :reply, :translated_reply
12
12
 
13
13
  def initialize(recipient_id: nil, reply: nil)
14
14
  @recipient_id = recipient_id
@@ -18,20 +18,20 @@ module Stealth
18
18
  def text
19
19
  check_text_length
20
20
 
21
- translated_reply = reply['text']
21
+ @translated_reply = reply['text']
22
22
 
23
23
  suggestions = generate_suggestions(suggestions: reply['suggestions'])
24
24
  buttons = generate_buttons(buttons: reply['buttons'])
25
25
 
26
26
  if suggestions.present?
27
- translated_reply = [
28
- translated_reply,
27
+ @translated_reply = [
28
+ @translated_reply,
29
29
  'Reply with:'
30
30
  ].join("\n\n")
31
31
 
32
32
  suggestions.each_with_index do |suggestion, i|
33
- translated_reply = [
34
- translated_reply,
33
+ @translated_reply = [
34
+ @translated_reply,
35
35
  "\"#{ALPHA_ORDINALS[i]}\" for #{suggestion}"
36
36
  ].join("\n")
37
37
  end
@@ -39,14 +39,14 @@ module Stealth
39
39
 
40
40
  if buttons.present?
41
41
  buttons.each do |button|
42
- translated_reply = [
43
- translated_reply,
42
+ @translated_reply = [
43
+ @translated_reply,
44
44
  button
45
45
  ].join("\n\n")
46
46
  end
47
47
  end
48
48
 
49
- format_response({ body: translated_reply })
49
+ format_response({ body: @translated_reply })
50
50
  end
51
51
 
52
52
  def image
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.add_dependency 'stealth', '>= 2.0.0.beta'
16
16
  s.add_dependency 'twilio-ruby', '~> 5.5'
17
17
 
18
- s.add_development_dependency 'rspec', '~> 3.6'
18
+ s.add_development_dependency 'rspec', '~> 3'
19
19
  s.add_development_dependency 'rspec_junit_formatter', '~> 0.3'
20
20
  s.add_development_dependency 'rack-test', '~> 1.1'
21
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stealth-twilio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauricio Gomes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-21 00:00:00.000000000 Z
11
+ date: 2022-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stealth
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.6'
47
+ version: '3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.6'
54
+ version: '3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec_junit_formatter
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -90,6 +90,7 @@ files:
90
90
  - ".gitignore"
91
91
  - Gemfile
92
92
  - Gemfile.lock
93
+ - LICENSE
93
94
  - README.md
94
95
  - VERSION
95
96
  - lib/stealth-twilio.rb
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0'
123
124
  requirements: []
124
- rubygems_version: 3.1.2
125
+ rubygems_version: 3.3.7
125
126
  signing_key:
126
127
  specification_version: 4
127
128
  summary: Stealth Twilio SMS driver