it_cloud_sms 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/it_cloud_sms.rb +23 -19
- metadata +84 -57
- checksums.yaml +0 -7
data/lib/it_cloud_sms.rb
CHANGED
@@ -64,26 +64,30 @@ module ItCloudSms
|
|
64
64
|
|
65
65
|
response = http.request(request)
|
66
66
|
if response.code == "200"
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
67
|
+
result = response.body.split("<br>").map{ |a| a.split(",") }.map{ |res| {:telephone => res[0].strip, :code => res[1].strip }}
|
68
|
+
result.each do |destination|
|
69
|
+
case destination[:code]
|
70
|
+
when "-1" then
|
71
|
+
destination[:description] = "Authentication failed"
|
72
|
+
when "-2" then
|
73
|
+
destination[:description] = "Out of hours"
|
74
|
+
when "-3" then
|
75
|
+
destination[:description] = "No credit"
|
76
|
+
when "-4" then
|
77
|
+
destination[:description] = "Wrong number"
|
78
|
+
when "-5" then
|
79
|
+
destination[:description] = "Wrong message"
|
80
|
+
when "-6" then
|
81
|
+
destination[:description] = "System under maintenance"
|
82
|
+
when "-7" then
|
83
|
+
destination[:description] = "Max cellphones reached"
|
84
|
+
when "0" then
|
85
|
+
destination[:description] = "Operator not found"
|
86
|
+
else
|
87
|
+
destination[:description] = "OK"
|
88
|
+
end
|
86
89
|
end
|
90
|
+
return result
|
87
91
|
else
|
88
92
|
raise RuntimeError, "Server responded with code #{response.code}: #{response.body}"
|
89
93
|
end
|
metadata
CHANGED
@@ -1,86 +1,113 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: it_cloud_sms
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
5
11
|
platform: ruby
|
6
|
-
authors:
|
7
|
-
- Angel
|
12
|
+
authors:
|
13
|
+
- "Angel Garc\xC3\xADa P\xC3\xA9rez"
|
8
14
|
autorequire:
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
|
18
|
+
date: 2014-07-24 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
14
22
|
name: phone
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
|
-
type: :runtime
|
21
23
|
prerelease: false
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - "="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 15
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
version: "1.0"
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
28
37
|
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.8.7
|
34
|
-
type: :development
|
35
38
|
prerelease: false
|
36
|
-
|
37
|
-
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
38
42
|
- - ~>
|
39
|
-
- !ruby/object:Gem::Version
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 49
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 8
|
48
|
+
- 7
|
40
49
|
version: 0.8.7
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '>'
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.3.1
|
48
50
|
type: :development
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: rspec
|
49
54
|
prerelease: false
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 25
|
61
|
+
segments:
|
62
|
+
- 1
|
63
|
+
- 3
|
64
|
+
- 1
|
54
65
|
version: 1.3.1
|
55
|
-
|
56
|
-
|
66
|
+
type: :development
|
67
|
+
version_requirements: *id003
|
68
|
+
description: A gateway to send SMS using HTTP POST, through IT Cloud Services Colombia, written in ruby
|
57
69
|
email: wage83@gmail.com
|
58
70
|
executables: []
|
71
|
+
|
59
72
|
extensions: []
|
73
|
+
|
60
74
|
extra_rdoc_files: []
|
61
|
-
|
75
|
+
|
76
|
+
files:
|
62
77
|
- lib/it_cloud_sms.rb
|
78
|
+
has_rdoc: true
|
63
79
|
homepage: http://www.itcloudcolombia.com/?page_id=23
|
64
80
|
licenses: []
|
65
|
-
|
81
|
+
|
66
82
|
post_install_message:
|
67
83
|
rdoc_options: []
|
68
|
-
|
84
|
+
|
85
|
+
require_paths:
|
69
86
|
- lib
|
70
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 3
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
hash: 3
|
102
|
+
segments:
|
103
|
+
- 0
|
104
|
+
version: "0"
|
80
105
|
requirements: []
|
106
|
+
|
81
107
|
rubyforge_project:
|
82
|
-
rubygems_version:
|
108
|
+
rubygems_version: 1.4.2
|
83
109
|
signing_key:
|
84
|
-
specification_version:
|
110
|
+
specification_version: 3
|
85
111
|
summary: IT Cloud Services Colombia send SMS HTTP gateway
|
86
112
|
test_files: []
|
113
|
+
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: c5f375d9aed19221f56d16fc319448177b665d08
|
4
|
-
data.tar.gz: e5358268ed6afae1fc4bf51b9c69f579a3e279d7
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 7996a169560aec7616487f63c774fd604c10935db584f53e15e822c5790b04c356770ff23a5c088f82c5b5c2efaf56a511daa9c0e1cd052cbd1a7ca3e25e9c3d
|
7
|
-
data.tar.gz: 502be17f4a7b5c17add4ec2f68f12c2c0fe7f2bcb26685cace6729267bc98b4bcfc0c81a329a7b92268e6437dcaddef1fc8acd8775ae12ff859de1dc727af6b7
|