sushi_fabric 1.2.8 → 1.3.0

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: 625777da16fc54a819726f5b5f82dcf309865c05c11f902a0065dd1d385d7307
4
- data.tar.gz: 628bec7e0c32fa99832d35bd2016eaee2bcec4984f71089b23d4b9ebbe7b0c37
3
+ metadata.gz: 5fd326eaf8b9a5122f254584de8c7c05d17f787bc794d9f6c0ae6aece9d3c43a
4
+ data.tar.gz: e8974e60c798c7d530cde78b651bcfc0dddec8d1bd251211051c05fd891079bd
5
5
  SHA512:
6
- metadata.gz: 928ddc2796c22bd809bbadc1b91c2a9aa4b15754b60a64a66d26c387b916386d5df39de3e5f8e42424e101256fe7ce55872521644ba96258b9381ea75cb3e59d
7
- data.tar.gz: 2d669efcfc9afce6ffad2f07b18496744d0a4b7b52588c519fe791fb8ee2eb23a4c5c8e48855c037359fd6081ffae54c58e483835ddc0a384ffd1b0c9ce2383a
6
+ metadata.gz: b33a127381df9c20f85cb2f12a9b43e76676c53e9fc2aab9376ffae7a2892d056d96b87bf2b42e6e2f46682c778cf6908e413d4d7eee1dfaa7e8f9cf2db93bf9
7
+ data.tar.gz: 0dcb5d15ab77db9c9f3c081e75703dfc9978c97bc3e814471ad906e47a5c55f5f5997a74c5afdc1f860b342827f751c18c07eece1405919e5ea0b848aaf3b99d
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
- # Version = '20240823-112404'
3
+ # Version = '20241121-112242'
4
4
 
5
5
  require 'csv'
6
6
  require 'fileutils'
@@ -178,22 +178,24 @@ def save_data_set(data_set_arr, headers, rows, user=nil)
178
178
  end
179
179
  sample = Sample.new
180
180
  sample.key_value = sample_hash.to_s
181
- sample.save unless sample.saved?
182
181
  data_set.samples << sample
183
182
  end
184
183
 
185
184
  data_set.md5 = data_set.md5hexdigest
186
- unless data_set.saved?
187
- project.data_sets << data_set
188
- parent_data_set.data_sets << data_set if parent_data_set
189
- data_set.save
190
- if user
191
- user.data_sets << data_set
192
- user.save
193
- end
194
- else
195
- headers[0] = DataSet.find_by_md5(data_set.md5)
196
- end
185
+ if data_set_ = DataSet.find_by_md5(data_set.md5) and data_set_.project_id == data_set.project_id
186
+ data_set = data_set_
187
+ else
188
+ data_set.samples.each do |sample|
189
+ sample.save
190
+ end
191
+ project.data_sets << data_set
192
+ parent_data_set.data_sets << data_set if parent_data_set
193
+ data_set.save
194
+ if user
195
+ user.data_sets << data_set
196
+ user.save
197
+ end
198
+ end
197
199
  data_set.id
198
200
  end
199
201
  end
@@ -794,7 +796,7 @@ rm -rf #{@scratch_dir} || exit 1
794
796
  end
795
797
  sample = Sample.new
796
798
  sample.key_value = sample_hash.to_s
797
- sample.save unless sample.saved?
799
+ #sample.save # skip exact-match search
798
800
  data_set.samples << sample
799
801
  end
800
802
 
@@ -803,17 +805,20 @@ rm -rf #{@scratch_dir} || exit 1
803
805
  end
804
806
 
805
807
  data_set.md5 = data_set.md5hexdigest
806
- unless data_set.saved?
807
- project.data_sets << data_set
808
- parent_data_set.data_sets << data_set if parent_data_set
809
- data_set.save
810
- if user
811
- user.data_sets << data_set
812
- user.save
813
- end
814
- else
815
- headers[0] = DataSet.find_by_md5(data_set.md5)
816
- end
808
+ if data_set_ = DataSet.find_by_md5(data_set.md5) and data_set_.project_id == data_set.project_id
809
+ data_set = data_set_
810
+ else
811
+ data_set.samples.each do |sample|
812
+ sample.save
813
+ end
814
+ project.data_sets << data_set
815
+ parent_data_set.data_sets << data_set if parent_data_set
816
+ data_set.save
817
+ if user
818
+ user.data_sets << data_set
819
+ user.save
820
+ end
821
+ end
817
822
  data_set.id
818
823
  end
819
824
  end
@@ -1,3 +1,3 @@
1
1
  module SushiFabric
2
- VERSION = "1.2.8"
2
+ VERSION = "1.3.0"
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.2.8
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Functional Genomics Center Zurich
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-23 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,7 +69,7 @@ homepage: ''
69
69
  licenses:
70
70
  - MIT
71
71
  metadata: {}
72
- post_install_message:
72
+ post_install_message:
73
73
  rdoc_options: []
74
74
  require_paths:
75
75
  - lib
@@ -84,8 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.5.5
88
- signing_key:
87
+ rubygems_version: 3.4.19
88
+ signing_key:
89
89
  specification_version: 4
90
90
  summary: workflow manager client.
91
91
  test_files: