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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82dd01a32c405393a246ff76a24d38dd8c8d2be8e9d12d7caee8d4b2217422b0
4
- data.tar.gz: 90fb7f261a2bebf3ce508f02aeff0f85aafb85aa9be8f3ee269a6c7331601eb4
3
+ metadata.gz: 93fef6667e949b9833a0d5f44b09982bbb0c6415ec44c57baa8e0f27eab322e8
4
+ data.tar.gz: b772ed894784fdbb1c739f4b75a6af0bc0adb5a88b009fd87d0dbca8d39e8077
5
5
  SHA512:
6
- metadata.gz: bdc1dd2ca515d96d8f533b76eea22f870a0b4801d2ac99609db426d010cf903898c260fc0a70e3a37b14491e27c7760052a43442ba1d9f8da3f0928371a3120b
7
- data.tar.gz: 1acf2132716dbd46c378c8093a3c21d00bb2fe210030634264e8cbcc8830a3a3760ba467857c55221a1a46501dcc92fd60494a931f14f39aa71cd1f79bd54c7c
6
+ metadata.gz: 38cb17e76859562485e7f2520fb6eacafd442b3e73cd30c4b8b1c0bf883f9c838c5d57c9978314a08fde591bfdac6b1ee5d52ad26c40b4374744e8cc22d5d716
7
+ data.tar.gz: 16d2e0043cbc92b65882c4d5d3684cd82e60fe09d59f7c30f7e995942475b4bbd74383cde73c4188fc387966a654578d3a540865d65e04e5210d6772c1770a43
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ test/version_tmp
17
17
  tmp
18
18
  .vagrant
19
19
  Gemfile.local
20
+ .ruby-version
@@ -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: RUBYOPT="--jit"
31
+ env: SPEC_RUBYOPT="--jit"
32
32
  - rvm: ruby-head
33
- env: RUBYOPT="--jit"
33
+ env: SPEC_RUBYOPT="--jit"
34
34
  branches:
35
35
  only:
36
36
  - master
@@ -1,5 +1,12 @@
1
1
  ## Unreleased
2
- [full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.4...master)
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
- if response.kind_of?(Net::HTTPRedirection)
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
- break
70
+ raise HTTPUnknownError
61
71
  end
62
72
  end
63
73
 
@@ -1,3 +1,3 @@
1
1
  module Itamae
2
- VERSION = "1.10.4"
2
+ VERSION = "1.10.5"
3
3
  end
@@ -1,6 +1,4 @@
1
- package 'sl' do
2
- version '3.03-17+b2'
3
- end
1
+ package 'sl'
4
2
 
5
3
  ######
6
4
 
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
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-05-10 00:00:00.000000000 Z
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.3
332
+ rubygems_version: 3.0.1
333
333
  signing_key:
334
334
  specification_version: 4
335
335
  summary: Simple Configuration Management Tool