[Borges-users] Re: RenderNotification considered harmful

Слепнев Владимир slepnev_v at rambler.ru
Fri Apr 30 12:22:38 EDT 2004


Oops, accidentally sent it to Eric's address instead of the ML.


How about this? Also, we should delete WeakIdentityKeyHash and 
RenderNotification.

Also, there's another problem: "setup.rb clean", "setup.rb config", 
"setup.rb setup", "setup.rb install" don't do a full reinstall, as 
they ought to. This is bad. Also, the whole process is pretty awkward; 
why not make it a single script?


? borges/config.save
Index: borges/lib/Borges.rb
===================================================================
RCS file: /var/cvs/borges/borges/lib/Borges.rb,v
retrieving revision 1.27
diff -u -9 -r1.27 Borges.rb
--- borges/lib/Borges.rb 27 Apr 2004 19:12:39 -0000 1.27
+++ borges/lib/Borges.rb 30 Apr 2004 16:46:38 -0000
@@ -15,23 +15,21 @@
  
  require 'Borges/Extensions/Array'
  require 'Borges/Extensions/Numeric'
  require 'Borges/Extensions/Object'
  require 'Borges/Extensions/Proc'
  require 'Borges/Extensions/String'
  
  require 'Borges/Utilities/ExternalID'
  require 'Borges/Utilities/LRUCache'
-require 'Borges/Utilities/RenderNotification'
  require 'Borges/Utilities/Request'
  require 'Borges/Utilities/Response'
  require 'Borges/Utilities/SimulatedRequestNotification'
-require 'Borges/Utilities/WeakIdentityKeyHash'
  require 'Borges/Utilities/StateHolder'
  require 'Borges/Utilities/StateRegistry'
  
  require 'Borges/HTML/RenderingContext'
  require 'Borges/HTML/HtmlAttributes'
  require 'Borges/HTML/HtmlElement'
  require 'Borges/HTML/HtmlBuilder'
  require 'Borges/HTML/HtmlRenderer'
  require 'Borges/HTML/PluggableSelectBox'
Index: borges/lib/Borges/Controller/Controller.rb
===================================================================
RCS file: /var/cvs/borges/borges/lib/Borges/Controller/Controller.rb,v
retrieving revision 1.17
diff -u -9 -r1.17 Controller.rb
--- borges/lib/Borges/Controller/Controller.rb 30 Apr 2004 03:09:07 
-0000 1.17
+++ borges/lib/Borges/Controller/Controller.rb 30 Apr 2004 16:46:39 
-0000
@@ -63,23 +63,23 @@
    #
    # If no controller is specified, then self is being called. If
    # self is not going to answer, then don't save a continuation.
    #
    # Otherwise, delegate to the controller passed in, then call it.
  
    def call(controller = nil)
      if controller.nil? then
        unless will_answer? then
- raise Borges::RenderNotification.new
+ throw :RenderNotification
        else
          return callcc do |cc|
            @continuation = cc
- raise Borges::RenderNotification.new
+ throw :RenderNotification
          end
        end
      else
        return delegate_to(controller) do controller.call end
      end
    end
  
    ##
    # Clear this controller's delegates, making this controller the
Index: borges/lib/Borges/Session/ControllerSession.rb
===================================================================
RCS file: 
/var/cvs/borges/borges/lib/Borges/Session/ControllerSession.rb,v
retrieving revision 1.10
diff -u -9 -r1.10 ControllerSession.rb
--- borges/lib/Borges/Session/ControllerSession.rb 27 Nov 2003 
09:13:04 -0000 1.10
+++ borges/lib/Borges/Session/ControllerSession.rb 30 Apr 2004 
16:46:39 -0000
@@ -22,40 +22,37 @@
  
    ##
    # TODO Fix so that all subclasses are available dynamically
  
    def self.entry_points
      return Borges::Controller.all_subclasses.sort_by do |a| a.name 
end
    end
  
    def render
- begin
+ catch :RenderNotification do
        bookmark_for_expiry
        redirect if always_redirect
  
        callbacks = Borges::CallbackStore.new
  
        request = nil
  
        begin
          request = respond do |url|
            response_with_url_callbacks(url, callbacks)
          end
  
        rescue Borges::SimulatedRequestNotification => e
          request = e.request
  
        end
  
        callbacks.process_request(request)
-
- rescue Borges::RenderNotification => n
- n
      end
    end
  
    def response_with_url_callbacks(url, callback_store)
      document = Borges::HtmlResponse.new
  
      rc = Borges::RenderingContext.new(document, url, callback_store)
  
      @root.render_active_controller_with(rc)
Index: borges/lib/Borges/TestCase/StateRegistryTest.rb
===================================================================
RCS file: 
/var/cvs/borges/borges/lib/Borges/TestCase/StateRegistryTest.rb,v
retrieving revision 1.10
diff -u -9 -r1.10 StateRegistryTest.rb
--- borges/lib/Borges/TestCase/StateRegistryTest.rb 12 Apr 2004 
03:13:46 -0000 1.10
+++ borges/lib/Borges/TestCase/StateRegistryTest.rb 30 Apr 2004 
16:46:39 -0000
@@ -1,14 +1,13 @@
  require 'set'
  require 'test/unit'
  
  module Borges; end
-require 'Borges/Utilities/WeakIdentityKeyHash'
  require 'Borges/Utilities/StateRegistry'
  
  class ValueHolder
    attr_accessor :contents
  
    def initialize(contents)
      @contents = contents
    end


More information about the Borges-users mailing list