itamae 1.10.4 → 1.10.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +3 -3
- data/CHANGELOG.md +8 -1
- data/lib/itamae/resource/http_request.rb +12 -2
- data/lib/itamae/version.rb +1 -1
- data/spec/integration/recipes/local.rb +1 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93fef6667e949b9833a0d5f44b09982bbb0c6415ec44c57baa8e0f27eab322e8
|
4
|
+
data.tar.gz: b772ed894784fdbb1c739f4b75a6af0bc0adb5a88b009fd87d0dbca8d39e8077
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38cb17e76859562485e7f2520fb6eacafd442b3e73cd30c4b8b1c0bf883f9c838c5d57c9978314a08fde591bfdac6b1ee5d52ad26c40b4374744e8cc22d5d716
|
7
|
+
data.tar.gz: 16d2e0043cbc92b65882c4d5d3684cd82e60fe09d59f7c30f7e995942475b4bbd74383cde73c4188fc387966a654578d3a540865d65e04e5210d6772c1770a43
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -18,7 +18,7 @@ before_install:
|
|
18
18
|
- travis_retry gem install bundler --no-document || travis_retry gem install bundler --no-document -v 1.17.3
|
19
19
|
|
20
20
|
script:
|
21
|
-
- bundle exec rake spec
|
21
|
+
- RUBYOPT=$SPEC_RUBYOPT bundle exec rake spec
|
22
22
|
notifications:
|
23
23
|
email: false
|
24
24
|
slack:
|
@@ -28,9 +28,9 @@ matrix:
|
|
28
28
|
- rvm: ruby-head
|
29
29
|
include:
|
30
30
|
- rvm: 2.6
|
31
|
-
env:
|
31
|
+
env: SPEC_RUBYOPT="--jit"
|
32
32
|
- rvm: ruby-head
|
33
|
-
env:
|
33
|
+
env: SPEC_RUBYOPT="--jit"
|
34
34
|
branches:
|
35
35
|
only:
|
36
36
|
- master
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.
|
2
|
+
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.5...master)
|
3
|
+
|
4
|
+
## v1.10.5
|
5
|
+
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.4...v1.10.5)
|
6
|
+
|
7
|
+
Improvements
|
8
|
+
|
9
|
+
- [Check http status code in `http_request` resource (by @takumin)](https://github.com/itamae-kitchen/itamae/pull/296)
|
3
10
|
|
4
11
|
## v1.10.4
|
5
12
|
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.3...v1.10.4)
|
@@ -5,6 +5,9 @@ module Itamae
|
|
5
5
|
module Resource
|
6
6
|
class HttpRequest < File
|
7
7
|
RedirectLimitExceeded = Class.new(StandardError)
|
8
|
+
HTTPClientError = Class.new(StandardError)
|
9
|
+
HTTPServerError = Class.new(StandardError)
|
10
|
+
HTTPUnknownError = Class.new(StandardError)
|
8
11
|
|
9
12
|
alias_method :_action_create, :action_create
|
10
13
|
undef_method :action_create, :action_delete, :action_edit
|
@@ -48,7 +51,10 @@ module Itamae
|
|
48
51
|
response = http.method(attributes.action).call(uri.request_uri, attributes.message, attributes.headers)
|
49
52
|
end
|
50
53
|
|
51
|
-
|
54
|
+
case response
|
55
|
+
when Net::HTTPSuccess
|
56
|
+
break
|
57
|
+
when Net::HTTPRedirection
|
52
58
|
if redirects_followed < attributes.redirect_limit
|
53
59
|
uri = URI.parse(response["location"])
|
54
60
|
redirects_followed += 1
|
@@ -56,8 +62,12 @@ module Itamae
|
|
56
62
|
else
|
57
63
|
raise RedirectLimitExceeded
|
58
64
|
end
|
65
|
+
when Net::HTTPClientError
|
66
|
+
raise HTTPClientError
|
67
|
+
when Net::HTTPServerError
|
68
|
+
raise HTTPServerError
|
59
69
|
else
|
60
|
-
|
70
|
+
raise HTTPUnknownError
|
61
71
|
end
|
62
72
|
end
|
63
73
|
|
data/lib/itamae/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itamae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryota Arai
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-07-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
329
|
- !ruby/object:Gem::Version
|
330
330
|
version: '0'
|
331
331
|
requirements: []
|
332
|
-
rubygems_version: 3.0.
|
332
|
+
rubygems_version: 3.0.1
|
333
333
|
signing_key:
|
334
334
|
specification_version: 4
|
335
335
|
summary: Simple Configuration Management Tool
|