itamae 1.10.6 → 1.10.7
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/.travis.yml +1 -1
- data/CHANGELOG.md +8 -1
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/lib/itamae/resource/file.rb +28 -0
- data/lib/itamae/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 14acdfa4894556d3fcf3b3463f869b2e6d67b36897da33d4104d6e0309724117
|
|
4
|
+
data.tar.gz: cfb6529c9da828e28bc3f9b33563333e87e6764e2570301fc604f1bb58b553df
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e72d8fd33859995abfe62bbc74f31af2bce16ea7f410b4c9ddef84b1a142a5c92182cf0845bff4043092e571e546cf7e57171c82f73a0ca6d39200d0908d9829
|
|
7
|
+
data.tar.gz: 2cd158d444b8553131c38e5962c674a0a84b3e7f3a13637d1765042bfd896a80767f6bdc53cb467981bd3510e7e165cf19edb713d14b957fc1b4f8ba26210077
|
data/.travis.yml
CHANGED
|
@@ -8,13 +8,13 @@ rvm:
|
|
|
8
8
|
- 2.4
|
|
9
9
|
- 2.5
|
|
10
10
|
- 2.6
|
|
11
|
+
- 2.7
|
|
11
12
|
- ruby-head
|
|
12
13
|
bundler_args: "--jobs=4 --retry=3"
|
|
13
14
|
cache:
|
|
14
15
|
bundler: true
|
|
15
16
|
|
|
16
17
|
before_install:
|
|
17
|
-
- travis_retry gem update --system || travis_retry gem update --system 2.7.8
|
|
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:
|
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.7...master)
|
|
3
|
+
|
|
4
|
+
## v1.10.7
|
|
5
|
+
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.6...v1.10.7)
|
|
6
|
+
|
|
7
|
+
Improvements
|
|
8
|
+
|
|
9
|
+
- [Improve `file` resource performance](https://github.com/itamae-kitchen/itamae/pull/310)
|
|
3
10
|
|
|
4
11
|
## v1.10.6
|
|
5
12
|
[full changelog](https://github.com/itamae-kitchen/itamae/compare/v1.10.5...v1.10.6)
|
data/README.md
CHANGED
|
@@ -77,7 +77,7 @@ $ bundle exec rake spec
|
|
|
77
77
|
|
|
78
78
|
## Get Involved
|
|
79
79
|
|
|
80
|
-
- [Join Slack team](https://
|
|
80
|
+
- [Join Slack team](https://itamae-slackin.herokuapp.com)
|
|
81
81
|
|
|
82
82
|
## Presentations / Articles
|
|
83
83
|
|
data/Rakefile
CHANGED
data/lib/itamae/resource/file.rb
CHANGED
|
@@ -9,6 +9,10 @@ module Itamae
|
|
|
9
9
|
define_attribute :group, type: String
|
|
10
10
|
define_attribute :block, type: Proc, default: proc {}
|
|
11
11
|
|
|
12
|
+
class << self
|
|
13
|
+
attr_accessor :sha256sum_available
|
|
14
|
+
end
|
|
15
|
+
|
|
12
16
|
def pre_action
|
|
13
17
|
current.exist = run_specinfra(:check_file_is_file, attributes.path)
|
|
14
18
|
|
|
@@ -27,6 +31,11 @@ module Itamae
|
|
|
27
31
|
end
|
|
28
32
|
end
|
|
29
33
|
|
|
34
|
+
if exists_and_not_modified?
|
|
35
|
+
attributes.modified = false
|
|
36
|
+
return
|
|
37
|
+
end
|
|
38
|
+
|
|
30
39
|
send_tempfile
|
|
31
40
|
compare_file
|
|
32
41
|
end
|
|
@@ -133,6 +142,19 @@ module Itamae
|
|
|
133
142
|
end
|
|
134
143
|
end
|
|
135
144
|
|
|
145
|
+
def exists_and_not_modified?
|
|
146
|
+
return false unless current.exist && sha256sum_available?
|
|
147
|
+
|
|
148
|
+
current_digest = run_command(["sha256sum", attributes.path]).stdout.split(/\s/, 2).first
|
|
149
|
+
digest = if content_file
|
|
150
|
+
Digest::SHA256.file(content_file).hexdigest
|
|
151
|
+
else
|
|
152
|
+
Digest::SHA256.hexdigest(attributes.content.to_s)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
current_digest == digest
|
|
156
|
+
end
|
|
157
|
+
|
|
136
158
|
def show_content_diff
|
|
137
159
|
if attributes.modified
|
|
138
160
|
Itamae.logger.info "diff:"
|
|
@@ -194,6 +216,12 @@ module Itamae
|
|
|
194
216
|
f.unlink if f
|
|
195
217
|
end
|
|
196
218
|
end
|
|
219
|
+
|
|
220
|
+
def sha256sum_available?
|
|
221
|
+
return self.class.sha256sum_available unless self.class.sha256sum_available.nil?
|
|
222
|
+
|
|
223
|
+
self.class.sha256sum_available = run_command(["sha256sum", "--version"], error: false).exit_status == 0
|
|
224
|
+
end
|
|
197
225
|
end
|
|
198
226
|
end
|
|
199
227
|
end
|
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.7
|
|
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:
|
|
13
|
+
date: 2020-04-05 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: thor
|