rbbt-util 5.34.8 → 5.34.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57270d81ae9b5c8106f216ca39c6f3b7981e9fac5667fe5c3a89e4b42286bf8b
4
- data.tar.gz: 841a63f9e5345fd8eb58db5878fb9556bb9d623fb2c78583a24688da8a518610
3
+ metadata.gz: 32b17775f7faf2220a471559cf7faf7db5f2515001a19e1fe5d70f3b588c06dd
4
+ data.tar.gz: '09b9518c2dadcdff12799cb9ece8b91a1f096c3953e695854fdf4b937868a345'
5
5
  SHA512:
6
- metadata.gz: 3b4331f6fbbf25af0bd1bce2288fc5a39d06de0259ed74a2538ad785b2d48c2851321567c355dbbb612d8a478b8e40b8b16fe96ad3e497f61d28480795db88ee
7
- data.tar.gz: 96621efdacb39998c672120f27347d92535fa8772381f39ae14e8e437f1ad7fe7c5176e3a0d6bcb54c6f89915aa5e928364af61e94f970d3fe6f2ba27d938408
6
+ metadata.gz: 56976a81e8aca514a836fd260d8e57c074252f9ef1e03bfb54496c1107bd6ecf27fa33f9e7d9f4c8ca39f5e8a4a2cc28c560e15cb26ec81855202aea8a53d41c
7
+ data.tar.gz: b195a055a913b56dd3cb70dc1da1bede56462a7eb55bce0ff437a53abdf556cee39dad8f8e49a6246705116990a666adc24e354345d5759d1f0d3690df2908dd
data/bin/rbbt_find.rb CHANGED
@@ -65,7 +65,7 @@ found.each do |path|
65
65
  if nocolor
66
66
  puts path
67
67
  else
68
- color = File.exists?(path) ? (File.directory?(path) ? :blue : nil) : :red
68
+ color = File.exist?(path) ? (File.directory?(path) ? :blue : nil) : :red
69
69
  puts Log.color color, path
70
70
  end
71
71
 
@@ -514,7 +514,7 @@ env > #{batch_options[:fenv]}
514
514
 
515
515
  %w(std.out std.err job.id job.status dependencies.list canfail_dependencies.list exit.status sync.log inputs_dir).each do |filename|
516
516
  path = File.join(batch_dir, filename)
517
- Open.rm_rf path if File.exists? path
517
+ Open.rm_rf path if File.exist? path
518
518
  end if clean_batch_job
519
519
 
520
520
  batch_dependencies = [] if batch_dependencies.nil?
@@ -584,14 +584,14 @@ env > #{batch_options[:fenv]}
584
584
 
585
585
  job = Open.read(fjob).strip if Open.exists?(fjob)
586
586
 
587
- if job && ! File.exists?(fexit)
587
+ if job && ! File.exist?(fexit)
588
588
  begin
589
589
  status_txt = job_status(job)
590
590
  STDERR.puts Log.color(:magenta, "Status [#{job.to_i}]:")
591
591
  STDERR.puts status_txt
592
592
  lines = status_txt.split("\n").length
593
593
  rescue
594
- if ! File.exists?(fexit)
594
+ if ! File.exist?(fexit)
595
595
  STDERR.puts Log.color(:magenta, "Job #{job.to_i} not done and not running. STDERR:")
596
596
  STDERR.puts Open.read(ferr)
597
597
  end
@@ -599,7 +599,7 @@ env > #{batch_options[:fenv]}
599
599
  end
600
600
  end
601
601
 
602
- if File.exists?(fexit)
602
+ if File.exist?(fexit)
603
603
  exit_status = Open.read(fexit)
604
604
  if exit_status.to_i == 0
605
605
  STDERR.puts Log.color(:magenta, "Job #{job} done with exit_status 0. STDOUT:")
@@ -613,7 +613,7 @@ env > #{batch_options[:fenv]}
613
613
 
614
614
  if tail
615
615
  Log.severity = 10
616
- while ! File.exists? fout
616
+ while ! File.exist? fout
617
617
  if job
618
618
  STDERR.puts
619
619
  Log.clear_line(STDERR)
@@ -638,8 +638,8 @@ env > #{batch_options[:fenv]}
638
638
  begin
639
639
  status_txt = job_status(job)
640
640
  Open.write(fstatus, status_txt) unless status_txt.nil? || status_txt.empty?
641
- out = CMD.cmd("tail -f '#{fout}'", :pipe => true) if File.exists?(fout) and not tail == :STDERR
642
- err = CMD.cmd("tail -f '#{ferr}'", :pipe => true) if File.exists?(ferr)
641
+ out = CMD.cmd("tail -f '#{fout}'", :pipe => true) if File.exist?(fout) and not tail == :STDERR
642
+ err = CMD.cmd("tail -f '#{ferr}'", :pipe => true) if File.exist?(ferr)
643
643
 
644
644
  terr = Misc.consume_stream(err, true, STDERR) if err
645
645
  tout = Misc.consume_stream(out, true, STDOUT) if out
data/lib/rbbt/hpc/lsf.rb CHANGED
@@ -70,12 +70,12 @@ export BATCH_SYSTEM=LSF
70
70
  STDERR.puts Log.color(:magenta, "Issuing LSF file: #{fcmd}")
71
71
  STDERR.puts Open.read(fcmd)
72
72
 
73
- if File.exists?(fjob)
73
+ if File.exist?(fjob)
74
74
  job = Open.read(fjob).to_i
75
75
  else
76
76
 
77
- dependencies = Open.read(fdep).split("\n") if File.exists? fdep
78
- canfail_dependencies = Open.read(fcfdep).split("\n") if File.exists? fcfdep
77
+ dependencies = Open.read(fdep).split("\n") if File.exist? fdep
78
+ canfail_dependencies = Open.read(fcfdep).split("\n") if File.exist? fcfdep
79
79
 
80
80
  normal_dep_list = dependencies && dependencies.any? ? dependencies.collect{|d| "post_done(#{d})"} : []
81
81
  canfail_dep_list = canfail_dependencies && canfail_dependencies.any? ? canfail_dependencies.collect{|d| "done(#{d})"} : []
@@ -90,7 +90,7 @@ export BATCH_SYSTEM=LSF
90
90
 
91
91
  cmd = "bsub #{dep_str} < '#{fcmd}'"
92
92
 
93
- if File.exists?(fout)
93
+ if File.exist?(fout)
94
94
  return
95
95
  elsif dry_run
96
96
  STDERR.puts Log.color(:magenta, "To execute run: ") + Log.color(:blue, cmd)
@@ -101,12 +101,12 @@ export BATCH_SYSTEM=SLURM
101
101
  Log.info "Issuing SLURM file: #{fcmd}"
102
102
  Log.debug Open.read(fcmd)
103
103
 
104
- if File.exists?(fjob)
104
+ if File.exist?(fjob)
105
105
  job = Open.read(fjob).to_i
106
106
  else
107
107
 
108
- dependencies = Open.read(fdep).split("\n") if File.exists? fdep
109
- canfail_dependencies = Open.read(fcfdep).split("\n") if File.exists? fcfdep
108
+ dependencies = Open.read(fdep).split("\n") if File.exist? fdep
109
+ canfail_dependencies = Open.read(fcfdep).split("\n") if File.exist? fcfdep
110
110
 
111
111
  normal_dep_str = dependencies && dependencies.any? ? "afterok:" + dependencies * ":" : nil
112
112
  canfail_dep_str = canfail_dependencies && canfail_dependencies.any? ? "afterany:" + canfail_dependencies * ":" : nil
@@ -119,7 +119,7 @@ export BATCH_SYSTEM=SLURM
119
119
 
120
120
  cmd = "sbatch #{dep_str} '#{fcmd}'"
121
121
 
122
- if File.exists?(fout)
122
+ if File.exist?(fout)
123
123
  return
124
124
  elsif dry_run
125
125
  STDERR.puts Log.color(:magenta, "To execute run: ") + Log.color(:blue, "sbatch '#{fcmd}'")
@@ -16,7 +16,7 @@ module Persist
16
16
  end
17
17
 
18
18
  dir = File.dirname(File.expand_path(path))
19
- File.mkdir(dir) unless File.exists?(dir)
19
+ File.mkdir(dir) unless File.exist?(dir)
20
20
 
21
21
  tokyocabinet_class = TokyoCabinet::HDB if tokyocabinet_class == "HDB" or tokyocabinet_class.nil?
22
22
  tokyocabinet_class = TokyoCabinet::BDB if tokyocabinet_class == "BDB"
data/lib/rbbt/persist.rb CHANGED
@@ -31,8 +31,8 @@ module Persist
31
31
  path = path.find if Path === path
32
32
  file = file.find if Path === file
33
33
  if by_link
34
- patht = File.exists?(path) ? File.lstat(path).mtime : nil
35
- filet = File.exists?(file) ? File.lstat(file).mtime : nil
34
+ patht = File.exist?(path) ? File.lstat(path).mtime : nil
35
+ filet = File.exist?(file) ? File.lstat(file).mtime : nil
36
36
  else
37
37
  patht = Open.mtime(path)
38
38
  filet = Open.mtime(file)
data/lib/rbbt/resource.rb CHANGED
@@ -233,7 +233,7 @@ module Resource
233
233
  when :install
234
234
  Log.debug "Installing software: #{path}"
235
235
 
236
- $set_software_env = false unless File.exists? path
236
+ $set_software_env = false unless File.exist? path
237
237
 
238
238
  software_dir = path.resource.root.software.find :user
239
239
  helper_file = File.expand_path(Rbbt.share.install.software.lib.install_helpers.find(:lib, caller_lib_dir(__FILE__)))
@@ -125,6 +125,8 @@ module Rbbt::Config
125
125
  if String === value && m = value.match(/^env:(.*)/)
126
126
  variable = m.captures.first
127
127
  ENV[variable]
128
+ elsif value == 'nil'
129
+ nil
128
130
  else
129
131
  value
130
132
  end
@@ -145,7 +147,7 @@ module Rbbt::Config
145
147
  end
146
148
 
147
149
  def self.process_config(config)
148
- if Misc.is_filename?(config) && File.exists?(config)
150
+ if Misc.is_filename?(config) && File.exist?(config)
149
151
  Rbbt::Config.load_file(config)
150
152
  elsif Rbbt.etc.config_profile[config].exists?
151
153
  Rbbt::Config.load_file(Rbbt.etc.config_profile[config].find)
@@ -49,6 +49,9 @@ module Log
49
49
  end
50
50
 
51
51
  def init
52
+ @ticks, @bytes = 0
53
+ @last_time = @last_count = @last_percent = nil
54
+ @history, @mean_max, @max_history = nil
52
55
  @start = @last_time = Time.now
53
56
  @last_count = 0
54
57
  report
@@ -17,7 +17,7 @@ puts path.glob_all.collect{|p| File.directory?(p) ? p + "/" : p } * "\n"
17
17
 
18
18
  [path, paths.collect{|p| [source, p] * ":"}, lpath]
19
19
  else
20
- if File.exists?(path)
20
+ if File.exist?(path)
21
21
  path = resource.identify(path)
22
22
  else
23
23
  path = Path.setup(path)
@@ -266,7 +266,7 @@ module Misc
266
266
 
267
267
  def self.mtime_str(path)
268
268
  path = path.find if Path === path
269
- if File.exists? path
269
+ if File.exist? path
270
270
  "mtime: " << File.mtime(path).to_s
271
271
  else
272
272
  "mtime: not present"
@@ -416,7 +416,7 @@ module Misc
416
416
  end
417
417
 
418
418
  def self.file2md5(file)
419
- if File.exists?(file + '.md5')
419
+ if File.exist?(file + '.md5')
420
420
  Open.read(file + '.md5')
421
421
  else
422
422
  md5 = CMD.cmd("md5sum '#{file}'").read.strip.split(" ").first
@@ -39,11 +39,11 @@ module Misc
39
39
  begin
40
40
  erase = path.nil?
41
41
  path = TmpFile.tmp_file if path.nil?
42
- File.rm path if clean && File.exists?(path)
42
+ File.rm path if clean && File.exist?(path)
43
43
  File.mkfifo path
44
44
  yield path
45
45
  ensure
46
- FileUtils.rm path if erase && File.exists?(path)
46
+ FileUtils.rm path if erase && File.exist?(path)
47
47
  end
48
48
  end
49
49
 
@@ -340,11 +340,11 @@ module Misc
340
340
  Log.medium "Consume stream aborted #{Misc.fingerprint io}"
341
341
  io.abort if io.respond_to? :abort
342
342
  #io.close unless io.closed?
343
- FileUtils.rm into_path if into_path and File.exists? into_path
343
+ FileUtils.rm into_path if into_path and File.exist? into_path
344
344
  rescue Exception
345
345
  Log.medium "Exception consuming stream: #{Misc.fingerprint io}: #{$!.message}"
346
346
  io.abort $! if io.respond_to? :abort
347
- FileUtils.rm into_path if into_path and File.exists? into_path
347
+ FileUtils.rm into_path if into_path and File.exist? into_path
348
348
  raise $!
349
349
  end
350
350
  end
@@ -389,8 +389,8 @@ module Open
389
389
  # source = source.find if Path === source
390
390
  # target = target.find if Path === target
391
391
 
392
- # FileUtils.mkdir_p File.dirname(target) unless File.exists?(File.dirname(target))
393
- # FileUtils.rm target if File.exists?(target)
392
+ # FileUtils.mkdir_p File.dirname(target) unless File.exist?(File.dirname(target))
393
+ # FileUtils.rm target if File.exist?(target)
394
394
  # FileUtils.cp source, target
395
395
  #end
396
396
 
data/lib/rbbt/util/tar.rb CHANGED
@@ -93,7 +93,7 @@ module Misc
93
93
  # directory
94
94
  def self.untar(io, destination)
95
95
  io = io.find if Path === io
96
- if String === io and File.exists?(io)
96
+ if String === io and File.exist?(io)
97
97
  Open.open(io) do |f|
98
98
  untar(f, destination)
99
99
  end
@@ -13,7 +13,7 @@ module Workflow
13
13
  nextflow_includes(file).inject(params) do |params,info|
14
14
  name_str, included_file = info
15
15
  included_file = File.join(dir, included_file)
16
- included_file += '.nf' unless File.exists?(included_file) || ! File.exists?(included_file + '.nf')
16
+ included_file += '.nf' unless File.exist?(included_file) || ! File.exist?(included_file + '.nf')
17
17
  name_str.split(";").each do |name|
18
18
  name = name.strip
19
19
  include_params = nextflow_recursive_params(included_file).collect{|p| [p,name] * "-"}
@@ -32,7 +32,7 @@ module Workflow
32
32
  result = :text
33
33
  end
34
34
 
35
- file = file + '.nf' unless File.exists?(file) || ! File.exists?(file + '.nf')
35
+ file = file + '.nf' unless File.exist?(file) || ! File.exist?(file + '.nf')
36
36
  file = File.expand_path(file)
37
37
  name ||= File.basename(file).sub(/\.nf$/,'').gsub(/\s/,'_')
38
38
  params = Workflow.nextflow_recursive_params(file)
@@ -92,7 +92,7 @@ class Step
92
92
  (!(job.noinfo? || job.done? || job.error? || job.aborted? || job.running?))
93
93
 
94
94
  if ! (job.resumable? && (job.updated? && ! job.dirty?))
95
- Log.high "About to clean -- status: #{status}, present #{File.exists?(job.path)}, " +
95
+ Log.high "About to clean -- status: #{status}, present #{File.exist?(job.path)}, " +
96
96
  %w(done? error? recoverable_error? noinfo? updated? dirty? aborted? running? resumable?).
97
97
  collect{|v| [v, job.send(v)]*": "} * ", " if RBBT_DEBUG_CLEAN
98
98
 
@@ -421,7 +421,7 @@ class Step
421
421
  config_keys = Rbbt::Config::GOT_KEYS[config_keys_pre.length..-1]
422
422
  set_info :config_keys, config_keys.uniq
423
423
 
424
- if result.nil? && File.exists?(self.tmp_path) && ! File.exists?(self.path)
424
+ if result.nil? && File.exist?(self.tmp_path) && ! File.exist?(self.path)
425
425
  Open.mv self.tmp_path, self.path
426
426
  end
427
427
  result
@@ -2,12 +2,12 @@ module Workflow
2
2
 
3
3
  def self.load_inputs(dir, input_names, input_types)
4
4
  inputs = {}
5
- if File.exists?(dir) && ! File.directory?(dir)
5
+ if File.exist?(dir) && ! File.directory?(dir)
6
6
  Log.debug "Loading inputs from #{dir}, not a directory trying as tar.gz"
7
7
  tarfile = dir
8
8
  digest = CMD.cmd("md5sum '#{tarfile}'").read.split(" ").first
9
9
  tmpdir = Rbbt.tmp.input_bundle[digest].find
10
- Misc.untar(tarfile, tmpdir) unless File.exists? tmpdir
10
+ Misc.untar(tarfile, tmpdir) unless File.exist? tmpdir
11
11
  files = tmpdir.glob("*")
12
12
  if files.length == 1 && File.directory?(files.first)
13
13
  tmpdir = files.first
@@ -256,7 +256,7 @@ class Step
256
256
  # when Step === value
257
257
  # Open.ln_s(value.path, path)
258
258
  # when type.to_s == "binary"
259
- # if String === value && File.exists?(value)
259
+ # if String === value && File.exist?(value)
260
260
  # value = File.expand_path(value)
261
261
  # Open.ln_s(value, path)
262
262
  # elsif String === value && Misc.is_filename?(value, false)
@@ -269,7 +269,7 @@ class Step
269
269
  # when Array === value
270
270
  # Open.write(path, value.collect{|v| Step === v ? v.path : v.to_s} * "\n")
271
271
  # when %w(file tsv array).include?(type.to_s)
272
- # if String === value && File.exists?(value)
272
+ # if String === value && File.exist?(value)
273
273
  # value = File.expand_path(value)
274
274
  # Open.ln_s(value, path)
275
275
  # elsif String === value && Misc.is_filename?(value, false)
@@ -280,7 +280,7 @@ class Step
280
280
  # Open.write(path + '.yaml', value.to_yaml)
281
281
  # end
282
282
  # when IO === value
283
- # if value.filename && String === value.filename && File.exists?(value.filename)
283
+ # if value.filename && String === value.filename && File.exist?(value.filename)
284
284
  # Open.ln_s(value.filename, path)
285
285
  # else
286
286
  # Open.write(path, value)
@@ -13,9 +13,9 @@ class Step
13
13
  return if target_dir[workflow][task][name].exists? || File.symlink?(target_dir[workflow][task][name].find)
14
14
  Log.debug "Linking #{ path }"
15
15
  FileUtils.mkdir_p target_dir[workflow][task] unless target_dir[workflow][task].exists?
16
- FileUtils.ln_s path, target_dir[workflow][task][name].find if File.exists?(path)
17
- FileUtils.ln_s path + '.files', target_dir[workflow][task][name].find + '.files' if File.exists?(path + '.files')
18
- FileUtils.ln_s path + '.info', target_dir[workflow][task][name].find + '.info' if File.exists?(path + '.info')
16
+ FileUtils.ln_s path, target_dir[workflow][task][name].find if File.exist?(path)
17
+ FileUtils.ln_s path + '.files', target_dir[workflow][task][name].find + '.files' if File.exist?(path + '.files')
18
+ FileUtils.ln_s path + '.info', target_dir[workflow][task][name].find + '.info' if File.exist?(path + '.info')
19
19
  end
20
20
 
21
21
  def archive(target = nil)
@@ -65,15 +65,15 @@ class Step
65
65
  end.uniq
66
66
 
67
67
  jobs.each do |step|
68
- next unless File.exists?(step.path)
68
+ next unless File.exist?(step.path)
69
69
  next if skip_overriden && step.overriden
70
70
 
71
71
  job_files << step.path
72
- job_files << step.info_file if File.exists?(step.info_file)
73
- job_files << Step.md5_file(step.path) if File.exists?(Step.md5_file step.path)
72
+ job_files << step.info_file if File.exist?(step.info_file)
73
+ job_files << Step.md5_file(step.path) if File.exist?(Step.md5_file step.path)
74
74
  job_file_dir_content = Dir.glob(step.files_dir + '/**/*')
75
75
  job_files += job_file_dir_content
76
- job_files << step.files_dir if File.exists?(step.files_dir)
76
+ job_files << step.files_dir if File.exist?(step.files_dir)
77
77
  rec_dependencies = Set.new
78
78
 
79
79
  next unless recursive
@@ -99,7 +99,7 @@ class Step
99
99
  dep = Workflow.load_step path
100
100
  job_files << dep.path
101
101
  job_files << dep.files_dir if Dir.glob(dep.files_dir + '/*').any?
102
- job_files << dep.info_file if File.exists?(dep.info_file)
102
+ job_files << dep.info_file if File.exist?(dep.info_file)
103
103
  end
104
104
  end
105
105
 
data/lib/rbbt/workflow.rb CHANGED
@@ -543,13 +543,13 @@ module Workflow
543
543
  persist = input_values.nil? ? false : true
544
544
  persist = false
545
545
 
546
- if ! (Path === step_path ? step_path.find : File.exists?(step_path)) && step_path.split("/").length == 3 && File.exists?(new_path = Rbbt.var.jobs[step_path].find)
546
+ if ! (Path === step_path ? step_path.find : File.exist?(step_path)) && step_path.split("/").length == 3 && File.exist?(new_path = Rbbt.var.jobs[step_path].find)
547
547
  step_path = new_path
548
548
  end
549
549
 
550
550
  key = Path === step_path ? step_path.find : step_path
551
551
 
552
- if ! File.exists?(step_path) && step_path.split("/").length == 3 && File.exists?(new_path = Rbbt.var.jobs[step_path].find)
552
+ if ! File.exist?(step_path) && step_path.split("/").length == 3 && File.exist?(new_path = Rbbt.var.jobs[step_path].find)
553
553
  step_path = new_path
554
554
  end
555
555
 
@@ -602,7 +602,7 @@ module Workflow
602
602
  pother = other.split(/\/+/)
603
603
  end_part = pother[-3..-1] * "/"
604
604
  new_path = prefix + "/" << end_part
605
- if File.exists? new_path
605
+ if File.exist? new_path
606
606
  new_path
607
607
  else
608
608
  Rbbt.var.jobs[end_part].find
@@ -615,7 +615,7 @@ module Workflow
615
615
  pother = other.split(/\/+/)
616
616
  end_part = pother[-3..-1] * "/"
617
617
  new_path = preal[0..-4] * "/" << "/" << end_part
618
- return new_path if File.exists?(new_path) || File.exists?(new_path + '.info')
618
+ return new_path if File.exist?(new_path) || File.exist?(new_path + '.info')
619
619
  Rbbt.var.jobs[end_part].find
620
620
  end
621
621
 
@@ -713,7 +713,7 @@ module Workflow
713
713
  def self.load_step(path)
714
714
  path = Path.setup(path.dup) unless Path === path
715
715
 
716
- if ! (Path === path ? path.exists? : File.exists?(path)) && path.split("/").length == 3
716
+ if ! (Path === path ? path.exists? : File.exist?(path)) && path.split("/").length == 3
717
717
  new_path = Rbbt.var.jobs[path]
718
718
  if new_path.exists? || new_path.set_extension('info').exists?
719
719
  path = new_path
@@ -97,19 +97,19 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
97
97
 
98
98
  different_system = job_batch_system != batch_system
99
99
 
100
- if File.exists?(fid = File.join(dir, 'job.id'))
100
+ if File.exist?(fid = File.join(dir, 'job.id'))
101
101
  id = Open.read(fid).chomp
102
102
  else
103
103
  id = nil
104
104
  end
105
105
 
106
- if File.exists?(fstatus = File.join(dir, 'exit.status'))
106
+ if File.exist?(fstatus = File.join(dir, 'exit.status'))
107
107
  exit_status = Open.read(fstatus).to_i
108
108
  else
109
109
  exit_status = nil
110
110
  end
111
111
 
112
- if File.exists?(fstatus = File.join(dir, 'job.status'))
112
+ if File.exist?(fstatus = File.join(dir, 'job.status'))
113
113
  fstatus_txt = Open.read(fstatus)
114
114
  begin
115
115
  if job_batch_system == "lsf"
@@ -126,17 +126,17 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
126
126
  nodes = []
127
127
  end
128
128
 
129
- if File.exists?(File.join(dir, 'std.out'))
129
+ if File.exist?(File.join(dir, 'std.out'))
130
130
  outt = File.mtime File.join(dir, 'std.out')
131
131
  errt = File.mtime File.join(dir, 'std.err')
132
132
  time_diff = Time.now - [outt, errt].max
133
133
  end
134
134
 
135
135
  fdep = File.join(dir, 'dependencies.list')
136
- deps = Open.read(fdep).split("\n") if File.exists?(fdep)
136
+ deps = Open.read(fdep).split("\n") if File.exist?(fdep)
137
137
 
138
138
  fcadep = File.join(dir, 'canfail_dependencies.list')
139
- cadeps = Open.read(fcadep).split("\n") if File.exists?(fcadep)
139
+ cadeps = Open.read(fcadep).split("\n") if File.exist?(fcadep)
140
140
 
141
141
  aborted = error = true if aborted.nil? && error.nil?
142
142
  #if done || error || aborted || running || queued || jobid || search
@@ -177,7 +177,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
177
177
  puts Log.color(:magenta, "Dependencies: ") << deps * ", " if deps
178
178
  puts Log.color(:magenta, "Dependencies (can fail): ") << cadeps * ", " if cadeps
179
179
  puts Log.color(:magenta, "Nodes: ") << nodes * ", "
180
- puts Log.color(:magenta, "Output: ") << File.exists?(File.join(dir, 'std.out')).to_s << (id.nil? ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)")
180
+ puts Log.color(:magenta, "Output: ") << File.exist?(File.join(dir, 'std.out')).to_s << (id.nil? ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)")
181
181
 
182
182
  if options[:batch_parameters]
183
183
  puts Log.color(:magenta, "BATCH parameters: ")
@@ -189,7 +189,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
189
189
  end
190
190
  end
191
191
 
192
- if tail && File.exists?(File.join(dir, 'std.err'))
192
+ if tail && File.exist?(File.join(dir, 'std.err'))
193
193
  if exit_status && exit_status != 0
194
194
  puts Log.color(:magenta, "First error or exception found: ")
195
195
  puts CMD.cmd("grep -i -w 'error\\|[a-z]*exception' #{File.join(dir, 'std.err')} -A #{tail.to_i} |head -n #{tail.to_i}", :no_fail => true).read
@@ -118,19 +118,19 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
118
118
  container_home = nil
119
119
  end
120
120
 
121
- if File.exists?(fid = File.join(dir, 'job.id'))
121
+ if File.exist?(fid = File.join(dir, 'job.id'))
122
122
  id = Open.read(fid).chomp
123
123
  else
124
124
  id = nil
125
125
  end
126
126
 
127
- if File.exists?(fstatus = File.join(dir, 'exit.status'))
127
+ if File.exist?(fstatus = File.join(dir, 'exit.status'))
128
128
  exit_status = Open.read(fstatus).to_i
129
129
  else
130
130
  exit_status = nil
131
131
  end
132
132
 
133
- if File.exists?(fstatus = File.join(dir, 'job.status'))
133
+ if File.exist?(fstatus = File.join(dir, 'job.status'))
134
134
  fstatus_txt = Open.read(fstatus)
135
135
  begin
136
136
  if job_batch_system == "lsf"
@@ -147,13 +147,13 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
147
147
  nodes = []
148
148
  end
149
149
 
150
- if File.exists?(File.join(dir, 'exit.status'))
150
+ if File.exist?(File.join(dir, 'exit.status'))
151
151
  now = File.ctime(File.join(dir, 'exit.status'))
152
152
  else
153
153
  now = Time.now
154
154
  end
155
155
 
156
- if File.exists?(File.join(dir, 'std.out'))
156
+ if File.exist?(File.join(dir, 'std.out'))
157
157
  cerrt = File.ctime File.join(dir, 'std.err')
158
158
  coutt = File.ctime File.join(dir, 'std.out')
159
159
  outt = File.mtime File.join(dir, 'std.out')
@@ -163,10 +163,10 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
163
163
  end
164
164
 
165
165
  fdep = File.join(dir, 'dependencies.list')
166
- deps = Open.read(fdep).split("\n") if File.exists?(fdep)
166
+ deps = Open.read(fdep).split("\n") if File.exist?(fdep)
167
167
 
168
168
  fcadep = File.join(dir, 'canfail_dependencies.list')
169
- cadeps = Open.read(fcadep).split("\n") if File.exists?(fcadep)
169
+ cadeps = Open.read(fcadep).split("\n") if File.exist?(fcadep)
170
170
 
171
171
  if done || error || aborted || running || queued || jobid
172
172
  select = false
@@ -244,7 +244,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
244
244
  puts Log.color(:magenta, "Dependencies (can fail): ") << cadeps * ", " if cadeps
245
245
  puts Log.color(:magenta, "Nodes: ") << nodes * ", " if long
246
246
  puts Log.color(:magenta, "Time elapsed: ") << Misc.format_seconds(time_elapsed) if time_elapsed
247
- puts Log.color(:magenta, "Output: ") << File.exists?(File.join(dir, 'std.out')).to_s << (id.nil? || File.exists?(File.join(dir, 'exit.status')) ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)") if long
247
+ puts Log.color(:magenta, "Output: ") << File.exist?(File.join(dir, 'std.out')).to_s << (id.nil? || File.exist?(File.join(dir, 'exit.status')) ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)") if long
248
248
 
249
249
  if options[:batch_parameters]
250
250
  puts Log.color(:magenta, "BATCH parameters: ")
@@ -316,7 +316,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
316
316
  end
317
317
 
318
318
 
319
- if tail && File.exists?(File.join(dir, 'std.err'))
319
+ if tail && File.exist?(File.join(dir, 'std.err'))
320
320
  if exit_status && exit_status != 0
321
321
  puts Log.color(:magenta, "First error or exception found: ")
322
322
  puts CMD.cmd("grep -i -w 'error\\|[a-z]*exception' #{File.join(dir, 'std.err')} -A #{tail.to_i} |head -n #{tail.to_i}", :no_fail => true).read
@@ -46,7 +46,7 @@ if directory =~ /^[0-9]*$/
46
46
  end
47
47
  end
48
48
 
49
- raise ParameterException, "Could not identify job #{directory}" unless File.exists?(directory)
49
+ raise ParameterException, "Could not identify job #{directory}" unless File.exist?(directory)
50
50
 
51
51
  require 'rbbt/hpc/slurm'
52
52
 
@@ -97,19 +97,19 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
97
97
 
98
98
  different_system = job_batch_system != batch_system
99
99
 
100
- if File.exists?(fid = File.join(dir, 'job.id'))
100
+ if File.exist?(fid = File.join(dir, 'job.id'))
101
101
  id = Open.read(fid).chomp
102
102
  else
103
103
  id = nil
104
104
  end
105
105
 
106
- if File.exists?(fstatus = File.join(dir, 'exit.status'))
106
+ if File.exist?(fstatus = File.join(dir, 'exit.status'))
107
107
  exit_status = Open.read(fstatus).to_i
108
108
  else
109
109
  exit_status = nil
110
110
  end
111
111
 
112
- if File.exists?(fstatus = File.join(dir, 'job.status'))
112
+ if File.exist?(fstatus = File.join(dir, 'job.status'))
113
113
  fstatus_txt = Open.read(fstatus)
114
114
  begin
115
115
  if job_batch_system == "lsf"
@@ -126,17 +126,17 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
126
126
  nodes = []
127
127
  end
128
128
 
129
- if File.exists?(File.join(dir, 'std.out'))
129
+ if File.exist?(File.join(dir, 'std.out'))
130
130
  outt = File.mtime File.join(dir, 'std.out')
131
131
  errt = File.mtime File.join(dir, 'std.err')
132
132
  time_diff = Time.now - [outt, errt].max
133
133
  end
134
134
 
135
135
  fdep = File.join(dir, 'dependencies.list')
136
- deps = Open.read(fdep).split("\n") if File.exists?(fdep)
136
+ deps = Open.read(fdep).split("\n") if File.exist?(fdep)
137
137
 
138
138
  fcadep = File.join(dir, 'canfail_dependencies.list')
139
- cadeps = Open.read(fcadep).split("\n") if File.exists?(fcadep)
139
+ cadeps = Open.read(fcadep).split("\n") if File.exist?(fcadep)
140
140
 
141
141
  aborted = error = true if aborted.nil? && error.nil?
142
142
  #if done || error || aborted || running || queued || jobid || search
@@ -177,7 +177,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
177
177
  puts Log.color(:magenta, "Dependencies: ") << deps * ", " if deps
178
178
  puts Log.color(:magenta, "Dependencies (can fail): ") << cadeps * ", " if cadeps
179
179
  puts Log.color(:magenta, "Nodes: ") << nodes * ", "
180
- puts Log.color(:magenta, "Output: ") << File.exists?(File.join(dir, 'std.out')).to_s << (id.nil? ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)")
180
+ puts Log.color(:magenta, "Output: ") << File.exist?(File.join(dir, 'std.out')).to_s << (id.nil? ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)")
181
181
 
182
182
  if options[:batch_parameters]
183
183
  puts Log.color(:magenta, "BATCH parameters: ")
@@ -189,7 +189,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
189
189
  end
190
190
  end
191
191
 
192
- if tail && File.exists?(File.join(dir, 'std.err'))
192
+ if tail && File.exist?(File.join(dir, 'std.err'))
193
193
  if exit_status && exit_status != 0
194
194
  puts Log.color(:magenta, "First error or exception found: ")
195
195
  puts CMD.cmd("grep -i -w 'error\\|[a-z]*exception' #{File.join(dir, 'std.err')} -A #{tail.to_i} |head -n #{tail.to_i}", :no_fail => true).read
@@ -118,19 +118,19 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
118
118
  container_home = nil
119
119
  end
120
120
 
121
- if File.exists?(fid = File.join(dir, 'job.id'))
121
+ if File.exist?(fid = File.join(dir, 'job.id'))
122
122
  id = Open.read(fid).chomp
123
123
  else
124
124
  id = nil
125
125
  end
126
126
 
127
- if File.exists?(fstatus = File.join(dir, 'exit.status'))
127
+ if File.exist?(fstatus = File.join(dir, 'exit.status'))
128
128
  exit_status = Open.read(fstatus).to_i
129
129
  else
130
130
  exit_status = nil
131
131
  end
132
132
 
133
- if File.exists?(fstatus = File.join(dir, 'job.status'))
133
+ if File.exist?(fstatus = File.join(dir, 'job.status'))
134
134
  fstatus_txt = Open.read(fstatus)
135
135
  begin
136
136
  if job_batch_system == "lsf"
@@ -147,13 +147,13 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
147
147
  nodes = []
148
148
  end
149
149
 
150
- if File.exists?(File.join(dir, 'exit.status'))
150
+ if File.exist?(File.join(dir, 'exit.status'))
151
151
  now = File.ctime(File.join(dir, 'exit.status'))
152
152
  else
153
153
  now = Time.now
154
154
  end
155
155
 
156
- if File.exists?(File.join(dir, 'std.out'))
156
+ if File.exist?(File.join(dir, 'std.out'))
157
157
  cerrt = File.ctime File.join(dir, 'std.err')
158
158
  coutt = File.ctime File.join(dir, 'std.out')
159
159
  outt = File.mtime File.join(dir, 'std.out')
@@ -163,10 +163,10 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
163
163
  end
164
164
 
165
165
  fdep = File.join(dir, 'dependencies.list')
166
- deps = Open.read(fdep).split("\n") if File.exists?(fdep)
166
+ deps = Open.read(fdep).split("\n") if File.exist?(fdep)
167
167
 
168
168
  fcadep = File.join(dir, 'canfail_dependencies.list')
169
- cadeps = Open.read(fcadep).split("\n") if File.exists?(fcadep)
169
+ cadeps = Open.read(fcadep).split("\n") if File.exist?(fcadep)
170
170
 
171
171
  if done || error || aborted || running || queued || jobid
172
172
  select = false
@@ -244,7 +244,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
244
244
  puts Log.color(:magenta, "Dependencies (can fail): ") << cadeps * ", " if cadeps
245
245
  puts Log.color(:magenta, "Nodes: ") << nodes * ", " if long
246
246
  puts Log.color(:magenta, "Time elapsed: ") << Misc.format_seconds(time_elapsed) if time_elapsed
247
- puts Log.color(:magenta, "Output: ") << File.exists?(File.join(dir, 'std.out')).to_s << (id.nil? || File.exists?(File.join(dir, 'exit.status')) ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)") if long
247
+ puts Log.color(:magenta, "Output: ") << File.exist?(File.join(dir, 'std.out')).to_s << (id.nil? || File.exist?(File.join(dir, 'exit.status')) ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)") if long
248
248
 
249
249
  if options[:batch_parameters]
250
250
  puts Log.color(:magenta, "BATCH parameters: ")
@@ -316,7 +316,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
316
316
  end
317
317
 
318
318
 
319
- if tail && File.exists?(File.join(dir, 'std.err'))
319
+ if tail && File.exist?(File.join(dir, 'std.err'))
320
320
  if exit_status && exit_status != 0
321
321
  puts Log.color(:magenta, "First error or exception found: ")
322
322
  puts CMD.cmd("grep -i -w 'error\\|[a-z]*exception' #{File.join(dir, 'std.err')} -A #{tail.to_i} |head -n #{tail.to_i}", :no_fail => true).read
@@ -46,7 +46,7 @@ if directory =~ /^[0-9]*$/
46
46
  end
47
47
  end
48
48
 
49
- raise ParameterException, "Could not identify job #{directory}" unless File.exists?(directory)
49
+ raise ParameterException, "Could not identify job #{directory}" unless File.exist?(directory)
50
50
 
51
51
  require 'rbbt/hpc/slurm'
52
52
 
@@ -97,19 +97,19 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
97
97
 
98
98
  different_system = job_batch_system != batch_system
99
99
 
100
- if File.exists?(fid = File.join(dir, 'job.id'))
100
+ if File.exist?(fid = File.join(dir, 'job.id'))
101
101
  id = Open.read(fid).chomp
102
102
  else
103
103
  id = nil
104
104
  end
105
105
 
106
- if File.exists?(fstatus = File.join(dir, 'exit.status'))
106
+ if File.exist?(fstatus = File.join(dir, 'exit.status'))
107
107
  exit_status = Open.read(fstatus).to_i
108
108
  else
109
109
  exit_status = nil
110
110
  end
111
111
 
112
- if File.exists?(fstatus = File.join(dir, 'job.status'))
112
+ if File.exist?(fstatus = File.join(dir, 'job.status'))
113
113
  fstatus_txt = Open.read(fstatus)
114
114
  begin
115
115
  if job_batch_system == "lsf"
@@ -126,17 +126,17 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
126
126
  nodes = []
127
127
  end
128
128
 
129
- if File.exists?(File.join(dir, 'std.out'))
129
+ if File.exist?(File.join(dir, 'std.out'))
130
130
  outt = File.mtime File.join(dir, 'std.out')
131
131
  errt = File.mtime File.join(dir, 'std.err')
132
132
  time_diff = Time.now - [outt, errt].max
133
133
  end
134
134
 
135
135
  fdep = File.join(dir, 'dependencies.list')
136
- deps = Open.read(fdep).split("\n") if File.exists?(fdep)
136
+ deps = Open.read(fdep).split("\n") if File.exist?(fdep)
137
137
 
138
138
  fcadep = File.join(dir, 'canfail_dependencies.list')
139
- cadeps = Open.read(fcadep).split("\n") if File.exists?(fcadep)
139
+ cadeps = Open.read(fcadep).split("\n") if File.exist?(fcadep)
140
140
 
141
141
  aborted = error = true if aborted.nil? && error.nil?
142
142
  #if done || error || aborted || running || queued || jobid || search
@@ -177,7 +177,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
177
177
  puts Log.color(:magenta, "Dependencies: ") << deps * ", " if deps
178
178
  puts Log.color(:magenta, "Dependencies (can fail): ") << cadeps * ", " if cadeps
179
179
  puts Log.color(:magenta, "Nodes: ") << nodes * ", "
180
- puts Log.color(:magenta, "Output: ") << File.exists?(File.join(dir, 'std.out')).to_s << (id.nil? ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)")
180
+ puts Log.color(:magenta, "Output: ") << File.exist?(File.join(dir, 'std.out')).to_s << (id.nil? ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)")
181
181
 
182
182
  if options[:batch_parameters]
183
183
  puts Log.color(:magenta, "BATCH parameters: ")
@@ -189,7 +189,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
189
189
  end
190
190
  end
191
191
 
192
- if tail && File.exists?(File.join(dir, 'std.err'))
192
+ if tail && File.exist?(File.join(dir, 'std.err'))
193
193
  if exit_status && exit_status != 0
194
194
  puts Log.color(:magenta, "First error or exception found: ")
195
195
  puts CMD.cmd("grep -i -w 'error\\|[a-z]*exception' #{File.join(dir, 'std.err')} -A #{tail.to_i} |head -n #{tail.to_i}", :no_fail => true).read
@@ -118,19 +118,19 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
118
118
  container_home = nil
119
119
  end
120
120
 
121
- if File.exists?(fid = File.join(dir, 'job.id'))
121
+ if File.exist?(fid = File.join(dir, 'job.id'))
122
122
  id = Open.read(fid).chomp
123
123
  else
124
124
  id = nil
125
125
  end
126
126
 
127
- if File.exists?(fstatus = File.join(dir, 'exit.status'))
127
+ if File.exist?(fstatus = File.join(dir, 'exit.status'))
128
128
  exit_status = Open.read(fstatus).to_i
129
129
  else
130
130
  exit_status = nil
131
131
  end
132
132
 
133
- if File.exists?(fstatus = File.join(dir, 'job.status'))
133
+ if File.exist?(fstatus = File.join(dir, 'job.status'))
134
134
  fstatus_txt = Open.read(fstatus)
135
135
  begin
136
136
  if job_batch_system == "lsf"
@@ -147,13 +147,13 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
147
147
  nodes = []
148
148
  end
149
149
 
150
- if File.exists?(File.join(dir, 'exit.status'))
150
+ if File.exist?(File.join(dir, 'exit.status'))
151
151
  now = File.ctime(File.join(dir, 'exit.status'))
152
152
  else
153
153
  now = Time.now
154
154
  end
155
155
 
156
- if File.exists?(File.join(dir, 'std.out'))
156
+ if File.exist?(File.join(dir, 'std.out'))
157
157
  cerrt = File.ctime File.join(dir, 'std.err')
158
158
  coutt = File.ctime File.join(dir, 'std.out')
159
159
  outt = File.mtime File.join(dir, 'std.out')
@@ -163,10 +163,10 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
163
163
  end
164
164
 
165
165
  fdep = File.join(dir, 'dependencies.list')
166
- deps = Open.read(fdep).split("\n") if File.exists?(fdep)
166
+ deps = Open.read(fdep).split("\n") if File.exist?(fdep)
167
167
 
168
168
  fcadep = File.join(dir, 'canfail_dependencies.list')
169
- cadeps = Open.read(fcadep).split("\n") if File.exists?(fcadep)
169
+ cadeps = Open.read(fcadep).split("\n") if File.exist?(fcadep)
170
170
 
171
171
  if done || error || aborted || running || queued || jobid
172
172
  select = false
@@ -244,7 +244,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
244
244
  puts Log.color(:magenta, "Dependencies (can fail): ") << cadeps * ", " if cadeps
245
245
  puts Log.color(:magenta, "Nodes: ") << nodes * ", " if long
246
246
  puts Log.color(:magenta, "Time elapsed: ") << Misc.format_seconds(time_elapsed) if time_elapsed
247
- puts Log.color(:magenta, "Output: ") << File.exists?(File.join(dir, 'std.out')).to_s << (id.nil? || File.exists?(File.join(dir, 'exit.status')) ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)") if long
247
+ puts Log.color(:magenta, "Output: ") << File.exist?(File.join(dir, 'std.out')).to_s << (id.nil? || File.exist?(File.join(dir, 'exit.status')) ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)") if long
248
248
 
249
249
  if options[:batch_parameters]
250
250
  puts Log.color(:magenta, "BATCH parameters: ")
@@ -316,7 +316,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
316
316
  end
317
317
 
318
318
 
319
- if tail && File.exists?(File.join(dir, 'std.err'))
319
+ if tail && File.exist?(File.join(dir, 'std.err'))
320
320
  if exit_status && exit_status != 0
321
321
  puts Log.color(:magenta, "First error or exception found: ")
322
322
  puts CMD.cmd("grep -i -w 'error\\|[a-z]*exception' #{File.join(dir, 'std.err')} -A #{tail.to_i} |head -n #{tail.to_i}", :no_fail => true).read
@@ -46,7 +46,7 @@ if directory =~ /^[0-9]*$/
46
46
  end
47
47
  end
48
48
 
49
- raise ParameterException, "Could not identify job #{directory}" unless File.exists?(directory)
49
+ raise ParameterException, "Could not identify job #{directory}" unless File.exist?(directory)
50
50
 
51
51
  require 'rbbt/hpc/slurm'
52
52
 
@@ -38,12 +38,12 @@ when options[:tokyocabinet_bd]
38
38
  else
39
39
  if String === file
40
40
  file = file.dup
41
- Path.setup(File.expand_path(file))
41
+ file = Path.setup(File.expand_path(file))
42
42
  end
43
43
  tsv = file
44
44
  end
45
45
 
46
- tsv = TSV.open(tsv) if IO === tsv
46
+ tsv = TSV.open(tsv) if IO === tsv || Path === tsv
47
47
 
48
48
 
49
49
  begin
@@ -28,5 +28,5 @@ SOPT.usage if options[:help]
28
28
 
29
29
  target, *files = ARGV
30
30
 
31
- raise "Target already exists: #{ target }" if File.exists?(target) and not File.directory?(target)
31
+ raise "Target already exists: #{ target }" if File.exist?(target) and not File.directory?(target)
32
32
  Step.archive(files, target)
@@ -36,14 +36,14 @@ file = ARGV.shift
36
36
 
37
37
  $seen = []
38
38
  def get_step(file)
39
- file = File.expand_path(file) if File.exists?(file)
39
+ file = File.expand_path(file) if File.exist?(file)
40
40
  file = file.sub(/\.(info|files)$/,'')
41
41
  $seen << file
42
42
  Workflow.load_step file
43
43
  end
44
44
 
45
45
  def touch(step)
46
- return unless File.exists?(step.path)
46
+ return unless File.exist?(step.path)
47
47
  step.dependencies.each do |dep|
48
48
  next unless Open.exists?(dep.path)
49
49
  if Open.mtime(dep.path) > Open.mtime(step.path) + 1
@@ -52,7 +52,7 @@ class TestEntityIdentifiers < Test::Unit::TestCase
52
52
  tsv.key_field = key_field
53
53
  tsv.fields = [description_field, gene_field]
54
54
  descriptions = tsv.slice(description_field)
55
- Open.write(description_file, descriptions.to_single.to_s) #unless File.exists? description_file
55
+ Open.write(description_file, descriptions.to_single.to_s) #unless File.exist? description_file
56
56
  values = tsv.slice(gene_field)
57
57
  values.identifiers = description_file
58
58
 
@@ -181,7 +181,7 @@ class TestOpen < Test::Unit::TestCase
181
181
  Misc.consume_stream(StringIO.new(text), false, file)
182
182
 
183
183
  assert_equal text, Open.read(file)
184
- assert !File.exists?(file)
184
+ assert !File.exist?(file)
185
185
  assert Open.exists? file
186
186
  end
187
187
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.34.8
4
+ version: 5.34.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-27 00:00:00.000000000 Z
11
+ date: 2022-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake