advance 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/advance/version.rb +1 -1
- data/lib/advance.rb +34 -4
- 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: 961d5cc4a945b3b3bf404f27ad1e16119d437fec4abce4d21413374087c80e5e
|
4
|
+
data.tar.gz: aa4259e85e69a968a0564529433751f6a244ce1257206f7b9b048d182d85944e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eb44f9dbd87f94c865760d6f0ae981647d151f074600bb9fe8a844d63efd0ab819a2de2c44f165408735914528408cf2ec550dd0f0a4f6a53d5daf9b94cdf50
|
7
|
+
data.tar.gz: 196d465c18c089a7a3841cc55d4991f736c59366f38a6a1d3d4d933e93bcf1ca8ed292d094601b940c825807a495198f99500f7f89c1881309bf303215b19c46
|
data/Gemfile.lock
CHANGED
data/lib/advance/version.rb
CHANGED
data/lib/advance.rb
CHANGED
@@ -31,11 +31,23 @@ module Advance
|
|
31
31
|
dir_name = "#{dir_prefix}_#{label}"
|
32
32
|
|
33
33
|
puts "#{CYAN}advance #{$step} #{label}#{WHITE}... #{RESET}"
|
34
|
-
return if $redo_mode == :checking && Dir.exist?(dir_name)
|
35
34
|
|
36
|
-
|
35
|
+
if $redo_mode != :checking || !(File.exist?(dir_name) || File.exist?(dir_name + '.tgz'))
|
36
|
+
clean_previous_step_dirs(dir_prefix)
|
37
37
|
|
38
|
-
|
38
|
+
if previous_dir_path =~ /\.tgz$/
|
39
|
+
do_command_wo_log "tar xzf #{previous_dir_path}"
|
40
|
+
end
|
41
|
+
previous_dir_path = previous_dir_path.gsub(/\.tgz$/, "")
|
42
|
+
send(processing_mode, command, previous_dir_path, dir_name)
|
43
|
+
end
|
44
|
+
previous_dir_path = previous_dir_path.gsub(/\.tgz$/, "")
|
45
|
+
if File.basename(previous_dir_path) =~ /^step_/
|
46
|
+
if !File.exist?("#{previous_dir_path}.tgz")
|
47
|
+
do_command_wo_log "tar czf #{previous_dir_path}.tgz #{File.basename(previous_dir_path)}"
|
48
|
+
end
|
49
|
+
do_command_wo_log "rm -rf #{previous_dir_path}"
|
50
|
+
end
|
39
51
|
end
|
40
52
|
|
41
53
|
def static(processing_mode, label, command)
|
@@ -172,7 +184,7 @@ module Advance
|
|
172
184
|
end
|
173
185
|
|
174
186
|
def previous_file_path(previous_dir_path)
|
175
|
-
Find.find(previous_dir_path).reject {
|
187
|
+
Find.find(previous_dir_path).reject {|p| File.basename(p) =~ %r(^\.) || FileTest.directory?(p) || File.basename(p) == "log"}.first
|
176
188
|
end
|
177
189
|
|
178
190
|
def file_path_template(dir_path, files)
|
@@ -204,6 +216,24 @@ module Advance
|
|
204
216
|
end
|
205
217
|
end
|
206
218
|
|
219
|
+
def do_command_wo_log(command, feedback = true)
|
220
|
+
puts "#{YELLOW}#{command}#{RESET} " if feedback
|
221
|
+
stdout, stderr, status = Open3.capture3(command)
|
222
|
+
if !status.success?
|
223
|
+
error_msg = [
|
224
|
+
"step #{$step} failed",
|
225
|
+
"%%% command: >#{command}<",
|
226
|
+
"%%% returned status: >#{status}<",
|
227
|
+
"%%% stdout:",
|
228
|
+
stdout,
|
229
|
+
"%%% stderr:",
|
230
|
+
stderr
|
231
|
+
].join("\n")
|
232
|
+
|
233
|
+
raise error_msg
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
207
237
|
def ensure_bin_on_path
|
208
238
|
advance_path = File.dirname(__FILE__)
|
209
239
|
add_dir_to_path(advance_path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: advance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- janemacfarlane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: team_effort
|