cnvrg 1.10.7 → 1.10.8
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 +4 -4
- data/lib/cnvrg/datafiles.rb +0 -2
- data/lib/cnvrg/dataset.rb +15 -4
- data/lib/cnvrg/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9e8e76336bf9862fca95649740a7b5a5148565469ece725f4760041db28ffc4
|
4
|
+
data.tar.gz: f65852f97fb1294258c3c6b4b6941fb62248eeb1691d432e47bb4e2acb60a313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5be8e6c872dd256560805d8146b3e2d7672a72844b932081dddc94c62e3fde4f9d7f66dd18d4f882c005c9e6e2183a91de689254b6dce07c265932058a4a1b0
|
7
|
+
data.tar.gz: 345eee06f18b24a30826665c7803b1275bdbc33d94779e5e37812cce7f95738bb819c5e2064871618145a27e72d133373e2493fb57f63b1c85ce8072c6057a54
|
data/lib/cnvrg/datafiles.rb
CHANGED
@@ -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
|
data/lib/cnvrg/dataset.rb
CHANGED
@@ -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
|
-
|
548
|
-
|
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 =
|
565
|
+
relative_path = safe_path.gsub(/^#{@local_path + "/"}/, "")
|
562
566
|
relative_path = "#{prefix}/#{relative_path}" if prefix.present?
|
563
|
-
tree[label] = {
|
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
|
data/lib/cnvrg/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|