Changeset 175

Show
Ignore:
Timestamp:
10/24/2006 09:32:07 (2 years ago)
Author:
zimbatm
Message:

* Rakefile : Clean the generated test.log in test/, new test task.
* lib/camping[-unabridged].rb : Fixes #102. The layout wasn't captured in Mab.
* test/test_xhtml_trans.rb : The test case for #102. You'll need mosquito to

be able to run it.

Location:
trunk
Files:
2 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/Rakefile

    r167 r175  
    33require 'rake/gempackagetask' 
    44require 'rake/rdoctask' 
     5require 'rake/testtask' 
    56require 'fileutils' 
    67include FileUtils 
     
    910REV = File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil 
    1011VERS = ENV['VERSION'] || ("1.5" + (REV ? ".#{REV}" : "")) 
    11 CLEAN.include ['**/.*.sw?', '*.gem', '.config'] 
     12CLEAN.include ['**/.*.sw?', '*.gem', '.config', 'test/test.log'] 
    1213RDOC_OPTS = ['--quiet', '--title', "Camping, the Documentation", 
    1314    "--opname", "index.html", 
     
    8889  sh %{sudo gem uninstall #{NAME}} 
    8990end 
     91 
     92Rake::TestTask.new(:test) do |t| 
     93  t.test_files = FileList['test/test_*.rb'] 
     94#  t.warning = true 
     95#  t.verbose = true 
     96end 
  • trunk/lib/camping-unabridged.rb

    r172 r175  
    338338      m=Mab.new({},self) 
    339339      s=m.capture{send(*a,&b)} 
    340       s=m.layout{s} if /^_/!~a[0].to_s and m.respond_to?:layout 
     340      s=m.capture{send(:layout){s}} if /^_/!~a[0].to_s and m.respond_to?:layout 
    341341      s 
    342342    end 
  • trunk/lib/camping.rb

    r172 r175  
    88}if o.errors.any?end end;module Base;include Helpers;attr_accessor:input, 
    99: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" 
     10a.shift if a[0]==:render;m=Mab.new({},self);s=m.capture{send(*a,&b)} 
     11s=m.capture{send(:layout){s}} if /^_/!~a[0].to_s and m.respond_to?:layout 
     12s end;def r s,b,h={};@status=s;@headers.merge!h;@body=b end 
     13def redirect*a;r 302,'','Location'=>URL(*a)end;Z="\r\n" 
    1314def initialize r,e,m;e=H[e.to_hash];@status,@method,@env,@headers,@root=200,m. 
    1415downcase,e,{'Content-Type'=>"text/html"},e.SCRIPT_NAME.sub(/\/$/,'')