sushi_fabric 1.0.0 → 1.0.1

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: 795af5bedd1d25f2f6c41bcab16b699b015df28615ff1ef5a975f330ba8f7255
4
- data.tar.gz: ebc667d556828450ae331a4e63ed07bde0b4871b97d18747bc71ff6e407f185a
3
+ metadata.gz: 6bb6ed61655c7decac6439f7bd3c73784888ae9686d2611c10f9d4c40bda0621
4
+ data.tar.gz: 91e98688ac53cfc55560decb2537ee1b38e9c93d24ffb4cfae02875088e2e910
5
5
  SHA512:
6
- metadata.gz: 6ae60c4d4acef1444c9b1bfdb11f2dc6455add3414cfc63412603051d992c402c67037c45ff136b905ac2166100e36fa3f1e3c8d313cea80bc24c31a3b7f2577
7
- data.tar.gz: 8a046912e3b798e662b9e1131d5a0151f36cbb83e4eb986c9827dff6e410e1910c2965d383daba7a1dc9a5798f08c566feb72bb3c812cbdcbf1f7fe9d4cf575d
6
+ metadata.gz: d2ffd594a92358285b0996f0fa06053af38cb65cfe337049b0e619f7e590fdd8ae91b005adfa50c088ced30b7c8235dd7f6d469f36284af62e5a94f5bab7d4b7
7
+ data.tar.gz: b5ee9600a1e1b2fe1d76b27bc37cc30a230a5cafb0e613fb5ab13f587ddade33e8f365c87be81e315239d78fb90c99bffe9f65d5ede95f62c8947c1c540be75a
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
- # Version = '20200724-120813'
3
+ # Version = '20201105-115625'
4
4
 
5
5
  require 'csv'
6
6
  require 'fileutils'
@@ -390,16 +390,18 @@ class SushiApp
390
390
  FileUtils.mkdir_p(@scratch_result_dir)
391
391
  FileUtils.mkdir_p(@job_script_dir)
392
392
  end
393
- def check_latest_module_version(mod)
394
- command_out = %x[ bash -lc "source #{@module_source}; module whatis #{mod} 2>&1" ]
395
- latest_mod = nil
396
- command_out.split("\n").each do |line|
397
- if line =~ /#{mod}/
398
- latest_mod = line.split.first
399
- break
393
+ def check_latest_modules_version(modules)
394
+ command_out = %x[ bash -lc "source #{@module_source}; module whatis #{modules.join(" ")} 2>&1" | cut -f 1 -d " " | sort | uniq ]
395
+ latest_modules = []
396
+ command_out.split("\n").each do |line_|
397
+ line = line_.chomp
398
+ unless line.empty?
399
+ if line =~ /#{modules.join("|")}/
400
+ latest_modules << line
401
+ end
400
402
  end
401
403
  end
402
- latest_mod
404
+ latest_modules
403
405
  end
404
406
  def job_header
405
407
  @scratch_dir = if @params['process_mode'] == 'SAMPLE'
@@ -419,9 +421,17 @@ class SushiApp
419
421
  ""
420
422
  end
421
423
  module_add_commands = if @modules and !@modules.empty?
422
- modules_with_version = @modules.map{|mod| check_latest_module_version(mod)}
423
- modules_with_version.compact!
424
- "module add #{modules_with_version.join(' ')}"
424
+ modules_with_version = check_latest_modules_version(@modules)
425
+ if @modules.length == modules_with_version.length
426
+ modules_with_version.compact!
427
+ "module add #{modules_with_version.join(' ')}"
428
+ else
429
+ @logger.error("#"*100)
430
+ @logger.error("# Error in checking modules ")
431
+ @logger.error("# Please check if all modules are correctly installed, searched #{@modules.join(",")} but only detected #{modules_with_version.join(",")}")
432
+ @logger.error("#"*100)
433
+ "exit # Please check if all modules are correctly installed, searched #{@modules.join(",")} but only detected #{modules_with_version.join(",")}"
434
+ end
425
435
  else
426
436
  ""
427
437
  end
@@ -1,3 +1,3 @@
1
1
  module SushiFabric
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sushi_fabric
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Functional Genomics Center Zurich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-24 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler