all3dp 0.1.3 → 0.1.4

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: c73c5c59edb0f7c4d32af8fdadb8e51dbc1b669e
4
- data.tar.gz: c9645128b31132dea84bda2b1079c9eece69a674
3
+ metadata.gz: b0d9b8991308469a783565f55407edb1c92e8b1b
4
+ data.tar.gz: e049dc0d67624b0c04930c3494b1cd0a685f8efe
5
5
  SHA512:
6
- metadata.gz: 0d7c80e97a8f8d6b8d9761d3447c1651bbde62f80d25bc215ad9aeb012f38477bd3b21c6cfbc5a8c97912aec8af7bd5d2a83a451f0428c0013ec54115454d879
7
- data.tar.gz: 19161a7010a4dd5309ca9bdcc2b705b49bad1402285e22356923ddad6de65a18c421514ff0952dc2669d93bbd17e86e718b598e1dcd4dc12b440ed27c3ef2aa7
6
+ metadata.gz: 7ac68bdc12d3faf60fc4aad30b759626f09c1fa721fed2af32d10173b43922226d3c5cb1b0eb13213ddb4b2d09896473e96e8130d1c72c3de0232d903027f1d8
7
+ data.tar.gz: 9090014f0a4cd835360549acfcbe306d2810bcfeda560df59da9e4ec2a1ec4d424fa51c29a9de254b03d2b3b7341812f819d804000fc23d3802492507b925481
@@ -1,5 +1,10 @@
1
1
  # unreleased
2
2
 
3
+ # 0.1.4
4
+
5
+ Feature:
6
+ - Raise a `All3DP::API::ServiceUnavailableError` on 503s
7
+
3
8
  # 0.1.3
4
9
 
5
10
  Feature:
data/README.md CHANGED
@@ -37,7 +37,7 @@ interactive prompt that will allow you to experiment.
37
37
  ## Release
38
38
 
39
39
  To release a new version, update the version number in `version.rb`, update
40
- the CHANGELOG, commit, and then run `bundle exec rake release`, which will
40
+ the `CHANGELOG.md`, commit, and then run `bundle exec rake release`, which will
41
41
  create a git tag for the version, push git commits and tags, and push the
42
42
  `.gem` file to [rubygems.org](https://rubygems.org).
43
43
 
@@ -6,6 +6,7 @@ module All3DP
6
6
  class Error < StandardError; end
7
7
  class BadGatewayError < Error; end
8
8
  class GatewayTimeoutError < Error; end
9
+ class ServiceUnavailableError < Error; end
9
10
 
10
11
  def create_configuration(items:)
11
12
  url = "#{BASE_URL}/configuration"
@@ -23,19 +24,21 @@ module All3DP
23
24
  BASE_URL = "https://printing-engine.all3dp.com"
24
25
  private_constant :BASE_URL
25
26
 
26
- # rubocop:disable Metrics/AbcSize
27
+ # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
27
28
  def parse_response(response)
28
29
  case response.code
29
30
  when 201
30
31
  response.parse
31
32
  when 502
32
33
  raise BadGatewayError, response.body.to_s.strip
34
+ when 503
35
+ raise ServiceUnavailableError, response.body.to_s.strip
33
36
  when 504
34
37
  raise GatewayTimeoutError, response.body.to_s.strip
35
38
  else
36
39
  raise Error, "Error #{response.code}: #{response.body.to_s.inspect}"
37
40
  end
38
41
  end
39
- # rubocop:enable Metrics/AbcSize
42
+ # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
40
43
  end
41
44
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module All3DP
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: all3dp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sunny Ripert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-02 00:00:00.000000000 Z
11
+ date: 2019-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http