cnvrg 1.10.7 → 1.10.8

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: 1232c4c81a6429fdf01484ba321224d3e9a03c19914a59575eb867d12b206bdd
4
- data.tar.gz: 21ab04f21f6850fc6c9e7eddbcf807b6f7ac312f3c00a857be24cf38d710a784
3
+ metadata.gz: d9e8e76336bf9862fca95649740a7b5a5148565469ece725f4760041db28ffc4
4
+ data.tar.gz: f65852f97fb1294258c3c6b4b6941fb62248eeb1691d432e47bb4e2acb60a313
5
5
  SHA512:
6
- metadata.gz: 27c2738e285408a315fa8384b230d7c3e108e0b98ecf6b6bb57ee5d7996cbcce37db94fb8b98846195535ac24d7539a7ccfb72ef94fdc82955de1cc2e6e60300
7
- data.tar.gz: 470f1e94d6bbba179a637fdd9765c9b052f91bf1c37742d56541f592cb5a4fd38c11ffd12d554ed6d38b1a0d6f3eeacef84f3032afc175fc6a041880578c9e6e
6
+ metadata.gz: c5be8e6c872dd256560805d8146b3e2d7672a72844b932081dddc94c62e3fde4f9d7f66dd18d4f882c005c9e6e2183a91de689254b6dce07c265932058a4a1b0
7
+ data.tar.gz: 345eee06f18b24a30826665c7803b1275bdbc33d94779e5e37812cce7f95738bb819c5e2064871618145a27e72d133373e2493fb57f63b1c85ce8072c6057a54
@@ -409,8 +409,6 @@ module Cnvrg
409
409
  tree = @dataset.generate_chunked_idx(files_chunk, prefix: prefix, threads: threads)
410
410
  results = request_upload_files(commit_sha1, tree, override, new_branch, partial_commit)
411
411
 
412
- # puts "Got #{results['files'].size} files to upload from #{files_chunk.size} files"
413
-
414
412
  if results['files'].blank?
415
413
  progress_mutex.synchronize { progressbar.progress += tree.keys.length }
416
414
  next
@@ -544,8 +544,12 @@ module Cnvrg
544
544
  def generate_chunked_idx(list_files = [], threads: 15, prefix: '')
545
545
  tree = {}
546
546
  Parallel.map(list_files, in_threads: threads) do |file|
547
- #check if prefix exists do prefix/path otherwise path
548
- label = file.gsub(self.local_path + "/", "")
547
+
548
+ # Fix for root path issue
549
+ safe_path = file
550
+ safe_path = file[1..-1] if file.start_with? "/"
551
+
552
+ label = safe_path.gsub(self.local_path + "/", "")
549
553
  label = "#{prefix}/#{label}" if prefix.present?
550
554
  if not Cnvrg::Files.valid_file_name?(label)
551
555
  raise StandardError.new("#{label} is not a valid file name.")
@@ -558,9 +562,16 @@ module Cnvrg
558
562
  file_size = File.size(file).to_f
559
563
  mime_type = MimeMagic.by_path(file)
560
564
  content_type = !(mime_type.nil? or mime_type.text?) ? mime_type.type : "text/plain"
561
- relative_path = file.gsub(/^#{@local_path + "/"}/, "")
565
+ relative_path = safe_path.gsub(/^#{@local_path + "/"}/, "")
562
566
  relative_path = "#{prefix}/#{relative_path}" if prefix.present?
563
- tree[label] = {sha1: sha1, file_name: file_name, file_size: file_size, content_type: content_type, absolute_path: file, relative_path: relative_path}
567
+ tree[label] = {
568
+ sha1: sha1,
569
+ file_name: file_name,
570
+ file_size: file_size,
571
+ content_type: content_type,
572
+ absolute_path: file,
573
+ relative_path: relative_path
574
+ }
564
575
  end
565
576
  end
566
577
  if prefix.present? #add the prefix as dirs to the files
@@ -1,3 +1,3 @@
1
1
  module Cnvrg
2
- VERSION = '1.10.7'
2
+ VERSION = '1.10.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cnvrg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.7
4
+ version: 1.10.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yochay Ettun
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-08-16 00:00:00.000000000 Z
13
+ date: 2020-08-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -453,7 +453,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
453
453
  - !ruby/object:Gem::Version
454
454
  version: '0'
455
455
  requirements: []
456
- rubygems_version: 3.0.4
456
+ rubygems_version: 3.1.2
457
457
  signing_key:
458
458
  specification_version: 4
459
459
  summary: A CLI tool for interacting with cnvrg.io.