advance 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/advance.rb +15 -22
- data/lib/advance/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 375512e62a9c6d6004938ed1e6324e87a0370c6b9b41514a65fc97de879aa413
|
4
|
+
data.tar.gz: 30877f6ade5427ea453394cbc31c8526199754e7ba0af2bbb24f9b3288cf86fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a392c9abcca6b356f2429bd6288e9f2a2335d1d85b933f4db848911a8a595541090363585a30486619c031400a4df763189aeea5c65867c2a027ae960a6e02d
|
7
|
+
data.tar.gz: fa285b94002bf9741fa3e610f676581908953968b4a5e2cb1c5f74476ca84f5e763a992c9a2f8e9d5e95e33d0f612a9b2ac70cd8abb5ffbd82b5fa62b6209358
|
data/Gemfile.lock
CHANGED
data/lib/advance.rb
CHANGED
@@ -21,6 +21,18 @@ module Advance
|
|
21
21
|
WHITE="\e[1;37m"
|
22
22
|
YELLOW="\e[33m"
|
23
23
|
|
24
|
+
def env_is?(env_var_name, default)
|
25
|
+
case ENV[env_var_name]
|
26
|
+
when "true"; true
|
27
|
+
when "false"; false
|
28
|
+
when nil; default
|
29
|
+
else
|
30
|
+
puts "env variable #{env_var_name} should be 'true', 'false', or not present (defaults to '#{default}')"
|
31
|
+
puts "currently set to >#{ENV[env_var_name]}<"
|
32
|
+
false
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
24
36
|
def self.included(pipeline_module)
|
25
37
|
$pipeline = caller_locations.first.path
|
26
38
|
meta =
|
@@ -33,25 +45,6 @@ module Advance
|
|
33
45
|
$run_number = last_run_number + 1
|
34
46
|
$cores=`nproc`.to_i
|
35
47
|
puts "Multi steps will use #{$cores} cores"
|
36
|
-
|
37
|
-
$verbose_logging = case ENV["ADVANCE_VERBOSE_LOGGING"]
|
38
|
-
when "true"; true
|
39
|
-
when "false"; false
|
40
|
-
when nil; false
|
41
|
-
else
|
42
|
-
puts "env variable ADVANCE_VERBOSE_LOGGING should be 'true', 'false', or not present (defaults to 'false')"
|
43
|
-
puts "currently set to >#{ENV["ADVANCE_VERBOSE_LOGGING"]}<"
|
44
|
-
false
|
45
|
-
end
|
46
|
-
$save_history = case ENV["ADVANCE_SAVE_HISTORY"]
|
47
|
-
when "true"; true
|
48
|
-
when "false"; false
|
49
|
-
when nil; true
|
50
|
-
else
|
51
|
-
puts "env variable ADVANCE_SAVE_HISTORY should be 'true', 'false', or not present (defaults to 'true')"
|
52
|
-
puts "currently set to >#{ENV["ADVANCE_SAVE_HISTORY"]}<"
|
53
|
-
true
|
54
|
-
end
|
55
48
|
end
|
56
49
|
|
57
50
|
def update_meta(step_number, processing_mode, label, command, start_time, duration, file_count)
|
@@ -140,7 +133,7 @@ module Advance
|
|
140
133
|
end
|
141
134
|
previous_dir_path = previous_dir_path.gsub(/\.tgz$/, "")
|
142
135
|
if File.basename(previous_dir_path) =~ /^step_/
|
143
|
-
if
|
136
|
+
if env_is?("ADVANCE_SAVE_HISTORY", true) && !File.exist?("#{previous_dir_path}.tgz")
|
144
137
|
do_command_wo_log "tar czf #{previous_dir_path}.tgz #{File.basename(previous_dir_path)}"
|
145
138
|
end
|
146
139
|
do_command_wo_log "rm -rf #{previous_dir_path}"
|
@@ -243,9 +236,9 @@ module Advance
|
|
243
236
|
command.gsub!("{input_file}", file_path)
|
244
237
|
command.gsub!("{file_name}", basename)
|
245
238
|
command.gsub!("{file_name_without_extension}", root_file_name)
|
246
|
-
puts "#{YELLOW}#{command}#{RESET} " if
|
239
|
+
puts "#{YELLOW}#{command}#{RESET} " if env_is?("ADVANCE_VERBOSE_LOGGING", false)
|
247
240
|
work_in_sub_dir(new_dir_name) do
|
248
|
-
do_command command,
|
241
|
+
do_command command, env_is?("ADVANCE_VERBOSE_LOGGING", false)
|
249
242
|
end
|
250
243
|
rescue
|
251
244
|
puts "%%%% error while processing >>#{file_path}<<"
|
data/lib/advance/version.rb
CHANGED