cb-api 14.0.1 → 14.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ Version History
2
+ ====
3
+ * All Version bumps are required to update this file as well!!
4
+ ----
5
+ * 14.1.0 Adding custom error for Authentication Outages
6
+ * 14.0.1 Introduced a changelog (finally)
7
+ * 14.0.0 Rename location_code / zip to postal_code on the Cb::Models::User model to be more i18n friendly
8
+ * 13.0.1 This change is to turn off metadata parsing and raise exception if the api response does not contain metadata.
9
+ * This means we can optionally control wether or not a specific API call expects metadata to come back
10
+ * 13.0.0 Adds a new resume recommendations call and removes the old one *(BREAKING)*
11
+ * https://github.com/cbdr/ruby-cb-api/pull/154/files
@@ -2,4 +2,5 @@ module Cb
2
2
  class IncomingParamIsWrongTypeException < StandardError; end
3
3
  class ExpectedResponseFieldMissing < StandardError; end
4
4
  class ApiResponseError < StandardError; end
5
+ class ServiceUnavailableError < ApiResponseError; end
5
6
  end
@@ -6,6 +6,18 @@ module Cb
6
6
 
7
7
  class << self
8
8
  def validate(response)
9
+ raise_response_code_errors(response)
10
+ process_response_body(response)
11
+ end
12
+
13
+ private
14
+
15
+ def raise_response_code_errors(response)
16
+ code = response.code rescue nil
17
+ raise Cb::ServiceUnavailableError if code == 503
18
+ end
19
+
20
+ def process_response_body(response)
9
21
  body = response.response.body rescue nil
10
22
  return Hash.new if !body
11
23
 
@@ -16,8 +28,6 @@ module Cb
16
28
  try_parse_json(body) || try_parse_xml(body) || {}
17
29
  end
18
30
 
19
- private
20
-
21
31
  def try_parse_json(body)
22
32
  begin
23
33
  JSON.parse(body)
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '14.0.1'
2
+ VERSION = '14.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.0.1
4
+ version: 14.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-09 00:00:00.000000000 Z
12
+ date: 2014-10-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -358,6 +358,7 @@ files:
358
358
  - lib/cb/utils/api.rb
359
359
  - lib/cb/utils/response_map.rb
360
360
  - lib/cb/utils/fluid_attributes.rb
361
+ - CHANGELOG.md
361
362
  - README.md
362
363
  homepage: http://api.careerbuilder.com
363
364
  licenses: