Skip to content

Commit

Permalink
New try: This should really fix #113
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Jun 11, 2008
1 parent 5950b54 commit 74aa21c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/camping-unabridged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def initialize(env) #:nodoc:
@request.script_name.sub(/\/$/,''),
H[@request.params], H[@request.cookies],
@response.headers, @response.status

@input.each do |k, v|
if k[-2..-1] == "[]"
@input[k[0..-3]] = @input.delete(k)
Expand Down Expand Up @@ -505,7 +505,7 @@ def R *u
#
# So, define your catch-all controllers last.
def D(p, m)
p ||= '/'
p = '/' if !p || !p[0]
r.map { |k|
k.urls.map { |x|
return (k.instance_method(m) rescue nil) ?
Expand Down
2 changes: 1 addition & 1 deletion lib/camping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def r s,b,h={};(Hash===b&&(b,h=h,b));@status=s;
r=catch(:halt){send(@request.request_method.downcase,*a)};@body||=r
self;end;end;X=module Controllers;@r=[];class<<self;def r;@r end;def R *u;r=@r
Class.new{meta_def(:urls){u};meta_def(:inherited){|x|r<<x}}end
def D p,m;p||='/'
def D p,m;p='/'if !p||!p[0]
r.map{|k|k.urls.map{|x|return(k.instance_method(m)rescue nil)?
[k,m,*$~[1..-1]]:[I,'r501',m]if p=~/^#{x}\/?$/}};[I,'r404',p]
end;def M;def M;end;constants.map{|c|k=const_get(c)
Expand Down

0 comments on commit 74aa21c

Please sign in to comment.