Changeset 214
- Timestamp:
- 09/23/2007 17:52:25 (15 months ago)
- Location:
- trunk/lib
- Files:
-
- 3 modified
-
camping-unabridged.rb (modified) (2 diffs)
-
camping.rb (modified) (2 diffs)
-
camping/db.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/camping-unabridged.rb
r213 r214 91 91 # Camping::Apps # => [Blog, Tepee] 92 92 # 93 Apps = []94 93 C = self 95 94 S = IO.read(__FILE__).sub(/^ S = I.+$/,'') … … 613 612 # 614 613 def goes(m) 615 eval S.gsub(/Camping/,m.to_s) .gsub("A\pps = []","Cam\ping::Apps<<self"), TOPLEVEL_BINDING614 eval S.gsub(/Camping/,m.to_s), TOPLEVEL_BINDING 616 615 end 617 616 -
trunk/lib/camping.rb
r213 r214 1 1 %w[active_support markaby tempfile uri].map{|l|require l} 2 module Camping; Apps=[];C=self;S=IO.read(__FILE__).sub(/S=I.+$/,'')2 module Camping;C=self;S=IO.read(__FILE__).sub(/S=I.+$/,'') 3 3 P="Cam\ping Problem!";module Helpers;def R(c,*g);p,h=/\(.+?\)/,g.grep(Hash) 4 4 (g-=h).inject(c.urls.find{|x|x.scan(p).size==g.size}.dup){|s,a|s.sub p,C. … … 36 36 class ServerError<R();def get k,m,e;r(500,Mab.new{h1 P;h2"#{k}.#{m}";h3"#{e.class 37 37 } #{e.message}:";ul{e.backtrace.each{|bt|li(bt)}}}.to_s)end end;self;end;class<< 38 self;def goes m;eval S.gsub(/Camping/,m.to_s) .gsub("A\pps=[]","Cam\ping::Apps<<\39 s elf"),TOPLEVEL_BINDING;end;def escape s;s.to_s.gsub(/[^ \w.-]+/n){'%'+($&.38 self;def goes m;eval S.gsub(/Camping/,m.to_s),TOPLEVEL_BINDING;end;def escape s 39 s.to_s.gsub(/[^ \w.-]+/n){'%'+($&. 40 40 unpack('H2'*$&.size)*'%').upcase}.tr(' ','+')end;def un s;s.tr('+',' ').gsub( 41 41 /%([\da-f]{2})/in){[$1].pack('H*')}end;def qsp q,d='&;',y=nil,z=H[];m=proc{|_,o,n|o.u( -
trunk/lib/camping/db.rb
r155 r214 72 72 end 73 73 end 74 Camping::S.sub! "autoload:Base,'camping/db'", ""75 Camping::S.sub! "def Y;self;end", $AR_EXTRAS76 Camping::Apps.each do |app|77 app::Models.module_eval $AR_EXTRAS74 Camping::S.sub! /autoload\s*:Base\s*,\s*['"]camping\/db['"]/, "" 75 Camping::S.sub! /def\s*Y[;\s]*self[;\s]*end/, $AR_EXTRAS 76 Object.constants.map{|c|Object.const_get(c)}.each do |c| 77 c::Models.module_eval $AR_EXTRAS if c.respond_to?(:run) 78 78 end
