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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca35e055d27b22f73b7187a6f3fb2d1f33aa34038fa6460ade966edf48b69847
4
- data.tar.gz: 2f5025dfcd45580a7b8b8c52e671de06d3c45de2e8e25d0769e3126426548dcd
3
+ metadata.gz: 375512e62a9c6d6004938ed1e6324e87a0370c6b9b41514a65fc97de879aa413
4
+ data.tar.gz: 30877f6ade5427ea453394cbc31c8526199754e7ba0af2bbb24f9b3288cf86fd
5
5
  SHA512:
6
- metadata.gz: 4a7b9a3685f2e6fad1b73f730801b83f0873e844f5203733b2d45cc43950571fd43745c9a86efae35ae67b4c5f503fccae7ef11dd481187fcfff5805878df83f
7
- data.tar.gz: ab02b802b9a533f48999122789d0d4e7526a4cd8da84e83d440acfbc6dc457d5be41089e1fca51b08d53e47edc38e57bffef61e7169e1427fe8f0382996cf949
6
+ metadata.gz: 6a392c9abcca6b356f2429bd6288e9f2a2335d1d85b933f4db848911a8a595541090363585a30486619c031400a4df763189aeea5c65867c2a027ae960a6e02d
7
+ data.tar.gz: fa285b94002bf9741fa3e610f676581908953968b4a5e2cb1c5f74476ca84f5e763a992c9a2f8e9d5e95e33d0f612a9b2ac70cd8abb5ffbd82b5fa62b6209358
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- advance (0.4.6)
4
+ advance (0.4.7)
5
5
  team_effort
6
6
 
7
7
  GEM
@@ -9,7 +9,7 @@ GEM
9
9
  specs:
10
10
  minitest (5.10.1)
11
11
  rake (13.0.1)
12
- team_effort (1.0.1)
12
+ team_effort (1.1.1)
13
13
 
14
14
  PLATFORMS
15
15
  ruby
@@ -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 $save_history && !File.exist?("#{previous_dir_path}.tgz")
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 $verbose_logging
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, $verbose_logging
241
+ do_command command, env_is?("ADVANCE_VERBOSE_LOGGING", false)
249
242
  end
250
243
  rescue
251
244
  puts "%%%% error while processing >>#{file_path}<<"
@@ -1,3 +1,3 @@
1
1
  module Advance
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: advance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - janemacfarlane