arvados 1.3.1.20190320201707 → 1.3.2.20181129194931

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
  SHA1:
3
- metadata.gz: d4bd9fd87d67c3d5d1dd096ba8418b17c7b0515e
4
- data.tar.gz: 393a7a3a34e799a0dc290587714f32dec1e46dd4
3
+ metadata.gz: 4cb797cbaf0ec49d8eb4e780d31decb08cccb955
4
+ data.tar.gz: 8e009b72e581fa2023c9e0ec3b91646a45dec5e9
5
5
  SHA512:
6
- metadata.gz: fb762c3560b7082a0bccdd257a7a8b39eb65aa79fcc7bdaaca88056a9a54b00e16c2b38ab7d348765bba6270cf4724f450aaafe234ddb2a225b4394f459a7094
7
- data.tar.gz: 48c3cc63b6cee3542eaf9251cabcf5235d270c72f1e0a685e810facc16a66f69cf3d86be8b8a5d738c47152e78214d8af800be11cf1d8c18bc83970b516d77bc
6
+ metadata.gz: 47c9ab2ee660d4a3ec31bf82ee227bf4176b0fd12b7a38020f275c2b7c5a4d0bd1cdd09510809e6a90ed627de5eb1638529d236a03de18efa1b093a0cc9c899d
7
+ data.tar.gz: 3c6ae59e4bfdaa4a2175549b87028c59e19665d378288af696060685c825f4a55c112e7aaa7083a0cfe2226cf4652e965e07c12fb0d2be7518eb8c94a3b64127
@@ -369,11 +369,7 @@ module Arv
369
369
  end
370
370
 
371
371
  def add_copy(src_item, key)
372
- if key == "."
373
- self[key] = src_item.copy_named("#{path}")
374
- else
375
- self[key] = src_item.copy_named("#{path}/#{key}")
376
- end
372
+ self[key] = src_item.copy_named("#{path}/#{key}")
377
373
  end
378
374
 
379
375
  def merge(src_item, key)
@@ -461,10 +457,6 @@ module Arv
461
457
  items["."] = CollectionStream.new(".")
462
458
  end
463
459
 
464
- def add_copy(src_item, key)
465
- items["."].add_copy(src_item, key)
466
- end
467
-
468
460
  def raise_root_write_error(key)
469
461
  raise ArgumentError.new("can't write to %p at collection root" % key)
470
462
  end
@@ -101,14 +101,8 @@ module Keep
101
101
  end
102
102
 
103
103
  class Manifest
104
- STREAM_TOKEN_REGEXP = /^([^\000-\040\\]|\\[0-3][0-7][0-7])+$/
105
- STREAM_NAME_REGEXP = /^(\.)(\/[^\/]+)*$/
106
-
107
- EMPTY_DIR_TOKEN_REGEXP = /^0:0:\.$/ # The exception when a file can have '.' as a name
108
- FILE_TOKEN_REGEXP = /^[[:digit:]]+:[[:digit:]]+:([^\000-\040\\]|\\[0-3][0-7][0-7])+$/
109
- FILE_NAME_REGEXP = /^[[:digit:]]+:[[:digit:]]+:([^\/]+(\/[^\/]+)*)$/
110
-
111
- NON_8BIT_ENCODED_CHAR = /[^\\]\\[4-7][0-7][0-7]/
104
+ STRICT_STREAM_TOKEN_REGEXP = /^(\.)(\/[^\/\s]+)*$/
105
+ STRICT_FILE_TOKEN_REGEXP = /^[[:digit:]]+:[[:digit:]]+:([^\s\/]+(\/[^\s\/]+)*)$/
112
106
 
113
107
  # Class to parse a manifest text and provide common views of that data.
114
108
  def initialize(manifest_text)
@@ -137,9 +131,7 @@ module Keep
137
131
  end
138
132
  end
139
133
 
140
- def self.unescape(s)
141
- return nil if s.nil?
142
-
134
+ def unescape(s)
143
135
  # Parse backslash escapes in a Keep manifest stream or file name.
144
136
  s.gsub(/\\(\\|[0-7]{3})/) do |_|
145
137
  case $1
@@ -151,10 +143,6 @@ module Keep
151
143
  end
152
144
  end
153
145
 
154
- def unescape(s)
155
- self.class.unescape(s)
156
- end
157
-
158
146
  def split_file_token token
159
147
  start_pos, filesize, filename = token.split(':', 3)
160
148
  if filename.nil?
@@ -174,15 +162,15 @@ module Keep
174
162
  elsif in_file_tokens or not Locator.valid? token
175
163
  in_file_tokens = true
176
164
 
177
- start_pos, file_size, file_name = split_file_token(token)
165
+ file_tokens = split_file_token(token)
178
166
  stream_name_adjuster = ''
179
- if file_name.include?('/') # '/' in filename
180
- dirname, sep, basename = file_name.rpartition('/')
181
- stream_name_adjuster = sep + dirname # /dir_parts
182
- file_name = basename
167
+ if file_tokens[2].include?('/') # '/' in filename
168
+ parts = file_tokens[2].rpartition('/')
169
+ stream_name_adjuster = parts[1] + parts[0] # /dir_parts
170
+ file_tokens[2] = parts[2]
183
171
  end
184
172
 
185
- yield [stream_name + stream_name_adjuster, start_pos, file_size, file_name]
173
+ yield [stream_name + stream_name_adjuster] + file_tokens
186
174
  end
187
175
  end
188
176
  end
@@ -209,13 +197,10 @@ module Keep
209
197
  # files. This can help you avoid parsing the entire manifest if you
210
198
  # just want to check if a small number of files are specified.
211
199
  if stop_after.nil? or not @files.nil?
212
- # Avoid counting empty dir placeholders
213
- return files.reject{|_, name, size| name == '.' and size == 0}.size
200
+ return files.size
214
201
  end
215
202
  seen_files = {}
216
- each_file_spec do |streamname, _, filesize, filename|
217
- # Avoid counting empty dir placeholders
218
- next if filename == "." and filesize == 0
203
+ each_file_spec do |streamname, _, _, filename|
219
204
  seen_files[[streamname, filename]] = true
220
205
  return stop_after if (seen_files.size >= stop_after)
221
206
  end
@@ -265,9 +250,7 @@ module Keep
265
250
  count = 0
266
251
 
267
252
  word = words.shift
268
- raise ArgumentError.new "Manifest invalid for stream #{line_count}: >8-bit encoded chars not allowed on stream token #{word.inspect}" if word =~ NON_8BIT_ENCODED_CHAR
269
- unescaped_word = unescape(word)
270
- count += 1 if word =~ STREAM_TOKEN_REGEXP and unescaped_word =~ STREAM_NAME_REGEXP and unescaped_word !~ /\/\.\.?(\/|$)/
253
+ count += 1 if word =~ STRICT_STREAM_TOKEN_REGEXP and word !~ /\/\.\.?(\/|$)/
271
254
  raise ArgumentError.new "Manifest invalid for stream #{line_count}: missing or invalid stream name #{word.inspect if word}" if count != 1
272
255
 
273
256
  count = 0
@@ -279,9 +262,7 @@ module Keep
279
262
  raise ArgumentError.new "Manifest invalid for stream #{line_count}: missing or invalid locator #{word.inspect if word}" if count == 0
280
263
 
281
264
  count = 0
282
- raise ArgumentError.new "Manifest invalid for stream #{line_count}: >8-bit encoded chars not allowed on file token #{word.inspect}" if word =~ NON_8BIT_ENCODED_CHAR
283
- while unescape(word) =~ EMPTY_DIR_TOKEN_REGEXP or
284
- (word =~ FILE_TOKEN_REGEXP and unescape(word) =~ FILE_NAME_REGEXP and ($~[1].split('/') & ['..', '.']).empty?)
265
+ while word =~ STRICT_FILE_TOKEN_REGEXP and ($~[1].split('/') & ['..','.']).empty?
285
266
  word = words.shift
286
267
  count += 1
287
268
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arvados
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1.20190320201707
4
+ version: 1.3.2.20181129194931
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvados Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-20 00:00:00.000000000 Z
11
+ date: 2018-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -45,7 +45,7 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: 1.3.3
47
47
  - !ruby/object:Gem::Dependency
48
- name: arvados-google-api-client
48
+ name: cure-google-api-client
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
@@ -118,7 +118,7 @@ dependencies:
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
120
  version: 0.1.5
121
- description: Arvados client library, git commit a07891c7ac7e90ebdf35ae1812ec03c818fe2a67
121
+ description: Arvados client library, git commit 0d22de74ea069003b49a9d52878d5f1ac04d71bb
122
122
  email: gem-dev@curoverse.com
123
123
  executables: []
124
124
  extensions: []