tops_connect 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95b4f16522eadb2e981fd33ba3adb60e12bff246
4
- data.tar.gz: ccfd2764f518526d2f8ac99851d0de66571d3740
3
+ metadata.gz: 3430e8a541b493b7f8463528b31f2d9c3e29a867
4
+ data.tar.gz: 4d60f6d1530827e9b9f66403ce56ce7a0dfa43b0
5
5
  SHA512:
6
- metadata.gz: 5e1bb17fe63ffef4a29f9b459272dce0f770a9173c3e1eb2b0b2dd1aabe2ce5b96f71136859eee1a3cb0f9033566ce1182888cc3525d0f7d000f9265eba3dfe7
7
- data.tar.gz: 9d11898a6152afed5e1dc6e22402327a260396fe1c5a6b0c73db56746728e06acc2afdf384bb990f364cda5e8ad4563eaeb6d2450b960de6bd3587990f2cf836
6
+ metadata.gz: f6f7280592da6ee403a2afccf71824a92c52d174e08f61da5d019cd372ab53d83d9462a12de932fc36965d5755a87507e4182c5bc91f10ba1ad8001479805aa5
7
+ data.tar.gz: f9dff07b8f31a2abb8902ae8fee21fe752cdd89a410b88737249c02d9596912f8617ae1e7ba584b958fb92a9efc51dec8335d25aae3cb1eb664a7315d8af3e9f
@@ -37,13 +37,22 @@ module TopsConnect
37
37
  when 200
38
38
  response.parsed_response
39
39
  when 400..499
40
- raise BadRequest, response.parsed_response['message']
40
+ raise TopsConnect::BadRequest, response.parsed_response['Message']
41
+ when 500..599
42
+ raise TopsConnect::InternalError, response.parsed_response['Message']
41
43
  else
42
- raise "#{response.code}: #{response.parsed_response['message']}"
44
+ raise TopsConnect::ApiError,
45
+ "#{response.code}: #{response.parsed_response['Message']}"
43
46
  end
44
47
  end
48
+ end
45
49
 
46
- class BadRequest < Exception
47
- end
50
+ class ApiError < ::RuntimeError
51
+ end
52
+
53
+ class BadRequest < ApiError
54
+ end
55
+
56
+ class InternalError < ApiError
48
57
  end
49
58
  end
@@ -3,9 +3,6 @@ module TopsConnect
3
3
  class Configuration
4
4
  attr_reader :subscription_key, :client_id, :software_key, :zone
5
5
 
6
- def initialize
7
- end
8
-
9
6
  def subscription_key=(key)
10
7
  unless key =~ /\A\h{32}\z/i
11
8
  raise 'Invalid TOPS Subscription Key. Expected 32 hex characters.'
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module TopsConnect
3
- VERSION = '0.3.4'
3
+ VERSION = '0.4.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tops_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Hoffman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-12 00:00:00.000000000 Z
11
+ date: 2017-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.6.6
131
+ rubygems_version: 2.6.8
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Make use of the Tops Connect API