luka-multiinfo 0.0.5 → 0.0.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.
- data/VERSION +1 -1
- data/lib/multiinfo/api.rb +19 -0
- data/lib/multiinfo/api/command.rb +1 -1
- data/lib/multiinfo/api/response.rb +23 -2
- data/multiinfo.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/multiinfo/api.rb
CHANGED
@@ -45,6 +45,13 @@ module MultiInfo
|
|
45
45
|
parse_response(response)
|
46
46
|
end
|
47
47
|
|
48
|
+
|
49
|
+
# Sends a package of messages. Recipient
|
50
|
+
# number should have an international dialing prefix
|
51
|
+
def send_package
|
52
|
+
# todo
|
53
|
+
end
|
54
|
+
|
48
55
|
|
49
56
|
# Returns the status of a message. Use sms ID returned
|
50
57
|
# from original send_message call.
|
@@ -53,6 +60,13 @@ module MultiInfo
|
|
53
60
|
parse_response(response)
|
54
61
|
end
|
55
62
|
|
63
|
+
# Returns the status of a package of messages. Use package id returned
|
64
|
+
# from original send_package call.
|
65
|
+
def package_info(package_id)
|
66
|
+
response = execute_command('packageinfo', :package_id => package_id)
|
67
|
+
parse_response(response)
|
68
|
+
end
|
69
|
+
|
56
70
|
# Returns the status of a message. Use sms ID returned
|
57
71
|
# from original send_message call.
|
58
72
|
def cancel_message(sms_id)
|
@@ -60,6 +74,11 @@ module MultiInfo
|
|
60
74
|
parse_response(response)
|
61
75
|
end
|
62
76
|
|
77
|
+
def get_message(opts={})
|
78
|
+
valid_options = opts.only(:timeout).merge(service_id)
|
79
|
+
response = execute_command('getsms', valid_options)
|
80
|
+
parse_response(response)
|
81
|
+
end
|
63
82
|
|
64
83
|
def sms_requests #:nodoc:
|
65
84
|
@sms_requests ||= []
|
@@ -9,12 +9,12 @@ module MultiInfo
|
|
9
9
|
def parse(response_arr)
|
10
10
|
return { :status => 'OK' } if API.test_mode
|
11
11
|
command, http_response = response_arr
|
12
|
-
response_rows = http_response.split(
|
12
|
+
response_rows = http_response.split(/\r\n|\n/)
|
13
13
|
response_status, response_body = response_rows[0], response_rows[1..-1]
|
14
14
|
if response_status.to_i < 0
|
15
15
|
raise MultiInfo::API::Error.new(response_status, response_body.first)
|
16
16
|
else
|
17
|
-
response_hash(command, response_body).merge({:status => response_status
|
17
|
+
response_hash(command, response_body).merge({:status => response_status})
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -55,7 +55,28 @@ module MultiInfo
|
|
55
55
|
:destination, # 15
|
56
56
|
:message_status, # 16
|
57
57
|
:status_date # 17
|
58
|
+
],
|
59
|
+
|
60
|
+
'packageinfo' => [
|
61
|
+
:package_id, # 2
|
62
|
+
:sent_message_count, # 3
|
63
|
+
:waiting_message_count,# 4
|
64
|
+
:package_status # 5
|
65
|
+
],
|
66
|
+
|
67
|
+
'getsms' => [
|
68
|
+
:sms_id, # 2
|
69
|
+
:sender, # 3
|
70
|
+
:destination, # 4
|
71
|
+
:message_type, # 5
|
72
|
+
:message_body, # 6
|
73
|
+
:protocol_id, # 7
|
74
|
+
:coding_scheme, # 8
|
75
|
+
:service_id, # 9
|
76
|
+
:conector_id, # 9
|
77
|
+
:receive_date # 10
|
58
78
|
]
|
79
|
+
|
59
80
|
}
|
60
81
|
|
61
82
|
end
|
data/multiinfo.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{multiinfo}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["\305\201ukasz \305\201uczak"]
|
9
|
-
s.date = %q{2009-08-
|
9
|
+
s.date = %q{2009-08-06}
|
10
10
|
s.description = %q{This gem is Ruby interface to the Polkomtel's MultiInfo SMS gateway service, based on Luke Redpath's clickatel library. To use this gem, you will need an access to Polkomtel's MultiInfo service. You need user, password, sercvice_id and certificate for ssl connection. Contact Polkomtel sales reps for info how to obtain acces to MultiInfo service.}
|
11
11
|
s.email = %q{luka@weblify.pl}
|
12
12
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luka-multiinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "\xC5\x81ukasz \xC5\x81uczak"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-06 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|