Changeset 122

Show
Ignore:
Timestamp:
01/18/2007 18:03:11 (22 months ago)
Author:
why
Message:
  • tippytippytepee/tepee.rb: Web.get will read local wiki pages as well. Web.get("HomePage?"), for instance.
Files:
1 modified

Legend:

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

    r121 r122  
    88module Web 
    99  def self.get(url) 
    10     data = URI.parse(url).read 
     10    uri = URI.parse(url) 
     11    data = nil 
     12    case uri 
     13    when URI::HTTP 
     14      data = uri.read 
     15    when URI::Generic 
     16      page = Tepee.get(:Show, url) 
     17      def page.meta; @env end 
     18      def page.base_uri; end 
     19      data = page.body.to_s 
     20      OpenURI::Meta.init(data, page) 
     21    end 
    1122    case data.content_type 
    1223    when "application/x-javascript", "application/x-json", "application/json" 
     
    1425      OpenURI::Meta.init(obj, data) 
    1526      obj 
     27    else 
     28      data 
    1629    end 
    1730  end