smess 2.0.5 → 2.0.6

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
- SHA1:
3
- metadata.gz: f232022239ca55009627ad67ee16bd5f5e493885
4
- data.tar.gz: 73d9a6886dbbf049aba069fc0db0bc002a571b78
2
+ SHA256:
3
+ metadata.gz: 1a7753165d1cb7c418b6d7f5860452bca11b39481dafcc49b59ae20a8d0298c0
4
+ data.tar.gz: 3c3a95629bd39d391862375982ffd1ab2943545515deefa9c93a848d0080a9ae
5
5
  SHA512:
6
- metadata.gz: 5569c0d2cd1d35342209a2a55f51489d181cf9d1cb854949b665c7da0f8b36081967726d05d18ddf35f6e72404c4fa636f659d9dc274fb329906ff1801e84265
7
- data.tar.gz: 259e15b912d452c543ada8268aa51c2c8f6712453c89c15e73ddcddcb3dff3431ccb500fa1ae6587d4a2a2dafdba699b505085dd5df220e7c05b4366a1ee1c60
6
+ metadata.gz: 1153e820da9ae577f99575e24d82fd03b5df232dfc52d9339fc5666d0f22c954d1c2b4b61093ddebc0976238c85483a044d09497ada17a7c2b81be835d7b1baa
7
+ data.tar.gz: 3a3afb95ff2c60d9424bc7fa0dc1296bfd466ae59d5fa0a72681cb44b668a6d325784c7803296ef6bc2467f20753235431d458d705de7667979ca2ba426d844e
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smess (2.0.4)
5
- activesupport (>= 3.0.0, < 7.0.0)
4
+ smess (2.0.5)
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,60 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (5.2.4.1)
15
+ activesupport (6.1.4.1)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (>= 0.7, < 2)
18
- minitest (~> 5.1)
19
- tzinfo (~> 1.1)
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.6)
26
+ concurrent-ruby (1.1.9)
26
27
  diff-lcs (1.3)
27
28
  docile (1.3.2)
28
29
  dotenv (2.7.5)
29
- faraday (1.0.0)
30
+ faraday (1.7.1)
31
+ faraday-em_http (~> 1.0)
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)
30
39
  multipart-post (>= 1.2, < 3)
40
+ ruby2_keywords (>= 0.0.4)
41
+ faraday-em_http (1.0.0)
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)
31
49
  gyoku (0.4.6)
32
50
  builder (>= 2.1.2)
33
51
  httpi (1.1.1)
34
52
  rack
35
- i18n (1.8.2)
53
+ i18n (1.8.10)
36
54
  concurrent-ruby (~> 1.0)
37
55
  json (2.3.0)
38
- jwt (2.2.1)
56
+ jwt (2.2.3)
39
57
  mail (2.7.1)
40
58
  mini_mime (>= 0.1.1)
41
- mini_mime (1.0.2)
42
- mini_portile2 (2.4.0)
43
- minitest (5.14.0)
59
+ mini_mime (1.1.1)
60
+ mini_portile2 (2.6.1)
61
+ minitest (5.14.4)
44
62
  multipart-post (2.1.1)
45
- nokogiri (1.10.9)
46
- mini_portile2 (~> 2.4.0)
63
+ nokogiri (1.12.4)
64
+ mini_portile2 (~> 2.6.1)
65
+ racc (~> 1.4)
47
66
  nori (1.1.5)
48
- rack (2.2.2)
67
+ racc (1.5.2)
68
+ rack (2.2.3)
49
69
  rspec (3.9.0)
50
70
  rspec-core (~> 3.9.0)
51
71
  rspec-expectations (~> 3.9.0)
@@ -59,6 +79,7 @@ GEM
59
79
  diff-lcs (>= 1.2.0, < 2.0)
60
80
  rspec-support (~> 3.9.0)
61
81
  rspec-support (3.9.2)
82
+ ruby2_keywords (0.0.5)
62
83
  savon (1.2.0)
63
84
  akami (~> 1.2.0)
64
85
  builder (>= 2.1.2)
@@ -72,16 +93,16 @@ GEM
72
93
  json (>= 1.8, < 3)
73
94
  simplecov-html (~> 0.10.0)
74
95
  simplecov-html (0.10.2)
75
- thread_safe (0.3.6)
76
- twilio-ruby (5.31.6)
77
- faraday (~> 1.0.0)
96
+ twilio-ruby (5.58.2)
97
+ faraday (>= 0.9, < 2.0)
78
98
  jwt (>= 1.5, <= 2.5)
79
99
  nokogiri (>= 1.6, < 2.0)
80
- tzinfo (1.2.6)
81
- thread_safe (~> 0.1)
100
+ tzinfo (2.0.4)
101
+ concurrent-ruby (~> 1.0)
82
102
  wasabi (2.5.1)
83
103
  httpi (~> 1.0)
84
104
  nokogiri (>= 1.4.0)
105
+ zeitwerk (2.4.2)
85
106
 
86
107
  PLATFORMS
87
108
  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
@@ -19,7 +19,7 @@ module Smess
19
19
  end
20
20
 
21
21
  def deliver
22
- send_one_sms sms.message.strip_nongsm_chars
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.strip_nongsm_chars).reject {|s| s.empty? }
34
+ Smess.separate_sms(sms.message).reject {|s| s.empty? }
35
35
  end
36
36
 
37
37
  def send_one_sms(message)
@@ -46,9 +46,12 @@ module Smess
46
46
  else
47
47
  opts[:from] = from
48
48
  end
49
+ puts "about to create_client_message"
49
50
  response = create_client_message(opts)
51
+ puts "got response #{response.inspect}"
50
52
  result = normal_result(response)
51
53
  rescue => e
54
+ puts "got exception #{e.inspect}"
52
55
  result = result_for_error(e)
53
56
  end
54
57
  result
@@ -97,7 +100,7 @@ module Smess
97
100
  def result_data
98
101
  {
99
102
  to: sms.to,
100
- text: sms.message.strip_nongsm_chars,
103
+ text: sms.message,
101
104
  from: from
102
105
  }
103
106
  end
data/lib/smess/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Smess
2
- VERSION = '2.0.5'
2
+ VERSION = '2.0.6'
3
3
  end
data/lib/string_ext.rb CHANGED
@@ -62,7 +62,7 @@ class String
62
62
  end
63
63
 
64
64
  pattern = Regexp.new( "[^"+allowed+"]" )
65
- self.gsub!(pattern,"")
65
+ self.gsub!(pattern, replacement)
66
66
  end
67
67
 
68
68
 
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.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Westin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-17 00:00:00.000000000 Z
11
+ date: 2021-09-10 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: 3.0.0
131
+ version: 5.2.6
132
132
  - - "<"
133
133
  - !ruby/object:Gem::Version
134
- version: 6.0.0
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: 3.0.0
141
+ version: 5.2.6
142
142
  - - "<"
143
143
  - !ruby/object:Gem::Version
144
- version: 6.0.0
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
- rubyforge_project:
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