Ticket #149: funky.diff

File funky.diff, 0.7 kB (added by judofyr, 10 months ago)
  • lib/camping-unabridged.rb

     
    511511      # Most of the time the rules inferred by dispatch method Controllers::D will get you 
    512512      # by just fine. 
    513513      def R *u 
     514        RR u 
     515      end 
     516       
     517      def RR u,p='' # :nodoc: 
    514518        r=@r 
    515519        Class.new { 
    516           meta_def(:urls){u} 
    517           meta_def(:inherited){|x|r<<x} 
     520          meta_def(:urls){u.map{|y|p+y}} 
     521          meta_def(:inherited) do |x| 
     522            r<<x 
     523            Controllers.meta_def(x.to_s.split("::").last){|*u|RR(u,x.urls.first)} 
     524          end 
    518525        } 
    519526      end 
    520527