all3dp 0.1.1 → 0.1.2
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 +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +4 -4
- data/lib/all3dp/api.rb +14 -6
- data/lib/all3dp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a6eb4488cb86bdefb5bf7693597cdf5cff6a9b0
|
4
|
+
data.tar.gz: bbbbbd5620af219e06075552ae34028fee5ee265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1a8fd826c515648a02c8aaa53ff9f83b3af7eb47f6311c1cc4ec285e6998bcab83949bdd3c6cae2d2c0ebc55171a3e3b28e662829b7754f5d1aa9a830a34402
|
7
|
+
data.tar.gz: 3bb84421ca4ebffb78e8ea1953f306cd6e36f440b09403e3f4788eaf261b639bb78af0542336bfd651d6008b850a0caedd83ddaffc134cf384291a3c4c5739f7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -36,10 +36,10 @@ interactive prompt that will allow you to experiment.
|
|
36
36
|
|
37
37
|
## Release
|
38
38
|
|
39
|
-
To release a new version, update the version number in `version.rb`,
|
40
|
-
and then run `bundle exec rake release`, which will
|
41
|
-
for the version, push git commits and tags, and push the
|
42
|
-
to [rubygems.org](https://rubygems.org).
|
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
|
41
|
+
create a git tag for the version, push git commits and tags, and push the
|
42
|
+
`.gem` file to [rubygems.org](https://rubygems.org).
|
43
43
|
|
44
44
|
## Contributing
|
45
45
|
|
data/lib/all3dp/api.rb
CHANGED
@@ -4,6 +4,7 @@ module All3DP
|
|
4
4
|
# Handle all calls to the API.
|
5
5
|
class API
|
6
6
|
class Error < StandardError; end
|
7
|
+
class BadGatewayError < Error; end
|
7
8
|
|
8
9
|
def create_configuration(items:)
|
9
10
|
url = "#{BASE_URL}/configuration"
|
@@ -13,16 +14,23 @@ module All3DP
|
|
13
14
|
json: { items: items },
|
14
15
|
)
|
15
16
|
|
16
|
-
|
17
|
-
raise Error, "Error #{response.code}: #{response.body.to_s.inspect}"
|
18
|
-
end
|
19
|
-
|
20
|
-
response.parse
|
17
|
+
parse_response(response)
|
21
18
|
end
|
22
19
|
|
23
|
-
|
20
|
+
private
|
24
21
|
|
25
22
|
BASE_URL = "https://printing-engine.all3dp.com"
|
26
23
|
private_constant :BASE_URL
|
24
|
+
|
25
|
+
def parse_response(response)
|
26
|
+
case response.code
|
27
|
+
when 201
|
28
|
+
response.parse
|
29
|
+
when 502
|
30
|
+
raise BadGatewayError, response.body.to_s.strip
|
31
|
+
else
|
32
|
+
raise Error, "Error #{response.code}: #{response.body.to_s.inspect}"
|
33
|
+
end
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
data/lib/all3dp/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sunny Ripert
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|