smess 2.0.5 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +28 -23
- data/example_config.rb +90 -0
- data/lib/smess/outputs/link_mobility.rb +1 -1
- data/lib/smess/outputs/twilio.rb +6 -4
- data/lib/smess/version.rb +1 -1
- data/lib/string_ext.rb +1 -1
- data/smess.gemspec +30 -0
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 90d1e52ab3e6f1d8ae4640292cec28b848f3acedb32ec69d1b4b3a971f9d7b8e
|
4
|
+
data.tar.gz: 230d748d26760a0387eab912dce1e7de92a5224edf4c75e3c32ad2b01795c56e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96e79778835ca11d3baecbbe4c3ca861a6030e1e4f0efd841ab1683803a2220cf9e8cfdefdf84c5dd8b7683bf61509bba9181456c261e180ee22b345087e365b
|
7
|
+
data.tar.gz: 4fda0f5f94fc7ed8b1e29c535d825f520a6ffb4af2b079a9a5b8c646d883219b8e64f175790a8b0e8eb66636a81187b07023e269d7f311dcd82751c3b850b0b4
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smess (2.0.
|
5
|
-
activesupport (>=
|
4
|
+
smess (2.0.8)
|
5
|
+
activesupport (>= 5.2.6, < 7.0.0)
|
6
6
|
clickatell (~> 0)
|
7
7
|
httpi (~> 1.1)
|
8
8
|
mail (~> 2.7)
|
@@ -12,40 +12,44 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (
|
15
|
+
activesupport (6.1.6)
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
-
i18n (>=
|
18
|
-
minitest (
|
19
|
-
tzinfo (~>
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
tzinfo (~> 2.0)
|
20
|
+
zeitwerk (~> 2.3)
|
20
21
|
akami (1.2.2)
|
21
22
|
gyoku (>= 0.4.0)
|
22
23
|
nokogiri
|
23
24
|
builder (3.2.4)
|
24
25
|
clickatell (0.8.2)
|
25
|
-
concurrent-ruby (1.1.
|
26
|
+
concurrent-ruby (1.1.10)
|
26
27
|
diff-lcs (1.3)
|
27
28
|
docile (1.3.2)
|
28
29
|
dotenv (2.7.5)
|
29
|
-
faraday (
|
30
|
-
|
30
|
+
faraday (2.3.0)
|
31
|
+
faraday-net_http (~> 2.0)
|
32
|
+
ruby2_keywords (>= 0.0.4)
|
33
|
+
faraday-net_http (2.0.3)
|
31
34
|
gyoku (0.4.6)
|
32
35
|
builder (>= 2.1.2)
|
33
36
|
httpi (1.1.1)
|
34
37
|
rack
|
35
|
-
i18n (1.
|
38
|
+
i18n (1.10.0)
|
36
39
|
concurrent-ruby (~> 1.0)
|
37
40
|
json (2.3.0)
|
38
|
-
jwt (2.
|
41
|
+
jwt (2.4.1)
|
39
42
|
mail (2.7.1)
|
40
43
|
mini_mime (>= 0.1.1)
|
41
|
-
mini_mime (1.
|
42
|
-
mini_portile2 (2.
|
43
|
-
minitest (5.
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
mini_mime (1.1.2)
|
45
|
+
mini_portile2 (2.8.0)
|
46
|
+
minitest (5.15.0)
|
47
|
+
nokogiri (1.13.6)
|
48
|
+
mini_portile2 (~> 2.8.0)
|
49
|
+
racc (~> 1.4)
|
47
50
|
nori (1.1.5)
|
48
|
-
|
51
|
+
racc (1.6.0)
|
52
|
+
rack (2.2.3.1)
|
49
53
|
rspec (3.9.0)
|
50
54
|
rspec-core (~> 3.9.0)
|
51
55
|
rspec-expectations (~> 3.9.0)
|
@@ -59,6 +63,7 @@ GEM
|
|
59
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
64
|
rspec-support (~> 3.9.0)
|
61
65
|
rspec-support (3.9.2)
|
66
|
+
ruby2_keywords (0.0.5)
|
62
67
|
savon (1.2.0)
|
63
68
|
akami (~> 1.2.0)
|
64
69
|
builder (>= 2.1.2)
|
@@ -72,16 +77,16 @@ GEM
|
|
72
77
|
json (>= 1.8, < 3)
|
73
78
|
simplecov-html (~> 0.10.0)
|
74
79
|
simplecov-html (0.10.2)
|
75
|
-
|
76
|
-
|
77
|
-
faraday (~> 1.0.0)
|
80
|
+
twilio-ruby (5.67.2)
|
81
|
+
faraday (>= 0.9, < 3.0)
|
78
82
|
jwt (>= 1.5, <= 2.5)
|
79
83
|
nokogiri (>= 1.6, < 2.0)
|
80
|
-
tzinfo (
|
81
|
-
|
84
|
+
tzinfo (2.0.4)
|
85
|
+
concurrent-ruby (~> 1.0)
|
82
86
|
wasabi (2.5.1)
|
83
87
|
httpi (~> 1.0)
|
84
88
|
nokogiri (>= 1.4.0)
|
89
|
+
zeitwerk (2.5.4)
|
85
90
|
|
86
91
|
PLATFORMS
|
87
92
|
ruby
|
data/example_config.rb
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
most_of_the_caribbean = [
|
2
|
+
"1242", # Bahamas
|
3
|
+
"1246", # Barbados
|
4
|
+
"1264", # Anguilla
|
5
|
+
"1268", # Antigua and Barbuda
|
6
|
+
"1284", # British Virgin Islands
|
7
|
+
"1345", # Cayman Islands
|
8
|
+
"1473", # Grenada
|
9
|
+
"1649", # Turks and Caicos Islands
|
10
|
+
"1664", # Montserrat
|
11
|
+
"1670", # Northern Mariana Islands
|
12
|
+
"1671", # Guam
|
13
|
+
"1684", # American Samoa
|
14
|
+
"1758", # Saint Lucia
|
15
|
+
"1767", # Dominica
|
16
|
+
"1784", # Saint Vincent and the Grenadines
|
17
|
+
"1787", # Puerto Rico
|
18
|
+
"1809", # Dominican Republic
|
19
|
+
"1868", # Trinidad and Tobago
|
20
|
+
"1869", # Saint Kitts and Nevis
|
21
|
+
"1876" # Jamaica
|
22
|
+
]
|
23
|
+
|
24
|
+
Smess.configure do |config|
|
25
|
+
|
26
|
+
config.default_sender_id = ENV["SMESS_SENDER_ID"]
|
27
|
+
config.default_output = :global_mouth
|
28
|
+
config.register_output({
|
29
|
+
name: :global_mouth,
|
30
|
+
country_codes: most_of_the_caribbean + ["20", "33", "34", "44", "46", "49", "594", "966"],
|
31
|
+
type: :global_mouth,
|
32
|
+
config: {
|
33
|
+
username: ENV["SMESS_GLOBAL_MOUTH_USER"],
|
34
|
+
password: ENV["SMESS_GLOBAL_MOUTH_PASS"],
|
35
|
+
sender_id: ENV["SMESS_GLOBAL_MOUTH_SENDER_ID"]
|
36
|
+
}
|
37
|
+
})
|
38
|
+
|
39
|
+
config.register_output({
|
40
|
+
name: :iconectiv,
|
41
|
+
country_codes: ["1"],
|
42
|
+
type: :iconectiv,
|
43
|
+
config: {
|
44
|
+
sms_url: ENV["SMESS_ICONECTIV_URL"],
|
45
|
+
username: ENV["SMESS_ICONECTIV_USER"],
|
46
|
+
password: ENV["SMESS_ICONECTIV_PASS"],
|
47
|
+
shortcode: ENV["SMESS_ICONECTIV_SHORTCODE"],
|
48
|
+
account_name: ENV["SMESS_ICONECTIV_ACCOUNT_NAME"],
|
49
|
+
service_name: ENV["SMESS_SERVICE_NAME"],
|
50
|
+
service_meta_data_verizon: ENV["SMESS_ICONECTIV_SERVICE_META_DATA_VERIZON"],
|
51
|
+
service_meta_data_t_mobile_us: ENV["SMESS_ICONECTIV_SERVICE_META_DATA_T_MOBILE_US"]
|
52
|
+
}
|
53
|
+
})
|
54
|
+
|
55
|
+
config.register_output({
|
56
|
+
name: :twilio,
|
57
|
+
country_codes: ["971"],
|
58
|
+
type: :twilio,
|
59
|
+
config: {
|
60
|
+
sid: ENV["SMESS_TWILIO_SID"],
|
61
|
+
auth_token: ENV["SMESS_TWILIO_AUTH_TOKEN"],
|
62
|
+
from: ENV["SMESS_TWILIO_FROM"],
|
63
|
+
callback_url: ENV["SMESS_TWILIO_CALLBACK_URL"]
|
64
|
+
}
|
65
|
+
})
|
66
|
+
|
67
|
+
config.register_output({
|
68
|
+
name: :card_board_fish,
|
69
|
+
country_codes: ["212"],
|
70
|
+
type: :card_board_fish,
|
71
|
+
config: {
|
72
|
+
username: ENV["SMESS_CARD_BOARD_FISH_USER"],
|
73
|
+
password: ENV["SMESS_CARD_BOARD_FISH_PASS"]
|
74
|
+
}
|
75
|
+
})
|
76
|
+
|
77
|
+
config.register_output({
|
78
|
+
name: :clickatell,
|
79
|
+
country_codes: ["1441"],
|
80
|
+
type: :clickatell,
|
81
|
+
config: {
|
82
|
+
api_id: ENV["SMESS_CLICKATELL_API_ID"],
|
83
|
+
user: ENV["SMESS_CLICKATELL_USER"],
|
84
|
+
pass: ENV["SMESS_CLICKATELL_PASS"],
|
85
|
+
sender_id: ENV["SMESS_CLICKATELL_SENDER_ID"],
|
86
|
+
sender_ids: ENV["SMESS_CLICKATELL_SENDER_IDS"]
|
87
|
+
}
|
88
|
+
})
|
89
|
+
|
90
|
+
end
|
data/lib/smess/outputs/twilio.rb
CHANGED
@@ -19,7 +19,7 @@ module Smess
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def deliver
|
22
|
-
send_one_sms sms.message
|
22
|
+
send_one_sms sms.message
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
@@ -31,7 +31,7 @@ module Smess
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def split_parts
|
34
|
-
Smess.separate_sms(sms.message
|
34
|
+
Smess.separate_sms(sms.message).reject {|s| s.empty? }
|
35
35
|
end
|
36
36
|
|
37
37
|
def send_one_sms(message)
|
@@ -39,7 +39,8 @@ module Smess
|
|
39
39
|
opts = {
|
40
40
|
to: "+#{sms.to}",
|
41
41
|
body: message,
|
42
|
-
status_callback: callback_url
|
42
|
+
status_callback: callback_url,
|
43
|
+
provide_feedback: true
|
43
44
|
}
|
44
45
|
if messaging_service_sid.present?
|
45
46
|
opts[:messaging_service_sid] = messaging_service_sid
|
@@ -49,6 +50,7 @@ module Smess
|
|
49
50
|
response = create_client_message(opts)
|
50
51
|
result = normal_result(response)
|
51
52
|
rescue => e
|
53
|
+
puts "got exception #{e.inspect}"
|
52
54
|
result = result_for_error(e)
|
53
55
|
end
|
54
56
|
result
|
@@ -97,7 +99,7 @@ module Smess
|
|
97
99
|
def result_data
|
98
100
|
{
|
99
101
|
to: sms.to,
|
100
|
-
text: sms.message
|
102
|
+
text: sms.message,
|
101
103
|
from: from
|
102
104
|
}
|
103
105
|
end
|
data/lib/smess/version.rb
CHANGED
data/lib/string_ext.rb
CHANGED
data/smess.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
require "smess/version"
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.platform = Gem::Platform::RUBY
|
6
|
+
s.name = "smess"
|
7
|
+
s.version = Smess::VERSION
|
8
|
+
s.date = Time.now
|
9
|
+
s.summary = "A messy SMS messenger supporting every aggregator I have gotten my hands on"
|
10
|
+
s.description = "A mess of SMS messaging"
|
11
|
+
s.require_paths = ["lib"]
|
12
|
+
s.author = "Martin Westin"
|
13
|
+
s.email = "martin@eimermusic.com"
|
14
|
+
s.homepage = "https://github.com/eimermusic/smess"
|
15
|
+
s.license = 'MIT'
|
16
|
+
|
17
|
+
s.add_development_dependency 'rspec', '>= 2.4.0'
|
18
|
+
s.add_development_dependency 'simplecov'
|
19
|
+
s.add_development_dependency 'dotenv'
|
20
|
+
s.add_dependency 'mail', '~> 2.7'
|
21
|
+
s.add_dependency 'savon', '1.2.0'
|
22
|
+
s.add_dependency 'httpi', '~> 1.1'
|
23
|
+
s.add_dependency 'clickatell', '~> 0'
|
24
|
+
s.add_dependency 'twilio-ruby', '~> 5.26'
|
25
|
+
s.add_dependency 'activesupport', '>= 5.2.6', '< 7.0.0'
|
26
|
+
|
27
|
+
s.files = Dir["{lib}/**/*", "[A-Z]*", "init.rb"]
|
28
|
+
s.required_ruby_version = ">= 2.0.0"
|
29
|
+
s.required_rubygems_version = ">= 1.3.7"
|
30
|
+
end
|
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.0.8
|
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-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -128,20 +128,20 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 5.2.6
|
132
132
|
- - "<"
|
133
133
|
- !ruby/object:Gem::Version
|
134
|
-
version:
|
134
|
+
version: 7.0.0
|
135
135
|
type: :runtime
|
136
136
|
prerelease: false
|
137
137
|
version_requirements: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
139
|
- - ">="
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
141
|
+
version: 5.2.6
|
142
142
|
- - "<"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
144
|
+
version: 7.0.0
|
145
145
|
description: A mess of SMS messaging
|
146
146
|
email: martin@eimermusic.com
|
147
147
|
executables: []
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- Gemfile.lock
|
153
153
|
- LICENSE
|
154
154
|
- README.md
|
155
|
+
- example_config.rb
|
155
156
|
- lib/smess.rb
|
156
157
|
- lib/smess/logging.rb
|
157
158
|
- lib/smess/output.rb
|
@@ -172,6 +173,7 @@ files:
|
|
172
173
|
- lib/smess/utils.rb
|
173
174
|
- lib/smess/version.rb
|
174
175
|
- lib/string_ext.rb
|
176
|
+
- smess.gemspec
|
175
177
|
homepage: https://github.com/eimermusic/smess
|
176
178
|
licenses:
|
177
179
|
- MIT
|
@@ -191,8 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
193
|
- !ruby/object:Gem::Version
|
192
194
|
version: 1.3.7
|
193
195
|
requirements: []
|
194
|
-
|
195
|
-
rubygems_version: 2.5.1
|
196
|
+
rubygems_version: 3.0.3
|
196
197
|
signing_key:
|
197
198
|
specification_version: 4
|
198
199
|
summary: A messy SMS messenger supporting every aggregator I have gotten my hands
|