ruby_hlr_client 0.0.11 → 0.0.12

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODQ4ODhlZGMwM2Q4ZmMyOWRjZjEzN2NlYzc1ODM0MWY4NzQyMjg4Nw==
4
+ YWM2ODVlYTQyNDg5ODQxMTgxMmIyNTU5YWJlOGRjMWQwY2I3MjI3Yg==
5
5
  data.tar.gz: !binary |-
6
- MmRmYjY2NzZkYjY2NmE4ODJjOWY4NjhjNTczNmEzNTYzNzY4OTk1MA==
6
+ MTljYzM5OTdhOTJkYzZjYzJlNTVmMWJjNmVkN2E4NjNlNGZhZjdjYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzU0ZTI5MzM5Y2I5ZWZlMWVmMmQxOGY2Mjk3OTNhNGE1ZjUwNTk4NWRmMDlj
10
- NjI4OWI5ZTUwNjJiOGExOTM1ZjdlZDg1ZTNhN2YyNmU5NDJkOTVjYzNlMDVl
11
- YmI3MmJkY2EwOTU2OTgwZWY1MTJhOTA3ZGRmMjQ1NDg0OGJjZDk=
9
+ MjMxYWExNDA1MzJhNWNmNTY2MzU3MDA3NjYyNGRhYTg4NjY4NmUxMjhkYmM1
10
+ MWYxYzBhOGE3YmExMjI2OGE3OWQxYmY5ZmNlZjQyMzVlYjc0MmRhNjdjOTEy
11
+ NmUzYjhhMDY2NmY5NGQ2M2ZlMTI1MWQ2ZTU4ODU0MjY3NTY0YWU=
12
12
  data.tar.gz: !binary |-
13
- ZWU0NWZmODk1NWVjMjExODNlNTNkYmRjNzg0ODlmOTZhMjJjNDcwYzEzODA0
14
- YzBlNDY1YzM0YTZlNzU1OTMzZGJjMjI5MzljYWQ1YmYzYjVlOWI5NzgzNmMy
15
- NzIxNjgxMmI1YmE2MzIxYzcxMmViMzE0NWFmNWU4YjdlYjdhYjg=
13
+ MjRjY2QxYzQ5NWFiNGRkYTdjYTE1MjcyOTk3ZWExMjY0YWJlN2ZlMTk3MmUx
14
+ ZDgzNzQ2YWVmNGQ2NDY4N2EyOTcwODRkNzA1Mjc5ZTVjNzdjMjBmODY1N2Rj
15
+ M2QwMTJmNTY2MGVhNzc3MzcxYzMyMDllNTYyYmMyMjA0MDhiMmQ=
@@ -0,0 +1,2 @@
1
+ 1. rake install
2
+ 2. cd pkg/; gem push ruby_hlr_client-VERSION.gem
@@ -1,4 +1,5 @@
1
1
  require 'rest_client'
2
+ require 'json'
2
3
 
3
4
  module RubyHlrClient
4
5
 
@@ -12,7 +13,7 @@ module RubyHlrClient
12
13
  def initialize(username, password, ssl = true)
13
14
  @username = username
14
15
  @password = password
15
- @url = "#{ssl ? 'https' : 'http'}://www.hlr-lookups.com/api"
16
+ @url = "#{ssl ? 'https' : 'http'}://www.hlrd-lookups.com/api"
16
17
  end
17
18
 
18
19
  # Submits a synchronous HLR Lookup request. The HLR is queried in real time and results presented in the response body.
@@ -101,9 +102,14 @@ module RubyHlrClient
101
102
 
102
103
  end
103
104
 
104
- def send_request(params)
105
+ private
106
+ def send_request(query)
105
107
 
106
- response = RestClient.get @url, :params => params
108
+ begin
109
+ response = RestClient.get @url, :params => query
110
+ rescue => e
111
+ return generate_error_result("HTTP Status Code #{e.message}")
112
+ end
107
113
 
108
114
  unless response.code == 200
109
115
  return generate_error_result("HTTP Status Code #{response.code}")
@@ -113,6 +119,7 @@ module RubyHlrClient
113
119
 
114
120
  end
115
121
 
122
+ private
116
123
  def generate_error_result(message)
117
124
 
118
125
  {:success => false, :fieldErrors => [], :globalErrors => ["#{message}"]}.to_json
@@ -1,3 +1,3 @@
1
1
  module RubyHlrClient
2
- VERSION = '0.0.11'
2
+ VERSION = '0.0.12'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_hlr_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Velocity Made Good Ltd.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -66,6 +66,7 @@ files:
66
66
  - Rakefile
67
67
  - bin/test_callback_handler.rb
68
68
  - bin/test_client.rb
69
+ - create_gem.txt
69
70
  - lib/ruby_hlr_client.rb
70
71
  - lib/ruby_hlr_client/hlr_callback_handler.rb
71
72
  - lib/ruby_hlr_client/hlr_client.rb