smess 1.0.5 → 1.0.6
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 +4 -4
- data/Gemfile.lock +7 -7
- data/lib/smess/outputs/iconectiv.rb +6 -0
- data/lib/smess/outputs/twilio.rb +9 -5
- data/lib/smess/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d27bd662c404443430183629296cecbc62c362a
|
4
|
+
data.tar.gz: 643bb0580e883812d0cdd393f79b0beafb9ea322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db8efdce52b1018f4d685a9cee3932284888fd683e4c6c01201966a9e3101a9b6ed9e39e0aa8ef55f443d1b3789fbed1a47c081dbad992cde5f3bd0bb3f88393
|
7
|
+
data.tar.gz: da1094b2d4cedcbbe341a03b638117e5e5100d4699126827f311a1314ffdb6f2426983ebbbd8389ab121591d7e8e500b3085b3fbe7d7078297c75e9751843214
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smess (1.0.
|
4
|
+
smess (1.0.5)
|
5
5
|
activesupport (>= 3.0)
|
6
6
|
clickatell
|
7
7
|
httpi
|
@@ -30,7 +30,7 @@ GEM
|
|
30
30
|
builder (>= 2.1.2)
|
31
31
|
httpi (1.1.1)
|
32
32
|
rack
|
33
|
-
i18n (0.6.
|
33
|
+
i18n (0.6.9)
|
34
34
|
jahtml_formatter (1.0.5)
|
35
35
|
rspec (~> 2.14)
|
36
36
|
jwt (0.1.8)
|
@@ -38,10 +38,10 @@ GEM
|
|
38
38
|
mail (2.5.4)
|
39
39
|
mime-types (~> 1.16)
|
40
40
|
treetop (~> 1.4.8)
|
41
|
-
mime-types (1.25)
|
42
|
-
mini_portile (0.5.
|
41
|
+
mime-types (1.25.1)
|
42
|
+
mini_portile (0.5.2)
|
43
43
|
minitest (4.7.5)
|
44
|
-
multi_json (1.8.
|
44
|
+
multi_json (1.8.2)
|
45
45
|
nokogiri (1.6.0)
|
46
46
|
mini_portile (~> 0.5.0)
|
47
47
|
nori (1.1.5)
|
@@ -72,11 +72,11 @@ GEM
|
|
72
72
|
treetop (1.4.15)
|
73
73
|
polyglot
|
74
74
|
polyglot (>= 0.3.1)
|
75
|
-
twilio-ruby (3.11.
|
75
|
+
twilio-ruby (3.11.4)
|
76
76
|
builder (>= 2.1.2)
|
77
77
|
jwt (>= 0.1.2)
|
78
78
|
multi_json (>= 1.3.0)
|
79
|
-
tzinfo (0.3.
|
79
|
+
tzinfo (0.3.38)
|
80
80
|
wasabi (2.5.1)
|
81
81
|
httpi (~> 1.0)
|
82
82
|
nokogiri (>= 1.4.0)
|
@@ -7,5 +7,11 @@ module Smess
|
|
7
7
|
"ICONECTIV"
|
8
8
|
end
|
9
9
|
|
10
|
+
# iConectiv asserts that this is all that is still reqquired and that it wont break other carriers.
|
11
|
+
# test of major carriers confirm this too... let's see how the small ones do.
|
12
|
+
def perform_operator_adaptation(msisdn)
|
13
|
+
adapt_for_t_mobile_us msisdn
|
14
|
+
end
|
15
|
+
|
10
16
|
end
|
11
17
|
end
|
data/lib/smess/outputs/twilio.rb
CHANGED
@@ -35,13 +35,9 @@ module Smess
|
|
35
35
|
Smess.separate_sms(sms.message.strip_nongsm_chars).reject {|s| s.empty? }
|
36
36
|
end
|
37
37
|
|
38
|
-
def client
|
39
|
-
@client ||= ::Twilio::REST::Client.new(ENV["SMESS_TWILIO_SID"], ENV["SMESS_TWILIO_AUTH_TOKEN"])
|
40
|
-
end
|
41
|
-
|
42
38
|
def send_one_sms(message)
|
43
39
|
begin
|
44
|
-
response =
|
40
|
+
response = create_client_message({
|
45
41
|
from: from,
|
46
42
|
to: "+#{sms.to}",
|
47
43
|
body: message,
|
@@ -54,6 +50,14 @@ module Smess
|
|
54
50
|
result
|
55
51
|
end
|
56
52
|
|
53
|
+
def create_client_message(params)
|
54
|
+
client.account.sms.messages.create(params)
|
55
|
+
end
|
56
|
+
|
57
|
+
def client
|
58
|
+
@client ||= ::Twilio::REST::Client.new(ENV["SMESS_TWILIO_SID"], ENV["SMESS_TWILIO_AUTH_TOKEN"])
|
59
|
+
end
|
60
|
+
|
57
61
|
def normal_result(response)
|
58
62
|
response_code = response.status
|
59
63
|
response_code = "0" unless response.status == "failed"
|
data/lib/smess/version.rb
CHANGED
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: 1.0.
|
4
|
+
version: 1.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:
|
11
|
+
date: 2014-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|