textveloper 0.1.5 → 0.1.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/lib/textveloper/version.rb +1 -1
- data/lib/textveloper.rb +11 -6
- data/spec/lib/textveloper_spec.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78e5661ebae07a5d06455e310099e6423e09e384
|
4
|
+
data.tar.gz: 6cafa7251f0c04ec359bb8355e9aeddf6cf39fea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2276a163fd52175f4b3ced6c747ed42f66675a386a8f4ff2b185f5530a61dae46791ae240768d0ab17753cba2480c0045508cff45e122f1386fa09f3b5f1ea31
|
7
|
+
data.tar.gz: 84ca58c55c24a260e04180a5377e540b4b33ed1b86407037f4a0f43a118ddaa4deaf43b3ac37c154aacb5a7e734810894a175f1060e0e362a8c38626f70a6144
|
data/lib/textveloper/version.rb
CHANGED
data/lib/textveloper.rb
CHANGED
@@ -32,7 +32,7 @@ module Textveloper
|
|
32
32
|
return Curl.post(url + api_actions[:enviar] + '/', data ).body_str
|
33
33
|
end
|
34
34
|
|
35
|
-
#Servicio SMS
|
35
|
+
#Servicio SMS
|
36
36
|
|
37
37
|
def send_sms(number,message)
|
38
38
|
response = []
|
@@ -51,11 +51,13 @@ module Textveloper
|
|
51
51
|
if message.size <= 160
|
52
52
|
numbers.each do |number|
|
53
53
|
response << core_operation(number, message)
|
54
|
+
slow_sms
|
54
55
|
end
|
55
56
|
else
|
56
57
|
numbers.each do |number|
|
57
58
|
chunck_message(message).each do |m|
|
58
59
|
response << core_operation(number,m)
|
60
|
+
slow_sms
|
59
61
|
end
|
60
62
|
end
|
61
63
|
end
|
@@ -70,7 +72,7 @@ module Textveloper
|
|
70
72
|
:cuenta_token => @account_token_number,
|
71
73
|
:subcuenta_token => @subaccount_token_number
|
72
74
|
}
|
73
|
-
end
|
75
|
+
end
|
74
76
|
|
75
77
|
def account_data
|
76
78
|
{
|
@@ -97,11 +99,11 @@ module Textveloper
|
|
97
99
|
def transfer_history
|
98
100
|
hash_contructor(Curl.post(url + api_actions[:transferencias] + '/',transactional_data).body_str)
|
99
101
|
end
|
100
|
-
|
102
|
+
|
101
103
|
#metodos de formato de data
|
102
104
|
|
103
105
|
def show_format_response(numbers,response)
|
104
|
-
hash_constructor_with_numbers(numbers,response)
|
106
|
+
hash_constructor_with_numbers(numbers,response)
|
105
107
|
end
|
106
108
|
|
107
109
|
def hash_constructor_with_numbers(numbers,response)
|
@@ -116,7 +118,7 @@ module Textveloper
|
|
116
118
|
|
117
119
|
def format_phone(phone_number)
|
118
120
|
phone_number.nil? ? "" : phone_number.gsub(/\W/,"").sub(/^58/,"").sub(/(^4)/, '0\1')
|
119
|
-
end
|
121
|
+
end
|
120
122
|
|
121
123
|
def hash_contructor(response)
|
122
124
|
JSON.parse(response)
|
@@ -131,9 +133,12 @@ module Textveloper
|
|
131
133
|
arr.map!.with_index {|elem,i| elem << " #{i+1}/#{arr.size}" }
|
132
134
|
end
|
133
135
|
|
136
|
+
def slow_sms
|
137
|
+
sleep(1)
|
138
|
+
end
|
134
139
|
|
135
140
|
def url
|
136
|
-
'http://api.textveloper.com/'
|
141
|
+
'http://api.textveloper.com/'
|
137
142
|
end
|
138
143
|
end
|
139
144
|
end
|
@@ -62,6 +62,7 @@ describe Textveloper do
|
|
62
62
|
notificator.send(:format_phone,"+58-412.158.58.58").should eq("04121585858")
|
63
63
|
notificator.send(:format_phone,"58.412.1.2.3.4.5.6.7").should eq("04121234567")
|
64
64
|
notificator.send(:format_phone,"+58 412 123 45 67").should eq("04121234567")
|
65
|
+
notificator.send(:format_phone,"(0412)1234567").should eq("04121234567")
|
65
66
|
|
66
67
|
end
|
67
68
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: textveloper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gustavo Gimenez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curb
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
136
|
+
rubygems_version: 2.3.0
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: Gema para el envío de sms en Venezuela a tráves del servicio de Textveloper
|