cnvrg 0.0.1540000 → 0.0.1550000

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
  SHA1:
3
- metadata.gz: 021cf92b7a10351f3e2b5dffb061acbba7e335e2
4
- data.tar.gz: 087dac2c6aacf82f7ca15c9e51f4858e7cfd1035
3
+ metadata.gz: 0db2e4b87b2b283664175d5ee07d48d94ecf6ed2
4
+ data.tar.gz: c3d6b02f906f594d279a2ff5a359bb9c6b5fe5fb
5
5
  SHA512:
6
- metadata.gz: 34b286d7d0c4e9c3d93acc09c3f857674d0b75f575730bfa7bae48b8fa5396cf631714b53bb7c99b48d5e7603925574011cef44801e235e208b2992fcf9ef2bb
7
- data.tar.gz: 44dacf68e883b199b0ceabc6921a5c1d853155942d8ad5dadb207effeb4e7096ae54e61edf819ca2385a5142b1b49a274648da7ab259faac5da721d4dd154e1c
6
+ metadata.gz: f70c877f7896944f384bfd775ea5ff43c5d1e5f9c10997d921ff9f62579030be84a55dfcd5e7d7182f4efc9709f25363ef5c472bfff5187eaf8eb53468bbd7c5
7
+ data.tar.gz: 2fd2431db382ab7e89d115cadcd615ce6aa3827ea0bfff22042790594a2fcb048445636996657e127a567477d526ebba5bd097f33b80a1d1bc874e5f9ed63420
data/lib/cnvrg/cli.rb CHANGED
@@ -1629,6 +1629,7 @@ module Cnvrg
1629
1629
  begin
1630
1630
  log_start(__method__, args, options)
1631
1631
  @project = Project.new(get_project_home)
1632
+ ignore_list = @project.get_ignore_list()
1632
1633
 
1633
1634
  result = @project.compare_idx(false)["result"]
1634
1635
  result = result["tree"]
@@ -1685,6 +1686,7 @@ module Cnvrg
1685
1686
  new_branch = new_branch_exp
1686
1687
  end
1687
1688
  end
1689
+
1688
1690
  result = @project.compare_idx(new_branch)
1689
1691
  commit = result["result"]["commit"]
1690
1692
  if !link
@@ -578,8 +578,8 @@ module Cnvrg
578
578
  return response
579
579
  end
580
580
 
581
- def end_commit(commit_sha1)
582
- response = Cnvrg::API.request("#{base_resource}/commit/end", 'POST', {commit_sha1: commit_sha1})
581
+ def end_commit(commit_sha1,ignore_list)
582
+ response = Cnvrg::API.request("#{base_resource}/commit/end", 'POST', {commit_sha1: commit_sha1,ignore:ignore_list})
583
583
  return response
584
584
  end
585
585
 
data/lib/cnvrg/dataset.rb CHANGED
@@ -71,19 +71,17 @@ module Cnvrg
71
71
  ignore_list = []
72
72
  File.open(self.local_path+"/.cnvrgignore", "r").each_line do |line|
73
73
  line = line.strip
74
-
75
- if line.start_with? "#" or ignore_list.include? line
74
+ if line.start_with? "#" or ignore_list.include? line or line.empty?
76
75
  next
77
76
  end
78
77
  if line.end_with? "/" or File.directory?(line)
79
- if line.end_with? "/"
80
- ignore_list << line.chop
81
- else
82
- ignore_list << line
83
- end
78
+ ignore_list << line
84
79
  all_sub = Dir.glob("#{line}/**/*", File::FNM_DOTMATCH).flatten
80
+
85
81
  ignore_list << all_sub.flatten
86
- ignore_list << line
82
+ elsif line.include? "*"
83
+ regex_list = Dir.glob("**/*#{line}", File::FNM_DOTMATCH).flatten
84
+ ignore_list << regex_list
87
85
  else
88
86
  ignore_list << line
89
87
  end
@@ -232,6 +230,7 @@ module Cnvrg
232
230
  return response
233
231
  end
234
232
  def compare_idx(new_branch, commit=last_local_commit,local_idx=nil)
233
+
235
234
  if local_idx.nil?
236
235
  local_idx = self.generate_idx
237
236
  end
data/lib/cnvrg/project.rb CHANGED
@@ -55,15 +55,30 @@ module Cnvrg
55
55
  if line.start_with? "#" or ignore_list.include? line or line.empty?
56
56
  next
57
57
  end
58
- if line.end_with? "/" or File.directory?(line)
59
- if line.end_with? "/"
60
- ignore_list << line.chop
61
- else
62
- ignore_list << line
58
+ if line.ends_with? "*"
59
+ list_regex = Dir.glob("**/#{line}",File::FNM_DOTMATCH).flatten
60
+ list_regex.each do |l|
61
+ ignore_list << l
62
+ if File.directory?(l)
63
+ all_sub = Dir.glob("#{line}/**/*", File::FNM_DOTMATCH).flatten
64
+
65
+ ignore_list << all_sub.flatten
66
+ end
67
+
63
68
  end
69
+ elsif line.ends_with? "/*"
70
+ line = line.gsub("/*","")
71
+ regex_list = Dir.glob("**/#{line}/**/*", File::FNM_DOTMATCH).flatten
72
+ ignore_list << regex_list
73
+ elsif line.include? "*"
74
+ regex_list = Dir.glob("**/#{line}").flatten
75
+ ignore_list << regex_list
76
+ elsif line.end_with? "/" or File.directory?(line)
77
+ ignore_list << line
64
78
  all_sub = Dir.glob("#{line}/**/*", File::FNM_DOTMATCH).flatten
65
79
 
66
80
  ignore_list << all_sub.flatten
81
+
67
82
  else
68
83
  ignore_list << line
69
84
  end
@@ -147,7 +162,7 @@ module Cnvrg
147
162
  FileUtils.mkdir_p list_dirs
148
163
  FileUtils.touch list_files
149
164
  File.open(".cnvrg/config.yml", "w+") { |f| f.write config.to_yaml }
150
- File.open(".cnvrgignore", "w+") { |f| f.write cnvrgignore } unless File.exist? ".cnvrgignore"
165
+ File.open(".cnvrgignore", "w+") { |f| f.write cnvrgignore }
151
166
  if !File.exist? "README" and !File.exist? "README.md"
152
167
  FileUtils.touch [ "README.md" ]
153
168
  File.open("README.md", "w+") { |f| f.write cnvrgreadme }
@@ -244,23 +259,18 @@ module Cnvrg
244
259
  end
245
260
 
246
261
  tree_idx = Hash.new(0)
247
-
248
- list = Dir.glob("#{self.local_path}/**/**", File::FNM_DOTMATCH).reject { |x| (x =~ /\/\.{1,2}$/) or (x =~ /^#{self.local_path}\/\.cnvrg\/*/) }
262
+ list = Dir.glob("#{self.local_path}/**/*", File::FNM_DOTMATCH).reject { |x| (x =~ /\/\.{1,2}$/) or (x =~ /^#{self.local_path}\/\.cnvrg\/*/) or (x =~/^#{self.local_path}\/\.cnvrgignore.conflict*/) and not (x =~/^#{self.local_path}\/\.cnvrgignore/) }
249
263
  list_ignore = self.get_ignore_list()
250
264
  list.each do |e|
251
265
  label = e.gsub(self.local_path + "/", "")
252
-
266
+ ignore_label = label.gsub("/","//")
267
+ if list_ignore.include? ignore_label
268
+ next
269
+ end
253
270
  if File.directory? e
254
- if list_ignore.include? label
255
- next
256
- end
257
271
 
258
272
  tree_idx[label+"/"] = nil
259
273
  else
260
- if list_ignore.include? label
261
- next
262
- end
263
-
264
274
  sha1 = Digest::SHA1.file(e).hexdigest
265
275
  if old_idx.nil? or old_idx.to_h[:tree].nil?
266
276
  tree_idx[label] = {sha1: sha1, commit_time: nil}
@@ -289,7 +299,9 @@ module Cnvrg
289
299
  def compare_idx(new_branch, commit=last_local_commit)
290
300
 
291
301
  local_idx = self.generate_idx
292
- response = Cnvrg::API.request("users/#{self.owner}/projects/#{self.slug}/status", 'POST', {idx: local_idx, new_branch: new_branch, current_commit: commit})
302
+ ignore_list = self.get_ignore_list()
303
+ response = Cnvrg::API.request("users/#{self.owner}/projects/#{self.slug}/status", 'POST', {idx: local_idx, new_branch: new_branch,
304
+ current_commit: commit,ignore:ignore_list})
293
305
  CLI.is_response_success(response,false)
294
306
  return response
295
307
  end
data/lib/cnvrg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Cnvrg
2
- VERSION = '0.0.1540000'
2
+ VERSION = '0.0.1550000'
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: 0.0.1540000
4
+ version: 0.0.1550000
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yochay Ettun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-08-07 00:00:00.000000000 Z
12
+ date: 2017-08-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler