sms_global_sender 0.0.2 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bf1becd135e8ac9cf50f9669fce3365bfd6ba3b
4
- data.tar.gz: 5e301829f604bcae40c63169bd87906bc16a1214
3
+ metadata.gz: dbbc3d28a272ad6eaaa8ca63d8d377468e8f5d59
4
+ data.tar.gz: 0073f12dd3e936c1c244d152414cf5601c22b73a
5
5
  SHA512:
6
- metadata.gz: 101770f44f81591a4e3e00b576caa56d4c08bfea3a54d3bcaab6345e702c625c67c4134e7b1d63b5b38f95563e060c80b160fe159188706e0ecf371fb13681f1
7
- data.tar.gz: 62c5175fae503d654473ca385dc61eb66fe3b8afd5f0fe42a01a7b9ba4e755662c53eb9a34db58c406c8c637468408899c73ac9998d650021242b81ba5b3663f
6
+ metadata.gz: f0e8a555f8ffa3da6de3cac9b263ddf08ac3e8592d8c6f45b7d80be6307baf5dbda7576368f8ca20f77aa20946a451014ae82d89ad33109bdc6dbd372d672a12
7
+ data.tar.gz: efcb12318958ac14fa99a62da8d2da4103d7cf392961ff64712458dc6a616d1cfea5734ee44233a74d73284c833290b5c91a02bae2c32c22628b46a3f3c8d55d
data/lib/sms_sender.rb CHANGED
@@ -19,9 +19,10 @@ class SmsSender
19
19
  'Content-Type' => 'application/json',
20
20
  'Accept' => 'application/json'}
21
21
 
22
+ protocol = port == 443 ? 'https' : 'http'
22
23
  body = {"origin"=>title, "destination"=>mobile, "message"=>msg }
23
24
 
24
- response = HTTParty.post("https://#{@host}#{@request_url}", headers: header, body: body.to_json)
25
+ response = HTTParty.post("#{protocol}://#{@host}#{@request_url}", headers: header, body: body.to_json)
25
26
  response.code
26
27
  end
27
28
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'sms_global_sender'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3'
4
4
  s.date = '2014-02-05'
5
5
  s.summary = "Send sms through SMS gateway"
6
6
  s.description = "specific to smsglobal.com.au"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sms_global_sender
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Gao