smess 2.0.7 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +17 -33
- data/lib/smess/output.rb +4 -0
- data/lib/smess/outputs/auto.rb +5 -0
- data/lib/smess/outputs/twilio.rb +10 -6
- data/lib/smess/sms.rb +7 -0
- data/lib/smess/version.rb +1 -1
- data/smess-2.0.8.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9264dd553b1402dab8be17b373c67334564d4b1e960636d4df42c8b40c190421
|
4
|
+
data.tar.gz: d125c970b1ae0591f092cdca5036f85f892bd4d5aa50bdb1cfff02f330381946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77e61cf66715eb0a64f28c91e1b7d0cee22bc27af517c9f545680443225f465abab65fb42c7cf7c5321d9d0527bff0d2871897ae58bf47965a76dda6df3364a7
|
7
|
+
data.tar.gz: 1ece289153de4a40343f1bce349ce5ee9adf9c1dbdc4596910910d57f4e48a37fabd44a055eaaf6384927a98f5ad55362b40e748ac86a6ba760efe2ccf4651e0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smess (2.0.
|
4
|
+
smess (2.0.8)
|
5
5
|
activesupport (>= 5.2.6, < 7.0.0)
|
6
6
|
clickatell (~> 0)
|
7
7
|
httpi (~> 1.1)
|
@@ -12,7 +12,7 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (6.1.
|
15
|
+
activesupport (6.1.6)
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
17
|
i18n (>= 1.6, < 2)
|
18
18
|
minitest (>= 5.1)
|
@@ -23,49 +23,33 @@ GEM
|
|
23
23
|
nokogiri
|
24
24
|
builder (3.2.4)
|
25
25
|
clickatell (0.8.2)
|
26
|
-
concurrent-ruby (1.1.
|
26
|
+
concurrent-ruby (1.1.10)
|
27
27
|
diff-lcs (1.3)
|
28
28
|
docile (1.3.2)
|
29
29
|
dotenv (2.7.5)
|
30
|
-
faraday (
|
31
|
-
faraday-
|
32
|
-
faraday-em_synchrony (~> 1.0)
|
33
|
-
faraday-excon (~> 1.1)
|
34
|
-
faraday-httpclient (~> 1.0.1)
|
35
|
-
faraday-net_http (~> 1.0)
|
36
|
-
faraday-net_http_persistent (~> 1.1)
|
37
|
-
faraday-patron (~> 1.0)
|
38
|
-
faraday-rack (~> 1.0)
|
39
|
-
multipart-post (>= 1.2, < 3)
|
30
|
+
faraday (2.3.0)
|
31
|
+
faraday-net_http (~> 2.0)
|
40
32
|
ruby2_keywords (>= 0.0.4)
|
41
|
-
faraday-
|
42
|
-
faraday-em_synchrony (1.0.0)
|
43
|
-
faraday-excon (1.1.0)
|
44
|
-
faraday-httpclient (1.0.1)
|
45
|
-
faraday-net_http (1.0.1)
|
46
|
-
faraday-net_http_persistent (1.2.0)
|
47
|
-
faraday-patron (1.0.0)
|
48
|
-
faraday-rack (1.0.0)
|
33
|
+
faraday-net_http (2.0.3)
|
49
34
|
gyoku (0.4.6)
|
50
35
|
builder (>= 2.1.2)
|
51
36
|
httpi (1.1.1)
|
52
37
|
rack
|
53
|
-
i18n (1.
|
38
|
+
i18n (1.10.0)
|
54
39
|
concurrent-ruby (~> 1.0)
|
55
40
|
json (2.3.0)
|
56
|
-
jwt (2.
|
41
|
+
jwt (2.4.1)
|
57
42
|
mail (2.7.1)
|
58
43
|
mini_mime (>= 0.1.1)
|
59
44
|
mini_mime (1.1.2)
|
60
|
-
mini_portile2 (2.
|
61
|
-
minitest (5.
|
62
|
-
|
63
|
-
|
64
|
-
mini_portile2 (~> 2.6.1)
|
45
|
+
mini_portile2 (2.8.0)
|
46
|
+
minitest (5.15.0)
|
47
|
+
nokogiri (1.13.6)
|
48
|
+
mini_portile2 (~> 2.8.0)
|
65
49
|
racc (~> 1.4)
|
66
50
|
nori (1.1.5)
|
67
|
-
racc (1.
|
68
|
-
rack (2.2.3)
|
51
|
+
racc (1.6.0)
|
52
|
+
rack (2.2.3.1)
|
69
53
|
rspec (3.9.0)
|
70
54
|
rspec-core (~> 3.9.0)
|
71
55
|
rspec-expectations (~> 3.9.0)
|
@@ -93,8 +77,8 @@ GEM
|
|
93
77
|
json (>= 1.8, < 3)
|
94
78
|
simplecov-html (~> 0.10.0)
|
95
79
|
simplecov-html (0.10.2)
|
96
|
-
twilio-ruby (5.
|
97
|
-
faraday (>= 0.9, <
|
80
|
+
twilio-ruby (5.67.2)
|
81
|
+
faraday (>= 0.9, < 3.0)
|
98
82
|
jwt (>= 1.5, <= 2.5)
|
99
83
|
nokogiri (>= 1.6, < 2.0)
|
100
84
|
tzinfo (2.0.4)
|
@@ -102,7 +86,7 @@ GEM
|
|
102
86
|
wasabi (2.5.1)
|
103
87
|
httpi (~> 1.0)
|
104
88
|
nokogiri (>= 1.4.0)
|
105
|
-
zeitwerk (2.4
|
89
|
+
zeitwerk (2.5.4)
|
106
90
|
|
107
91
|
PLATFORMS
|
108
92
|
ruby
|
data/lib/smess/output.rb
CHANGED
data/lib/smess/outputs/auto.rb
CHANGED
@@ -11,6 +11,11 @@ module Smess
|
|
11
11
|
out.deliver.merge({sent_with: output_name})
|
12
12
|
end
|
13
13
|
|
14
|
+
def send_feedback(message_sid)
|
15
|
+
out = output_for sms.to
|
16
|
+
out.send_feedback(message_sid)
|
17
|
+
end
|
18
|
+
|
14
19
|
def get_output_name_for_msisdn(msisdn)
|
15
20
|
3.downto(0).each do |index|
|
16
21
|
return Smess.config.output_by_country_code[msisdn[0..index]] if Smess.config.output_by_country_code.key? msisdn[0..index]
|
data/lib/smess/outputs/twilio.rb
CHANGED
@@ -10,6 +10,7 @@ module Smess
|
|
10
10
|
end
|
11
11
|
|
12
12
|
attr_accessor :sid, :auth_token, :from, :messaging_service_sid, :callback_url
|
13
|
+
|
13
14
|
def validate_config
|
14
15
|
@sid = config.fetch(:sid)
|
15
16
|
@auth_token = config.fetch(:auth_token)
|
@@ -18,6 +19,10 @@ module Smess
|
|
18
19
|
@callback_url = config.fetch(:callback_url)
|
19
20
|
end
|
20
21
|
|
22
|
+
def send_feedback(message_sid)
|
23
|
+
client.messages(message_sid).feedback.create(outcome: "confirmed")
|
24
|
+
end
|
25
|
+
|
21
26
|
def deliver
|
22
27
|
send_one_sms sms.message
|
23
28
|
end
|
@@ -31,7 +36,7 @@ module Smess
|
|
31
36
|
end
|
32
37
|
|
33
38
|
def split_parts
|
34
|
-
Smess.separate_sms(sms.message).reject {|s| s.empty? }
|
39
|
+
Smess.separate_sms(sms.message).reject { |s| s.empty? }
|
35
40
|
end
|
36
41
|
|
37
42
|
def send_one_sms(message)
|
@@ -39,16 +44,15 @@ module Smess
|
|
39
44
|
opts = {
|
40
45
|
to: "+#{sms.to}",
|
41
46
|
body: message,
|
42
|
-
status_callback: callback_url
|
47
|
+
status_callback: callback_url,
|
48
|
+
provide_feedback: true
|
43
49
|
}
|
44
50
|
if messaging_service_sid.present?
|
45
|
-
opts[:messaging_service_sid] =
|
51
|
+
opts[:messaging_service_sid] = messaging_service_sid
|
46
52
|
else
|
47
|
-
opts[:from] =
|
53
|
+
opts[:from] = from
|
48
54
|
end
|
49
|
-
puts "about to create_client_message"
|
50
55
|
response = create_client_message(opts)
|
51
|
-
puts "got response #{response.inspect}"
|
52
56
|
result = normal_result(response)
|
53
57
|
rescue => e
|
54
58
|
puts "got exception #{e.inspect}"
|
data/lib/smess/sms.rb
CHANGED
data/lib/smess/version.rb
CHANGED
data/smess-2.0.8.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Westin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -173,6 +173,7 @@ files:
|
|
173
173
|
- lib/smess/utils.rb
|
174
174
|
- lib/smess/version.rb
|
175
175
|
- lib/string_ext.rb
|
176
|
+
- smess-2.0.8.gem
|
176
177
|
- smess.gemspec
|
177
178
|
homepage: https://github.com/eimermusic/smess
|
178
179
|
licenses:
|