Bladeren bron

Files and Folder are now alphabeticly ordered

Manuel Gall 3 jaren geleden
bovenliggende
commit
10c1dad321
1 gewijzigde bestanden met toevoegingen van 4 en 2 verwijderingen
  1. 4 2
      server/ustore.rb

+ 4 - 2
server/ustore.rb

@@ -32,7 +32,7 @@ class GetFolders < Riddl::Implementation
       Dir.chdir(@r[i])   
       i +=1
     end
-    Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(Dir.glob('*/')))
+    Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(Dir.glob('*/').sort_by{|x| x.downcase}))
   end
 end
 
@@ -58,7 +58,7 @@ class GetAllFolders < Riddl::Implementation
       Dir.chdir(@r[i])   
       i +=1
     end
-    Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(Dir.glob('**/*/')))
+    Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(Dir.glob('**/*/').sort_by{|x| x.downcase}))
   end
 end
 
@@ -81,6 +81,8 @@ class GetImages < Riddl::Implementation
         ret.append(e)
       end
     }
+    ret = ret.sort_by{|x| x.downcase}
+    ret2 = ret2.sort_by{|x| x.downcase}
     Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(ret + ret2))
   end
 end