Skip to content

Commit

Permalink
Camping#method_missing should work now
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed May 21, 2008
1 parent 7b0c6f7 commit 3065665
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/camping-unabridged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,10 @@ def call(env)
#
def method_missing(m, c, *a)
X.M
k = X.const_get(c).new(StringIO.new,
H['HTTP_HOST','','SCRIPT_NAME','','HTTP_COOKIE',''],m.to_s)
H[a.pop].each { |e,f| k.send("#{e}=",f) } if Hash === a[-1]
h=Hash===a[-1]?H[a.pop]:{}
e=H[h[:env]||{}].u({'rack.input'=>StringIO.new,'REQUEST_METHOD'=>m.to_s})
k = X.const_get(c).new(H[e])
k.send("input=",h[:input]) if h[:input]
k.service(*a)
end
end
Expand Down

0 comments on commit 3065665

Please sign in to comment.