Changeset 175
- Timestamp:
- 10/24/2006 09:32:07 (2 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 modified
-
Rakefile (modified) (3 diffs)
-
lib/camping-unabridged.rb (modified) (1 diff)
-
lib/camping.rb (modified) (1 diff)
-
test (added)
-
test/test_xhtml_trans.rb (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Rakefile
r167 r175 3 3 require 'rake/gempackagetask' 4 4 require 'rake/rdoctask' 5 require 'rake/testtask' 5 6 require 'fileutils' 6 7 include FileUtils … … 9 10 REV = File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil 10 11 VERS = ENV['VERSION'] || ("1.5" + (REV ? ".#{REV}" : "")) 11 CLEAN.include ['**/.*.sw?', '*.gem', '.config' ]12 CLEAN.include ['**/.*.sw?', '*.gem', '.config', 'test/test.log'] 12 13 RDOC_OPTS = ['--quiet', '--title', "Camping, the Documentation", 13 14 "--opname", "index.html", … … 88 89 sh %{sudo gem uninstall #{NAME}} 89 90 end 91 92 Rake::TestTask.new(:test) do |t| 93 t.test_files = FileList['test/test_*.rb'] 94 # t.warning = true 95 # t.verbose = true 96 end -
trunk/lib/camping-unabridged.rb
r172 r175 338 338 m=Mab.new({},self) 339 339 s=m.capture{send(*a,&b)} 340 s=m. layout{s} if /^_/!~a[0].to_s and m.respond_to?:layout340 s=m.capture{send(:layout){s}} if /^_/!~a[0].to_s and m.respond_to?:layout 341 341 s 342 342 end -
trunk/lib/camping.rb
r172 r175 8 8 }if o.errors.any?end end;module Base;include Helpers;attr_accessor:input, 9 9 :cookies,:env,:headers,:body,:status,:root;def method_missing*a,&b 10 a.shift if a[0]==:render;m=Mab.new({},self);s=m.capture{send(*a,&b)};s=m.layout{s}if 11 /^_/!~a[0].to_s and m.respond_to?:layout;s end;def r s,b,h={};@status=s;@headers. 12 merge!h;@body=b end;def redirect*a;r 302,'','Location'=>URL(*a)end;Z="\r\n" 10 a.shift if a[0]==:render;m=Mab.new({},self);s=m.capture{send(*a,&b)} 11 s=m.capture{send(:layout){s}} if /^_/!~a[0].to_s and m.respond_to?:layout 12 s end;def r s,b,h={};@status=s;@headers.merge!h;@body=b end 13 def redirect*a;r 302,'','Location'=>URL(*a)end;Z="\r\n" 13 14 def initialize r,e,m;e=H[e.to_hash];@status,@method,@env,@headers,@root=200,m. 14 15 downcase,e,{'Content-Type'=>"text/html"},e.SCRIPT_NAME.sub(/\/$/,'')
