cnvrg 1.4.9.2 → 1.4.9.4

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: 82d6237ddf965c30cbc18423f39929acf57df54047817c093c6db6d6263e1a31
4
- data.tar.gz: 4738157c73f5f87fd4b4b3166eec8bdc1c0d1658749f209b51962813b75c50dd
3
+ metadata.gz: 57cfbe5e8781c875703c195139bb558edd39db3c70d35920efc48152412f63d2
4
+ data.tar.gz: 35c51593cfef1e3a54e33a95f801e5b09114df80ce5be03f2770408cc33bb0f5
5
5
  SHA512:
6
- metadata.gz: 800049d7ef5ee405b5350f5b649930ea7cd26616a66dd89b8e06ba8f7fd09bf223cbbfc05c9ec99e65c7df2096f31920bb1d268565f4537cc854160fb7fbd995
7
- data.tar.gz: dc7a3afc3d2e39042327f085efb0c07efcd032d15d697913bf1e21648f3f3c2ba8c366385f4ba9e7b246025434e17ee4df9dcf52a6672254e24aebb76e26df4b
6
+ metadata.gz: b60b3f6689af7a7d7446a52cf01c34043af9811ad3e132a5788372b51bbc83cd429ffe94d899ca53121018d3328028b14d82046bf1d0be22fefa0118fb0a17e3
7
+ data.tar.gz: 3c083bf5f3dc563a4863b34ba0db6a82e53f134c324b2d37e20ad08dbfc9ad9e6809e3778df197a897a43df2538a18f571293ae2e26bc62a484d738f91c56d22
@@ -29,18 +29,18 @@ module Cnvrg
29
29
  end
30
30
 
31
31
  def init_home(remote: false)
32
- dataset_home = Dir.pwd
33
- if not remote
34
- dataset_home += "/"+@slug
35
- end
36
- if !remote and (Dir.exists? dataset_home)
37
- Cnvrg::CLI.log_message("Error: Conflict with dir #{@slug}", Thor::Shell::Color::RED)
38
- if Thor::Shell::Basic.new.no? "Sync to repository anyway? (current data might lost)", Thor::Shell::Color::YELLOW
39
- Cnvrg::CLI.log_message("Remove dir in order to clone #{@slug}", Thor::Shell::Color::RED)
40
- exit(1)
32
+ dataset_home = File.join(Dir.pwd, @slug)
33
+ if Dir.exists? dataset_home
34
+ if !remote
35
+ Cnvrg::CLI.log_message("Error: Conflict with dir #{@slug}", Thor::Shell::Color::RED)
36
+ if Thor::Shell::Basic.new.no? "Sync to repository anyway? (current data might lost)", Thor::Shell::Color::YELLOW
37
+ Cnvrg::CLI.log_message("Remove dir in order to clone #{@slug}", Thor::Shell::Color::RED)
38
+ exit(1)
39
+ end
41
40
  end
42
41
  FileUtils.rm_rf(dataset_home)
43
42
  end
43
+
44
44
  # if Dataset.clone(owner, dataset_name, slug, remote)
45
45
  Dataset.clone(@owner, @slug, @slug, remote)
46
46
  @local_path = dataset_home
@@ -378,35 +378,28 @@ module Cnvrg
378
378
  end
379
379
 
380
380
  def clone(commit)
381
-
382
-
383
- return response
381
+ return
384
382
  end
385
383
 
386
384
  def self.clone(owner, dataset_name, dataset_slug, remote = false)
387
385
  begin
388
386
  list_dirs = []
389
- prefix = dataset_name + "/"
390
- list_dirs << ".cnvrg"
387
+ if !remote
388
+ list_dirs << dataset_name
389
+ end
390
+ list_dirs << "#{dataset_name}/.cnvrg"
391
391
  list_files = [
392
- ".cnvrgignore",
393
- ".cnvrg/config.yml"
392
+ "#{dataset_name}/.cnvrg/config.yml",
394
393
  ]
395
394
 
396
395
  config = {dataset_name: dataset_name,
397
396
  dataset_slug: dataset_slug,
398
397
  owner: owner}
399
- config_yml_path = ".cnvrg/config.yml"
400
- if not remote
401
- list_dirs = list_dirs.map {|x| prefix+x}
402
- list_dirs << dataset_name
403
- list_files = list_files.map {|x| prefix+x}
404
- config_yml_path = prefix + config_yml_path
405
- end
398
+
406
399
 
407
400
  FileUtils.mkdir_p list_dirs
408
401
  FileUtils.touch list_files
409
- File.open(config_yml_path, "w+") {|f| f.write config.to_yaml}
402
+ File.open("#{dataset_name}/.cnvrg/config.yml", "w+") {|f| f.write config.to_yaml}
410
403
  rescue => e
411
404
  puts "Exception in clone request:#{e.message}"
412
405
  return false
@@ -442,7 +435,7 @@ module Cnvrg
442
435
 
443
436
  def write_success(in_folder = false)
444
437
  file_path = ".cnvrg/config.yml"
445
- file_path = "#{@slug}/" + file_path if !in_folder
438
+ file_path = File.join(@local_path || @working_dir, file_path)
446
439
  if File.exist?(file_path)
447
440
  File.open(file_path, "a") {|f| f.puts(":success: true")}
448
441
  end
@@ -1,4 +1,4 @@
1
1
  module Cnvrg
2
- VERSION = '1.4.9.2'
2
+ VERSION = '1.4.9.4'
3
3
  end
4
4
 
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.4.9.2
4
+ version: 1.4.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yochay Ettun