]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
dumm: Sort templates by name
authorTobias Brunner <tobias@strongswan.org>
Mon, 15 Jul 2013 12:37:05 +0000 (14:37 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 15 Jul 2013 12:37:05 +0000 (14:37 +0200)
src/dumm/ext/dumm.c
src/dumm/ext/lib/dumm.rb

index 603fac088116d3933be22a85d97976996416e28e..5acda3a9c9722798e405adf3ba27da0da61f2e2b 100644 (file)
@@ -740,6 +740,7 @@ static VALUE template_each(int argc, VALUE *argv, VALUE class)
 static void template_init()
 {
        rbc_template = rb_define_class_under(rbm_dumm , "Template", rb_cObject);
+       rb_include_module(rb_class_of(rbc_template), rb_mEnumerable);
 
        rb_define_singleton_method(rbc_template, "load", template_load, 1);
        rb_define_singleton_method(rbc_template, "unload", template_unload, 0);
index bb60aad8fe03d9d2409f0f4c8bc30f0bae902f0b..959ec87dfb08ac542f4a8e08dd744f0f42cc0cab 100644 (file)
@@ -34,8 +34,9 @@ module Dumm
     if name
       Template.load name
     else
-      Template.each {|t| puts t }
+      Template.sort.each {|t| puts t }
     end
+    return Dumm
   end
   
   # unload template/overlays, reset all guests and delete bridges