itamae 1.1.25 → 1.1.26

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
  SHA1:
3
- metadata.gz: 3c28cb6ce63cd01d6be927470128c5e21666a6ce
4
- data.tar.gz: d9ab010148c396f5c176757ced0ab51ead30846b
3
+ metadata.gz: fb27312cdd1e4cbfccca56ee5eb7a85e48188d2a
4
+ data.tar.gz: 164226caebc7e74dad4d9584f694b03b07bfd61f
5
5
  SHA512:
6
- metadata.gz: c36b27f65ae8e7767fc66204dd0a4a6f845cf67ef70925a6f10bac5c227ea2d67ee28d9b9fe81a8d2c642be2a40dfa0ee3ed147a5a72e81d51eb11d2706f2699
7
- data.tar.gz: 4b8541dca0a658732c6d38606fa6e393fd5557ed5111f016918646d7a2a810c8e918539f3c5e92e0dfe34efe9a0a8438c2fdc050c16656edddd176798b3142bb
6
+ metadata.gz: b6b7ac732a3b58aea5425e075ce7b787be1167cf38dc85a19300ec256bf6af4d9e0dd1e66ed33cc5fb5ba5ece0a76cbcb583a07895269119ad53dea55667a254
7
+ data.tar.gz: b510acec0c54fee7d6bfcca40c5fec9129f41b3ffe307dfaa2046f4dcf60f0b9b8e02bdb868a8d54bfab3d81bbf9aebbd6847b762ef5672f54a7d4af5d17d432
data/Rakefile CHANGED
@@ -84,6 +84,8 @@ namespace :release do
84
84
  end
85
85
  system "git add #{version_file}"
86
86
  system "git commit -m 'Bump up version'"
87
+
88
+ Rake::Task["release"].invoke
87
89
  end
88
90
  end
89
91
 
@@ -33,6 +33,14 @@ module Itamae
33
33
  outdent
34
34
  end
35
35
 
36
+ def with_indent_if(condition, &block)
37
+ if condition
38
+ with_indent(&block)
39
+ else
40
+ block.call
41
+ end
42
+ end
43
+
36
44
  def indent
37
45
  @depth += 1
38
46
  end
@@ -118,24 +118,22 @@ module Itamae
118
118
  def run(specific_action = nil, options = {})
119
119
  Logger.debug "#{resource_type}[#{resource_name}]"
120
120
 
121
- Logger.formatter.indent if Logger.debug?
122
-
123
- if do_not_run_because_of_only_if?
124
- Logger.debug "#{resource_type}[#{resource_name}] Execution skipped because of only_if attribute"
125
- return
126
- elsif do_not_run_because_of_not_if?
127
- Logger.debug "#{resource_type}[#{resource_name}] Execution skipped because of not_if attribute"
128
- return
129
- end
130
-
131
- [specific_action || attributes.action].flatten.each do |action|
132
- run_action(action, options)
133
- end
121
+ Logger.formatter.with_indent_if(Logger.debug?) do
122
+ if do_not_run_because_of_only_if?
123
+ Logger.debug "#{resource_type}[#{resource_name}] Execution skipped because of only_if attribute"
124
+ return
125
+ elsif do_not_run_because_of_not_if?
126
+ Logger.debug "#{resource_type}[#{resource_name}] Execution skipped because of not_if attribute"
127
+ return
128
+ end
134
129
 
135
- verify unless options[:dry_run]
136
- notify(options) if updated?
130
+ [specific_action || attributes.action].flatten.each do |action|
131
+ run_action(action, options)
132
+ end
137
133
 
138
- Logger.formatter.outdent if Logger.debug?
134
+ verify unless options[:dry_run]
135
+ notify(options) if updated?
136
+ end
139
137
  rescue Backend::CommandExecutionError
140
138
  Logger.error "#{resource_type}[#{resource_name}] Failed."
141
139
  exit 2
@@ -170,23 +168,22 @@ module Itamae
170
168
 
171
169
  return if action == :nothing
172
170
 
173
- Logger.formatter.indent if Logger.debug?
174
- Logger.debug "(in pre_action)"
175
- pre_action
176
-
177
- Logger.debug "(in set_current_attributes)"
178
- set_current_attributes
171
+ Logger.formatter.with_indent_if(Logger.debug?) do
172
+ Logger.debug "(in pre_action)"
173
+ pre_action
179
174
 
180
- Logger.debug "(in show_differences)"
181
- show_differences
175
+ Logger.debug "(in set_current_attributes)"
176
+ set_current_attributes
182
177
 
183
- unless options[:dry_run]
184
- public_send("action_#{action}".to_sym, options)
185
- end
178
+ Logger.debug "(in show_differences)"
179
+ show_differences
186
180
 
187
- updated! if different?
181
+ unless options[:dry_run]
182
+ public_send("action_#{action}".to_sym, options)
183
+ end
188
184
 
189
- Logger.formatter.outdent if Logger.debug?
185
+ updated! if different?
186
+ end
190
187
 
191
188
  @current_action = nil
192
189
  end
@@ -1 +1 @@
1
- 1.1.25
1
+ 1.1.26
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.1.25
4
+ version: 1.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai