itamae 1.0.0.beta35 → 1.0.0.beta36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/itamae/resource/base.rb +13 -1
- data/lib/itamae/resource/file.rb +8 -0
- data/lib/itamae/version.txt +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 960d455a8ef4164798f47d7729c12bd9c4dc83c8
|
4
|
+
data.tar.gz: 40891f58e09014321c39a2aa4d71ab8110c1ddf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e18a5e27dda2f409432f56b107a655e696ee3b8f5d64d1eca101c683e6ae8cc3d0877dd166c35c341eee167e3d3b6f2442c616a04205b281fdf57d24ab15683
|
7
|
+
data.tar.gz: 79eadd9cae38c612f1dcd179aaf0096c3522d6ac6709bdf439c7450f9c943efe3b258845f9091c231acd05ca8e484d2c30a5bb64faaafbbd2f4466e2a371a22e
|
data/lib/itamae/resource/base.rb
CHANGED
@@ -60,11 +60,13 @@ module Itamae
|
|
60
60
|
return
|
61
61
|
end
|
62
62
|
|
63
|
-
[action].flatten.each do |action|
|
63
|
+
[specific_action || action].flatten.each do |action|
|
64
64
|
@current_action = action
|
65
65
|
|
66
66
|
Logger.info "action: #{action}"
|
67
67
|
|
68
|
+
next if action == :nothing
|
69
|
+
|
68
70
|
unless options[:dry_run]
|
69
71
|
Logger.formatter.indent do
|
70
72
|
Logger.debug "(in pre_action)"
|
@@ -229,6 +231,16 @@ module Itamae
|
|
229
231
|
backend.run_command(*args)
|
230
232
|
end
|
231
233
|
|
234
|
+
def check_command(*args)
|
235
|
+
unless args.last.is_a?(Hash)
|
236
|
+
args << {}
|
237
|
+
end
|
238
|
+
|
239
|
+
args.last[:error] = false
|
240
|
+
|
241
|
+
run_command(*args).exit_status == 0
|
242
|
+
end
|
243
|
+
|
232
244
|
def run_specinfra(*args)
|
233
245
|
backend.run_specinfra(*args)
|
234
246
|
end
|
data/lib/itamae/resource/file.rb
CHANGED
@@ -76,6 +76,14 @@ module Itamae
|
|
76
76
|
|
77
77
|
if run_specinfra(:check_file_is_file, path)
|
78
78
|
run_specinfra(:copy_file, path, "#{path}.bak")
|
79
|
+
|
80
|
+
unless check_command(["diff", "-q", @temppath, path])
|
81
|
+
# the file is modified
|
82
|
+
updated!
|
83
|
+
end
|
84
|
+
else
|
85
|
+
# new file
|
86
|
+
updated!
|
79
87
|
end
|
80
88
|
|
81
89
|
run_specinfra(:move_file, @temppath, path)
|
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.
|
1
|
+
1.0.0.beta36
|