voicecom_sms 2.0.1 → 3.0.0
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 +8 -8
- data/README.md +3 -3
- data/VERSION +1 -1
- data/lib/voicecom_sms/provider.rb +7 -2
- data/spec/voicecom_sms/provider_spec.rb +0 -20
- data/voicecom_sms.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzRjM2YwZDEyZTg0ZGNjNTZkNDkwM2Y5NDA3ODNjMmU4OWFmM2ZlYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTdjOGQxZDZiMGQ5NmIyNWFmZDRiMTk3MmRmNGMxODJlYjhmNWI3OQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmVjZDk4ZjM3ZjhhZDMzZGM1NmYxZGNkYTgxNzVkYmM4NmMxZWZlNWZiZDY4
|
10
|
+
NGJkM2NiMmRhZTVjOGJlNTczZmNkMGQzOTJmNGZjZDBhOTQ1ZTY5NTdlYjE1
|
11
|
+
M2JjYTU5N2ZlMTYzODdhODkwNmFjYWRkNTY3N2VhOWI4MzdhOGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDkwZTNhOTNhNjBiMTE4Yzk3NWI4YmMzZjk4YzQ3ZDg0YzUyMWVjYjhmMGM5
|
14
|
+
M2ZlYTJjZDFlMjZlNGRiM2Q5YTI4Y2U1MmQ4ZTc3ZjIzYzYzMWQ2Y2RkNGJi
|
15
|
+
ZWEzZjEzNzVlYTk4ZjgwYjc4ZjQzOWJlZjI3MTVhMDM5YWU3ZjY=
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://travis-ci.org/empowerunited/voicecom_sms)
|
4
4
|
|
5
|
-
This
|
5
|
+
This is a interface to the VoiceCom SMS API, designed for ruby application.
|
6
6
|
|
7
7
|
## Installation & Usage
|
8
8
|
|
@@ -33,7 +33,7 @@ by filling your credentials for the VioceCom API
|
|
33
33
|
rails c
|
34
34
|
|
35
35
|
@provider = VoicecomSms::Provider.new
|
36
|
-
@provider.send_sms('
|
36
|
+
@provider.send_sms('359888889204', "Vashiyat kod e: 1234")
|
37
37
|
|
38
38
|
|
39
39
|
### irb example
|
@@ -51,7 +51,7 @@ irb
|
|
51
51
|
end
|
52
52
|
|
53
53
|
@provider = VoicecomSms::Provider.new
|
54
|
-
@provider.send_sms('
|
54
|
+
@provider.send_sms('359888889204', "Вашият код е: : 1234")
|
55
55
|
|
56
56
|
Note:
|
57
57
|
The message should match the template you have given to voicecom
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
@@ -18,6 +18,13 @@ module VoicecomSms
|
|
18
18
|
@response = nil
|
19
19
|
end
|
20
20
|
|
21
|
+
#
|
22
|
+
# Send the text message to the number
|
23
|
+
# @param number String Only digits, country code included.
|
24
|
+
# example: for Bulgaria (+359) and mobile number 899947121 you should use '359899947121'
|
25
|
+
# @param text String No idea what characters is supported by voicecom - have to experiment. UTF-8 with latin works for sure.
|
26
|
+
#
|
27
|
+
# @return integer VoicecomSms::Provider::STATUS
|
21
28
|
def send_sms(number, text)
|
22
29
|
message = VoicecomSms::Message.create({text: text, number: normalize_number(number), status: STATUS[:undefined]})
|
23
30
|
|
@@ -38,8 +45,6 @@ module VoicecomSms
|
|
38
45
|
|
39
46
|
def normalize_number(number)
|
40
47
|
number.gsub!(/\s+/, '')
|
41
|
-
number.sub!(/^(\+|00)/, '')
|
42
|
-
number.sub!(/^0/, '359')
|
43
48
|
number
|
44
49
|
end
|
45
50
|
|
@@ -33,12 +33,6 @@ describe VoicecomSms::Provider do
|
|
33
33
|
}.to change(VoicecomSms::Message, :count).by(1)
|
34
34
|
end
|
35
35
|
|
36
|
-
it "should try to convert the number to a valid one" do
|
37
|
-
@provider.send_sms("+#{destination_mobile_number}", 'some message')
|
38
|
-
message = VoicecomSms::Message.last
|
39
|
-
message.number.should == destination_mobile_number
|
40
|
-
end
|
41
|
-
|
42
36
|
it "should set the query params in the request" do
|
43
37
|
@provider.request.params.should be_blank
|
44
38
|
@provider.send_sms(destination_mobile_number, 'some message')
|
@@ -69,18 +63,4 @@ describe VoicecomSms::Provider do
|
|
69
63
|
end
|
70
64
|
end
|
71
65
|
|
72
|
-
describe "#normalize_number" do
|
73
|
-
before(:all) do
|
74
|
-
@provider = VoicecomSms::Provider.new
|
75
|
-
end
|
76
|
-
|
77
|
-
it "should convert the number to an acceptable by the API value" do
|
78
|
-
acceptable_value = destination_mobile_number
|
79
|
-
|
80
|
-
@provider.normalize_number('359899947329').should == acceptable_value
|
81
|
-
@provider.normalize_number('0899947329').should == acceptable_value
|
82
|
-
@provider.normalize_number('00359899947329').should == acceptable_value
|
83
|
-
@provider.normalize_number('+359899947329').should == acceptable_value
|
84
|
-
end
|
85
|
-
end
|
86
66
|
end
|
data/voicecom_sms.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "voicecom_sms"
|
8
|
-
s.version = "
|
8
|
+
s.version = "3.0.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Empowerunited", "Evgenia Manolova", "Gudata"]
|
12
|
-
s.date = "2013-08-
|
12
|
+
s.date = "2013-08-12"
|
13
13
|
s.description = "A fast SMS engine that uses VoiceCom as a service provider"
|
14
14
|
s.email = "devteam@empowerunited.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voicecom_sms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Empowerunited
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-08-
|
13
|
+
date: 2013-08-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|