it_cloud_sms 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/it_cloud_sms.rb +11 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0951cd6212f67c4767d610d00011230641445aad
4
- data.tar.gz: 6428a668bed832d953bf2e5c47a1f16f1134be7c
3
+ metadata.gz: 910f1072c6d6694ebe553554c5201d02ead8f482
4
+ data.tar.gz: 96c67751698ad419498201f5cfedcca42fb002a6
5
5
  SHA512:
6
- metadata.gz: 0dcc0ab968e3787543d84a16d6e53a426dffffd37cabdf570ad37a9bdf454435c6a86a94440ed663a5159aaa04105c4ab5e6fe5cb6e3e3dec79feb3af9a92fc1
7
- data.tar.gz: c38f03c1a8a802acf7273feef39d36bef3210fab7540234f2e501737dfe97c4f8a5f78afa404674ae4a402b1a818b9741a5d52830a73eeaf88a49a42a319639f
6
+ metadata.gz: 575e2f4c9da890dcaa9c5589250463936f79e9a1ea277393c7353bfb72d470681a26b1ca0fe646811c9c687af69c313d420983b78b81d32559729d538894c0a0
7
+ data.tar.gz: a78925dbc37bfb62cd18669d03be241080e8d49962782f8f52ef9a09065a4d1b73f28052fb0006b15b3ba66feded126a988642474a72c58872124e4538d2902d
data/lib/it_cloud_sms.rb CHANGED
@@ -64,7 +64,12 @@ module ItCloudSms
64
64
 
65
65
  response = http.request(request)
66
66
  if response.code == "200"
67
- result = response.body.split("<br>").map{ |a| a.split(",") }.map{ |res| {:telephone => res[0].strip, :code => res[1].strip }}
67
+ begin
68
+ result = response.body.split("<br>").map{ |a| a.split(",") }.map{ |res| {:telephone => res[0].strip, :code => res[1].strip }}
69
+ rescue
70
+ # Try to get petition result
71
+ result = [{:code => response.body}]
72
+ end
68
73
  result.each do |destination|
69
74
  case destination[:code]
70
75
  when "-1" then
@@ -84,7 +89,11 @@ module ItCloudSms
84
89
  when "0" then
85
90
  destination[:description] = "Operator not found"
86
91
  else
87
- destination[:description] = "OK"
92
+ if destination[:code].to_i == 0
93
+ destination[:description] = "Unknown error"
94
+ else
95
+ destination[:description] = "OK"
96
+ end
88
97
  end
89
98
  end
90
99
  return result
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: it_cloud_sms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angel García Pérez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2015-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: global_phone
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.0.6
110
+ rubygems_version: 2.0.14
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: IT Cloud Services Colombia send SMS HTTP gateway