Skip to content

Commit

Permalink
Export more ivars in Base
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Nov 30, 2009
1 parent 982d0e7 commit 7785812
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/camping-unabridged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ def URL c='/',*a
#
# Everything in this module is accessable inside your controllers.
module Base
attr_accessor :input, :cookies, :headers, :body, :status, :root
attr_accessor :env, :request, :root, :input, :cookies, :state,
:status, :headers, :body

# Display a view, calling it by its method name +v+. If a <tt>layout</tt>
# method is found in Camping::Views, it will be used to wrap the HTML.
Expand Down
4 changes: 2 additions & 2 deletions lib/camping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def method_missing m,*a;m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m.to_s]:super end
h.any?? u+"?"+U.build_query(h[0]):u end;def / p
p[0]==?/?@root+p:p end;def URL c='/',*a;c=R(c, *a) if c.respond_to?:urls
c=self/c;c=@request.url[/.{8,}?(?=\/)/]+c if c[0]==?/;URI c end
end;module Base;attr_accessor:input,:cookies,:headers,:body,:status,:root
def render v,*a,&b;mab(/^_/!~v.to_s){send(v,*a,&b)} end
end;module Base;attr_accessor:env,:request,:root,:input,:cookies,:state,
:status, :headers, :body;def render v,*a,&b;mab(/^_/!~v.to_s){send(v,*a,&b)} end
def mab l=nil,&b;m=Mab.new({},self);s=m.capture(&b)
s=m.capture{layout{s}} if l && m.respond_to?(:layout);s end
def r s,b,h={};b,h=h,b if Hash===b;@status=s;
Expand Down

0 comments on commit 7785812

Please sign in to comment.