luka-multiinfo 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -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 ||= []
@@ -2,7 +2,7 @@ require "cgi"
2
2
  module MultiInfo
3
3
  class API
4
4
  API_SERVICE_HOST = 'https://www.multiinfo.plus.pl/'
5
- API_NAME = 'smsapi3'
5
+ API_NAME = 'smsapi4'
6
6
  API_SCRIPT_TYPE = 'aspx'
7
7
 
8
8
  class Command
@@ -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("\n")
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.chop})
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
@@ -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"
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-04}
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.5
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-04 00:00:00 -07:00
12
+ date: 2009-08-06 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency