ruby-bulksms 0.4.1 → 0.4.3
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 +7 -0
- data/lib/net/sms/bulksms.rb +18 -18
- data/lib/net/sms/bulksms/account.rb +1 -1
- data/ruby-bulksms.gemspec +2 -2
- metadata +10 -13
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b2b7d830f91da406619536d662ac22551e90a4af
|
4
|
+
data.tar.gz: 5b111299504d09cbff2f235a3734d74d32f31104
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c64c6cc17f86298aefb959c59fef8d6f8fa35bb9f8053943ee070f7d979533752d052caf29ceddee21b60ccf69d3939837dbf76f35a5aa99a6e925e0144a44fe
|
7
|
+
data.tar.gz: 9adecd963dc13cb58ffc44b49f0ed1670028afd876aab79e4af8dfac34a7976dd48254398618a2ef50b6359d0d5f64e0dc232579d425412b5e692de71628e97d
|
data/lib/net/sms/bulksms.rb
CHANGED
@@ -46,7 +46,7 @@ module Net
|
|
46
46
|
# Sends the given Message object to the gateway for delivery
|
47
47
|
def send_message(msg)
|
48
48
|
payload = [@account.to_http_query, msg.to_http_query].join('&')
|
49
|
-
Net::HTTP.start(
|
49
|
+
Net::HTTP.start(Service.bulksms_gateway(@country), MESSAGE_SERVICE_PORT) do |http|
|
50
50
|
resp = http.post(MESSAGE_SERVICE_PATH, payload)
|
51
51
|
Response.parse(resp.body)
|
52
52
|
end
|
@@ -54,7 +54,7 @@ module Net
|
|
54
54
|
#Openning single connection & sending an array of message objects
|
55
55
|
def send_multiple(messages)
|
56
56
|
responses=[]
|
57
|
-
Net::HTTP.start(
|
57
|
+
Net::HTTP.start(Service.bulksms_gateway(@country), MESSAGE_SERVICE_PORT) do |http|
|
58
58
|
messages.each do |msg|
|
59
59
|
payload = [@account.to_http_query, msg.to_http_query].join('&')
|
60
60
|
resp = http.post(MESSAGE_SERVICE_PATH, payload)
|
@@ -69,23 +69,23 @@ module Net
|
|
69
69
|
msg = Message.new(message, recipient)
|
70
70
|
self.send_message(msg)
|
71
71
|
end
|
72
|
+
|
73
|
+
# Returns the gateway URL for the chosen country
|
74
|
+
def self.bulksms_gateway(country)
|
75
|
+
case country
|
76
|
+
when 'uk'
|
77
|
+
'www.bulksms.co.uk'
|
78
|
+
when 'usa'
|
79
|
+
'usa.bulksms.com'
|
80
|
+
when 'international'
|
81
|
+
'bulksms.vsms.net'
|
82
|
+
when 'safrica'
|
83
|
+
'bulksms.2way.co.za'
|
84
|
+
when 'spain'
|
85
|
+
'bulksms.com.es'
|
86
|
+
end
|
87
|
+
end
|
72
88
|
end
|
73
|
-
|
74
|
-
# Returns the gateway URL for the chosen country
|
75
|
-
def host(country)
|
76
|
-
case country
|
77
|
-
when 'uk'
|
78
|
-
'www.bulksms.co.uk'
|
79
|
-
when 'usa'
|
80
|
-
'usa.bulksms.com'
|
81
|
-
when 'international'
|
82
|
-
'bulksms.vsms.net'
|
83
|
-
when 'safrica'
|
84
|
-
'bulksms.2way.co.za'
|
85
|
-
when 'spain'
|
86
|
-
'bulksms.com.es'
|
87
|
-
end
|
88
|
-
end
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
@@ -23,7 +23,7 @@ module Net
|
|
23
23
|
# float to 2 decimal places. Will raise an AccountError
|
24
24
|
# if the credentials are wrong
|
25
25
|
def credits
|
26
|
-
Net::HTTP.start(
|
26
|
+
Net::HTTP.start(Service.bulksms_gateway(@country), SERVICE_PORT) do |http|
|
27
27
|
response = http.post SERVICE_PATH, self.to_http_query
|
28
28
|
if response.body.include?('|')
|
29
29
|
rsp = Response.parse(response.body)
|
data/ruby-bulksms.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "ruby-bulksms"
|
3
|
-
s.version = "0.4.
|
4
|
-
s.date = "2015-
|
3
|
+
s.version = "0.4.3"
|
4
|
+
s.date = "2015-07-02"
|
5
5
|
s.summary = "Sending SMS using bulksms services"
|
6
6
|
s.email = "eng.basayel.said@gmail.com"
|
7
7
|
s.homepage = "http://github.com/basayel/ruby-bulksms"
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-bulksms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Basayel Said
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2015-
|
11
|
+
date: 2015-07-02 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Integrating SMS services into RubyOnRails applications using BulkSMS
|
15
14
|
gateway
|
@@ -18,36 +17,34 @@ executables: []
|
|
18
17
|
extensions: []
|
19
18
|
extra_rdoc_files: []
|
20
19
|
files:
|
21
|
-
- ruby-bulksms.gemspec
|
22
20
|
- README.rdoc
|
23
|
-
- lib/
|
21
|
+
- lib/net/sms/bulksms.rb
|
24
22
|
- lib/net/sms/bulksms/account.rb
|
25
23
|
- lib/net/sms/bulksms/message.rb
|
26
24
|
- lib/net/sms/bulksms/response.rb
|
27
|
-
- lib/
|
25
|
+
- lib/ruby-bulksms.rb
|
26
|
+
- ruby-bulksms.gemspec
|
28
27
|
homepage: http://github.com/basayel/ruby-bulksms
|
29
28
|
licenses: []
|
29
|
+
metadata: {}
|
30
30
|
post_install_message:
|
31
31
|
rdoc_options: []
|
32
32
|
require_paths:
|
33
33
|
- lib
|
34
34
|
required_ruby_version: !ruby/object:Gem::Requirement
|
35
|
-
none: false
|
36
35
|
requirements:
|
37
|
-
- -
|
36
|
+
- - '>='
|
38
37
|
- !ruby/object:Gem::Version
|
39
38
|
version: '0'
|
40
39
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
40
|
requirements:
|
43
|
-
- -
|
41
|
+
- - '>='
|
44
42
|
- !ruby/object:Gem::Version
|
45
43
|
version: '0'
|
46
44
|
requirements: []
|
47
45
|
rubyforge_project:
|
48
|
-
rubygems_version:
|
46
|
+
rubygems_version: 2.2.2
|
49
47
|
signing_key:
|
50
|
-
specification_version:
|
48
|
+
specification_version: 4
|
51
49
|
summary: Sending SMS using bulksms services
|
52
50
|
test_files: []
|
53
|
-
has_rdoc: true
|