[ARVADOS] created: 17e59fe02aa59b9fbf3b852d2521714782a6d327

git at public.curoverse.com git at public.curoverse.com
Sat Apr 18 22:26:42 EDT 2015


        at  17e59fe02aa59b9fbf3b852d2521714782a6d327 (commit)


commit 17e59fe02aa59b9fbf3b852d2521714782a6d327
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Sat Apr 18 22:25:55 2015 -0400

    5179: update arvados ruby sdk gem version in workbench.

diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index 91c21f1..974666a 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -1,7 +1,7 @@
 source 'https://rubygems.org'
 
 gem 'rails', '~> 4.1.0'
-gem 'arvados', '>= 0.1.20150413172135'
+gem 'arvados', '>= 0.1.20150419022214'
 
 gem 'sqlite3'
 
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 59d72f4..65ef696 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -40,7 +40,7 @@ GEM
     andand (1.3.3)
     angularjs-rails (1.3.8)
     arel (5.0.1.20140414130214)
-    arvados (0.1.20150413172135)
+    arvados (0.1.20150419022214)
       activesupport (>= 3.2.13)
       andand (~> 1.3, >= 1.3.3)
       google-api-client (~> 0.6.3, >= 0.6.3)
@@ -258,7 +258,7 @@ DEPENDENCIES
   RedCloth
   andand
   angularjs-rails
-  arvados (>= 0.1.20150413172135)
+  arvados (>= 0.1.20150419022214)
   bootstrap-sass (~> 3.1.0)
   bootstrap-tab-history-rails
   bootstrap-x-editable-rails

commit e1eabe76d75d783655c5e3513b9c6e0ffbfd9b52
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Sat Apr 18 22:22:14 2015 -0400

    5179: update files method to move dir parts to streamname.

diff --git a/sdk/ruby/lib/arvados/keep.rb b/sdk/ruby/lib/arvados/keep.rb
index e4f6208..a1f418b 100644
--- a/sdk/ruby/lib/arvados/keep.rb
+++ b/sdk/ruby/lib/arvados/keep.rb
@@ -165,6 +165,11 @@ 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|
diff --git a/sdk/ruby/test/sdk_fixtures.rb b/sdk/ruby/test/sdk_fixtures.rb
index 52d7377..80dfabf 100644
--- a/sdk/ruby/test/sdk_fixtures.rb
+++ b/sdk/ruby/test/sdk_fixtures.rb
@@ -54,6 +54,8 @@ module SDKFixtures
   NONNORMALIZED_MANIFEST =
     ["./dir2 #{random_block} 0:0:z 0:0:y 0:0:x",
      "./dir1 #{random_block} 0:0:p 0:0:o 0:0:n\n"].join("\n")
+  MULTILEVEL_MANIFEST_WITH_DIRS_IN_FILENAMES =
+    [". #{random_block(10)} 0:3:file1 3:3:dir1/file1 6:3:dir1/dir2/file1\n"].join("")
 
   ### Non-tree manifests
   # These manifests follow the spec, but they express a structure that can't
diff --git a/sdk/ruby/test/test_keep_manifest.rb b/sdk/ruby/test/test_keep_manifest.rb
index f1f1a53..18b58ca 100644
--- a/sdk/ruby/test/test_keep_manifest.rb
+++ b/sdk/ruby/test/test_keep_manifest.rb
@@ -208,4 +208,22 @@ class ManifestTest < Minitest::Test
       assert !file_name.empty?, "empty file_name in #{name} fixture"
     end
   end
+
+  def test_multilevel_collection_with_dirs_in_filenames
+    manifest = Keep::Manifest.new(MULTILEVEL_MANIFEST_WITH_DIRS_IN_FILENAMES)
+
+    seen = Hash.new { |this, key| this[key] = [] }
+
+    manifest.files.each do |stream, basename, size|
+      refute(seen[stream].include?(basename), "each_file repeated #{stream}/#{basename}")
+      assert_equal(3, size, "wrong size for #{stream}/#{basename}")
+      seen[stream] << basename
+    end
+
+    assert_equal(%w(. ./dir1 ./dir1/dir2), seen.keys)
+
+    seen.each_pair do |stream, basenames|
+      assert_equal(%w(file1), basenames.sort, "wrong file list for #{stream}")
+    end
+  end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list