Changeset 131

Show
Ignore:
Timestamp:
01/24/2007 16:09:40 (22 months ago)
Author:
lwu
Message:

Import a few more helper modules into the tippy sandbox example

Location:
trunk/examples/tippytippytepee
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/tippytippytepee/tepee.rb

    r129 r131  
    22require 'sandbox' 
    33$:.unshift File.dirname(__FILE__) + "/../../lib" 
    4 %w(open-uri rubygems json redcloth camping camping/session acts_as_versioned hpricot cgi).each { |lib| require lib } 
     4%w(open-uri rubygems camping camping/session acts_as_versioned 
     5   json redcloth hpricot cgi pp yaml ostruct).each { |lib| require lib } 
    56 
    67Camping.goes :Tepee 
     
    6566Tepee::Box.ref Tepee::Models::Page 
    6667Tepee::Box.ref Web 
    67 Tepee::Box.import Time 
    6868Tepee::Box.import URI::HTTP 
    6969Tepee::Box.import OpenURI::Meta 
    70 Tepee::Box.import Hpricot 
    71 Tepee::Box.import HashWithIndifferentAccess 
     70%w(CGI Time Hpricot HashWithIndifferentAccess 
     71   PP JSON YAML OpenStruct Sandbox).each { |klass| Tepee::Box.import Kernel.const_get(klass) } 
     72Tepee::Box.load "webdev.rb" 
    7273 
    7374module Tepee::Controllers 
     
    172173  def _show_error(box) 
    173174    if @boxx 
    174       line_no = (@boxx.to_s.scan(/(\d+)/).flatten[1] || "1").to_i - @line_zero - 1 
     175      line_no = (@boxx.to_s.scan(/(\d+)/).flatten[1] || "1").to_i - @line_zero + 1 
    175176      b { div.error! @boxx } #.to_s.gsub(/.eval.:\d+:/, '') 
    176177      pre.plain do