[ARVADOS] updated: c95e2762749ac2eb98fd7aec45134549174213d8

git at public.curoverse.com git at public.curoverse.com
Thu May 22 19:49:41 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/folders_controller.rb | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

       via  c95e2762749ac2eb98fd7aec45134549174213d8 (commit)
      from  84decc8949fc51ec2eaf906fc2c4cbbb3df807dd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit c95e2762749ac2eb98fd7aec45134549174213d8
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu May 22 19:49:29 2014 -0400

    2760: Use lambdas instead of defining methods with misleading scope.

diff --git a/apps/workbench/app/controllers/folders_controller.rb b/apps/workbench/app/controllers/folders_controller.rb
index fe7c9d2..94689ac 100644
--- a/apps/workbench/app/controllers/folders_controller.rb
+++ b/apps/workbench/app/controllers/folders_controller.rb
@@ -52,23 +52,23 @@ class FoldersController < ApplicationController
       children_of[parent_of[ob.uuid]] ||= []
       children_of[parent_of[ob.uuid]] << ob
     end
-    def buildtree children_of, root_uuid=false
+    buildtree = lambda do |children_of, root_uuid=false|
       tree = {}
       children_of[root_uuid].andand.each do |ob|
-        tree[ob] = buildtree(children_of, ob.uuid)
+        tree[ob] = buildtree.call(children_of, ob.uuid)
       end
       tree
     end
-    def sorted_paths tree, depth=0
+    sorted_paths = lambda do |tree, depth=0|
       paths = []
       tree.keys.sort_by { |ob| ob.friendly_link_name }.each do |ob|
         paths << {object: ob, depth: depth}
-        paths += sorted_paths tree[ob], depth+1
+        paths += sorted_paths.call tree[ob], depth+1
       end
       paths
     end
-    @my_folder_tree = sorted_paths buildtree(children_of, 'me')
-    @shared_folder_tree = sorted_paths buildtree(children_of, false)
+    @my_folder_tree = sorted_paths.call buildtree.call(children_of, 'me')
+    @shared_folder_tree = sorted_paths.call buildtree.call(children_of, false)
   end
 
   def choose

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list