[ARVADOS] created: b8467da4522299faea997eadf2d2171c79c12b27

git at public.curoverse.com git at public.curoverse.com
Thu May 7 17:30:25 EDT 2015


        at  b8467da4522299faea997eadf2d2171c79c12b27 (commit)


commit b8467da4522299faea997eadf2d2171c79c12b27
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Thu May 7 17:06:54 2015 -0400

    5682: move logic to check if '/' in filename into each_file_spec method from files method so that it is applied in all contexts using the each_file_spec method.

diff --git a/sdk/ruby/lib/arvados/keep.rb b/sdk/ruby/lib/arvados/keep.rb
index a1f418b..422dab5 100644
--- a/sdk/ruby/lib/arvados/keep.rb
+++ b/sdk/ruby/lib/arvados/keep.rb
@@ -154,7 +154,16 @@ module Keep
             stream_name = unescape token
           elsif in_file_tokens or not Locator.valid? token
             in_file_tokens = true
-            yield [stream_name] + split_file_token(token)
+
+            file_tokens = split_file_token(token)
+            stream_name_adjuster = ''
+            if file_tokens[2].include?('/')                # '/' in filename
+              parts = file_tokens[2].rpartition('/')
+              stream_name_adjuster = parts[1] + parts[0]   # /dir_parts
+              file_tokens[2] = parts[2]
+            end
+
+            yield [stream_name + stream_name_adjuster] + file_tokens
           end
         end
       end
@@ -165,11 +174,6 @@ module Keep
       if @files.nil?
         file_sizes = Hash.new(0)
         each_file_spec do |streamname, _, filesize, filename|
-          if filename.include?('/')
-            parts = filename.rpartition('/')
-            streamname = streamname + parts[1] + parts[0]   # ./dir_parts
-            filename = parts[2]
-          end
           file_sizes[[streamname, filename]] += filesize
         end
         @files = file_sizes.each_pair.map do |(streamname, filename), size|

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list