diff --git a/Rakefile b/Rakefile index 2861ecd..45328d0 100644 --- a/Rakefile +++ b/Rakefile @@ -16,6 +16,13 @@ task :test do sh 'mspec -I./lib -f s test/component_spec.rb' end +task :install do +unless File.read('lib/wee.rb') =~ /Version\s+=\s+"(\d+\.\d+\.\d+)"/ + raise "no version" +end + sh "sudo gem install wee-#{$1}.gem" +end + task :package do sh 'gem build wee.gemspec' end @@ -23,3 +30,4 @@ end task :clean => [:clobber_rdoc] task :default => [:test, :rdoc, :clean] + diff --git a/doc/rdoc/classes/Array.html b/doc/rdoc/classes/Array.html deleted file mode 100644 index a853436..0000000 --- a/doc/rdoc/classes/Array.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - Class: Array - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassArray
In: - - lib/wee/state.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- - -
- - - -
-

Included Modules

- -
- Wee::DupReplaceSnapshotMixin -
-
- -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Hash.html b/doc/rdoc/classes/Hash.html deleted file mode 100644 index 5b9f439..0000000 --- a/doc/rdoc/classes/Hash.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - Class: Hash - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassHash
In: - - lib/wee/state.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- - -
- - - -
-

Included Modules

- -
- Wee::DupReplaceSnapshotMixin -
-
- -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Object.html b/doc/rdoc/classes/Object.html deleted file mode 100644 index 118b181..0000000 --- a/doc/rdoc/classes/Object.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - Class: Object - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassObject
In: - - lib/wee/state.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-Extend base classes with snapshot functionality -

- -
- - -
- - -
- - - -
-

Included Modules

- -
- Wee::ObjectSnapshotMixin -
-
- -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/String.html b/doc/rdoc/classes/String.html deleted file mode 100644 index 25e62c3..0000000 --- a/doc/rdoc/classes/String.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - Class: String - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassString
In: - - lib/wee/state.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- - -
- - - -
-

Included Modules

- -
- Wee::DupReplaceSnapshotMixin -
-
- -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Struct.html b/doc/rdoc/classes/Struct.html deleted file mode 100644 index a884d98..0000000 --- a/doc/rdoc/classes/Struct.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - Class: Struct - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassStruct
In: - - lib/wee/state.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- - -
- - - -
-

Included Modules

- -
- Wee::StructSnapshotMixin -
-
- -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee.html b/doc/rdoc/classes/Wee.html deleted file mode 100644 index cca3c49..0000000 --- a/doc/rdoc/classes/Wee.html +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - Module: Wee - - - - - - - - - - -
- - - - - - - - - - -
ModuleWee
In: - - lib/wee.rb - -
- - lib/wee/task.rb - -
- - lib/wee/request.rb - -
- - lib/wee/call_answer.rb - -
- - lib/wee/presenter.rb - -
- - lib/wee/session.rb - -
- - lib/wee/application.rb - -
- - lib/wee/conversation.rb - -
- - lib/wee/jquery/jquery.rb - -
- - lib/wee/id_generator.rb - -
- - lib/wee/html_brushes.rb - -
- - lib/wee/html_canvas.rb - -
- - lib/wee/state.rb - -
- - lib/wee/callback.rb - -
- - lib/wee/html_writer.rb - -
- - lib/wee/component.rb - -
- - lib/wee/response.rb - -
- - lib/wee/html_document.rb - -
- - lib/wee/lru_cache.rb - -
- - lib/wee/renderer.rb - -
- - lib/wee/decoration.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- run   - runcc   -
-
- -
- - - - -
- -
-

Classes and Modules

- - Module Wee::CallAnswerMixin
-Module Wee::CallbackMixin
-Module Wee::DecorationMixin
-Module Wee::DupReplaceSnapshotMixin
-Module Wee::ObjectSnapshotMixin
-Module Wee::StructSnapshotMixin
-Class Wee::AnswerDecoration
-Class Wee::Application
-Class Wee::BlockComponent
-Class Wee::Brush
-Class Wee::CallbackRegistry
-Class Wee::Callbacks
-Class Wee::Component
-Class Wee::Decoration
-Class Wee::Delegate
-Class Wee::ErrorResponse
-Class Wee::FormDecoration
-Class Wee::GenericResponse
-Class Wee::HtmlCanvas
-Class Wee::HtmlDocument
-Class Wee::HtmlWriter
-Class Wee::IdGenerator
-Class Wee::JQuery
-Class Wee::LRUCache
-Class Wee::OidDecoration
-Class Wee::PageDecoration
-Class Wee::Presenter
-Class Wee::RedirectResponse
-Class Wee::RefreshResponse
-Class Wee::Renderer
-Class Wee::Request
-Class Wee::Response
-Class Wee::Session
-Class Wee::State
-Class Wee::Task
-Class Wee::WrapperDecoration
- -
- -
-

Constants

- -
- - - - - - -
Version="2.1.0"
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee.rb, line 33
-def Wee.run(component_class=nil, mount_path='/', port=2000, public_local_path=nil, &block)
-  raise ArgumentError if component_class and block
-
-  require 'rack/handler/webrick'
-  app = Rack::Builder.app do
-    map mount_path do
-      if block
-        a = Wee::Application.new(&block)
-      else
-        a = Wee::Application.new { Wee::Session.new(component_class.instanciate) }
-      end
-      if public_local_path
-        run Rack::Cascade.new([Rack::File.new(public_local_path), a])
-      else
-        run a
-      end
-    end
-  end
-  Rack::Handler::WEBrick.run(app, :Port => port)
-end
-
-
-
-
- -
- - - - -
-

-Like Wee.run, but for use with -continuations. -

-

[Source]

-
-
-# File lib/wee.rb, line 57
-def Wee.runcc(component_class, *args)
-  Wee.run(nil, *args) {
-    Wee::Session.new(component_class.instanciate, Wee::Session::ThreadSerializer.new)
-  }
-end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/AnswerDecoration.html b/doc/rdoc/classes/Wee/AnswerDecoration.html deleted file mode 100644 index c0c1756..0000000 --- a/doc/rdoc/classes/Wee/AnswerDecoration.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - Class: Wee::AnswerDecoration - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::AnswerDecoration
In: - - lib/wee/call_answer.rb - -
-
Parent: - - Decoration - -
-
- - -
- - - -
- -
-

-A Wee::AnswerDecoration is wrapped -around a component that will call Component#answer. This makes it possible -to use such components without the need to call them (Component#call), e.g. -as child components of other components. -

- -
- - -
- -
-

Methods

- -
- new   - process_callbacks   -
-
- -
- - - - -
- -
-

Classes and Modules

- - Class Wee::AnswerDecoration::Answer
-Class Wee::AnswerDecoration::Interceptor
- -
- - - - -
-

Attributes

- -
- - - - - - -
answer_callback [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/call_answer.rb, line 21
-    def initialize(&answer_callback)
-      super()
-      @answer_callback = answer_callback
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-When a component answers, @answer_callback.call(answer) will be -executed, where answer is of class Answer which includes the arguments -passed to Component#answer. -

-

[Source]

-
-
-# File lib/wee/call_answer.rb, line 46
-    def process_callbacks(callbacks)
-      if action_callback = super
-        Interceptor.new(action_callback, @answer_callback)
-      else
-        nil
-      end
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/AnswerDecoration/Answer.html b/doc/rdoc/classes/Wee/AnswerDecoration/Answer.html deleted file mode 100644 index 2dd7fcb..0000000 --- a/doc/rdoc/classes/Wee/AnswerDecoration/Answer.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - Class: Wee::AnswerDecoration::Answer - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::AnswerDecoration::Answer
In: - - lib/wee/call_answer.rb - -
-
Parent: - Exception -
-
- - -
- - - -
- -
-

-Used to unwind the component call chain in Component#answer. -

- -
- - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - -
args [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/call_answer.rb, line 16
-      def initialize(args) @args = args end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/AnswerDecoration/Interceptor.html b/doc/rdoc/classes/Wee/AnswerDecoration/Interceptor.html deleted file mode 100644 index 8db48d1..0000000 --- a/doc/rdoc/classes/Wee/AnswerDecoration/Interceptor.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - Class: Wee::AnswerDecoration::Interceptor - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::AnswerDecoration::Interceptor
In: - - lib/wee/call_answer.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- call   - new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
action_callback [RW] 
answer_callback [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/call_answer.rb, line 29
-      def initialize(action_callback, answer_callback)
-        @action_callback, @answer_callback = action_callback, answer_callback
-      end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/call_answer.rb, line 33
-      def call
-        @action_callback.call
-      rescue Answer => answer
-        # return to the calling component 
-        @answer_callback.call(answer)
-      end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Application.html b/doc/rdoc/classes/Wee/Application.html deleted file mode 100644 index 758e16f..0000000 --- a/doc/rdoc/classes/Wee/Application.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - - Class: Wee::Application - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Application
In: - - lib/wee/application.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-A Wee::Application manages all Session‘s of a single application. It -dispatches the request to the correct handler by examining the request. -

- -
- - -
- -
-

Methods

- -
- call   - cleanup_sessions   - for   - insert_session   - new   - new_session   -
-
- -
- - - - -
- -
-

Classes and Modules

- - Class Wee::Application::SessionCache
- -
- - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/application.rb, line 13
-    def self.for(component_class, session_class=Wee::Session, *component_args)
-      new { session_class.new(component_class.new(*component_args)) }
-    end
-
-
-
-
- -
- - - - -
-

-Creates a new application. The -block, when called, must return a new Session -instance. -

-
-  Wee::Application.new { Wee::Session.new(root_component) }
-
-

[Source]

-
-
-# File lib/wee/application.rb, line 29
-    def initialize(max_sessions=10_000, &block)
-      @session_factory = block || raise(ArgumentError)
-      @session_ids ||= Wee::IdGenerator::Secure.new
-      @sessions = SessionCache.new(max_sessions)
-      @mutex = Mutex.new
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Handles a web request -

-

[Source]

-
-
-# File lib/wee/application.rb, line 46
-    def call(env)
-      request = Wee::Request.new(env)
-
-      if request.session_id
-        session = @mutex.synchronize { @sessions[request.session_id] }
-        if session and session.alive?
-          session.call(env)
-        else
-          url = request.build_url(:session_id => nil, :page_id => nil)
-          Wee::RefreshResponse.new("Invalid or expired session", url).finish
-        end
-      else
-        session = new_session()
-        url = request.build_url(:session_id => session.id, :page_id => nil)
-        Wee::RedirectResponse.new(url).finish
-      end
-    end
-
-
-
-
- -
- - - - -
-

-Garbage collect dead sessions -

-

[Source]

-
-
-# File lib/wee/application.rb, line 39
-    def cleanup_sessions
-      @mutex.synchronize { @sessions.garbage_collect }
-    end
-
-
-
-
- -

Protected Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/application.rb, line 73
-    def insert_session(session, retries=3)
-      retries.times do
-        @mutex.synchronize {
-          id = @session_ids.next
-          if @sessions[id].nil?
-            @sessions[id] = session 
-            session.id = id
-            return
-          end
-        }
-      end
-      raise
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/application.rb, line 66
-    def new_session
-      session = @session_factory.call
-      session.application = self
-      insert_session(session)
-      return session
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Application/SessionCache.html b/doc/rdoc/classes/Wee/Application/SessionCache.html deleted file mode 100644 index 7f6a202..0000000 --- a/doc/rdoc/classes/Wee/Application/SessionCache.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - Class: Wee::Application::SessionCache - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Application::SessionCache
In: - - lib/wee/application.rb - -
-
Parent: - - Wee::LRUCache - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- garbage_collect   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/application.rb, line 18
-      def garbage_collect
-        delete_if {|id, session| session.dead? }
-      end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/BlockComponent.html b/doc/rdoc/classes/Wee/BlockComponent.html deleted file mode 100644 index 71da319..0000000 --- a/doc/rdoc/classes/Wee/BlockComponent.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - Class: Wee::BlockComponent - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::BlockComponent
In: - - lib/wee/conversation.rb - -
-
Parent: - - Component - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   - render   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/conversation.rb, line 6
-    def initialize(&block)
-      @block = block
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/conversation.rb, line 10
-    def render(r)
-      instance_exec(r, &@block)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush.html b/doc/rdoc/classes/Wee/Brush.html deleted file mode 100644 index d583114..0000000 --- a/doc/rdoc/classes/Wee/Brush.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - Class: Wee::Brush - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush
In: - - lib/wee/html_brushes.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- close   - nesting?   - setup   - with   -
-
- -
- - - - -
- -
-

Classes and Modules

- - Class Wee::Brush::ActionInputTag
-Class Wee::Brush::AnchorTag
-Class Wee::Brush::CheckboxTag
-Class Wee::Brush::FileUploadTag
-Class Wee::Brush::FormTag
-Class Wee::Brush::GenericEncodedTextBrush
-Class Wee::Brush::GenericSingleTagBrush
-Class Wee::Brush::GenericTagBrush
-Class Wee::Brush::GenericTextBrush
-Class Wee::Brush::HiddenInputTag
-Class Wee::Brush::ImageButtonTag
-Class Wee::Brush::ImageTag
-Class Wee::Brush::InputTag
-Class Wee::Brush::JavascriptTag
-Class Wee::Brush::LinkTag
-Class Wee::Brush::Page
-Class Wee::Brush::PasswordInputTag
-Class Wee::Brush::RadioButtonTag
-Class Wee::Brush::RadioGroup
-Class Wee::Brush::SelectListTag
-Class Wee::Brush::SelectOptionTag
-Class Wee::Brush::SubmitButtonTag
-Class Wee::Brush::TableDataTag
-Class Wee::Brush::TableHeaderTag
-Class Wee::Brush::TableRowTag
-Class Wee::Brush::TableTag
-Class Wee::Brush::TextAreaTag
-Class Wee::Brush::TextInputTag
- -
- - - - -
-

Attributes

- -
- - - - - - - - - - - -
canvas [RW] 
document [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 29
-    def self.nesting?() true end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 25
-    def close
-      with if @document
-    end
-
-
-
-
- -
- - - - -
-

-This method is called right after initialize. It‘s only here to -simplify the implementation of Brushes, mainly to avoid passing all those -arguments to super. -

-

-There is a bit of redundancy with canvas -and document here. It‘s there to avoid method calls. -

-

-A brush is considered to be closed, when @document is nil. -

-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 15
-    def setup(canvas, document)
-      @canvas = canvas
-      @document = document
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 20
-    def with(*args, &block)
-      @canvas.nest(&block) if block
-      @document = @canvas = nil
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/ActionInputTag.html b/doc/rdoc/classes/Wee/Brush/ActionInputTag.html deleted file mode 100644 index e6685f9..0000000 --- a/doc/rdoc/classes/Wee/Brush/ActionInputTag.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - Class: Wee::Brush::ActionInputTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::ActionInputTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::InputTag -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- __callback   -
-
- -
- - - -
-

Included Modules

- -
- CallbackMixin -
-
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 471
-    def __callback; name(@canvas.register_callback(:action, @callback)) end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/AnchorTag.html b/doc/rdoc/classes/Wee/Brush/AnchorTag.html deleted file mode 100644 index bd30096..0000000 --- a/doc/rdoc/classes/Wee/Brush/AnchorTag.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - Class: Wee::Brush::AnchorTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::AnchorTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- __callback   - info   - new   -
-
- -
- - - -
-

Included Modules

- -
- CallbackMixin -
-
- -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='a'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - -
aliases [HtmlAttribute] 
aliases [HtmlAttribute] 
href [HtmlAttribute] 
title [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 708
-    def initialize
-      super(HTML_TAG)
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 719
-    def __callback
-      url(@canvas.url_for_callback(@callback, :action, @info ? {:info => @info} : {}))
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 712
-    def info(info=nil)
-      @info = info
-      self
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/CheckboxTag.html b/doc/rdoc/classes/Wee/Brush/CheckboxTag.html deleted file mode 100644 index 766cd97..0000000 --- a/doc/rdoc/classes/Wee/Brush/CheckboxTag.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - Class: Wee::Brush::CheckboxTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::CheckboxTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::InputTag -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- __callback   - new   - with   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TYPE='checkbox'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 434
-    def initialize
-      super(HTML_TYPE)
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 438
-    def __callback; end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 440
-    def with
-      if @callback
-        n = @canvas.register_callback(:input, proc {|input|
-          @callback.call(input.send(input.kind_of?(Array) ? :include? : :==, '1'))
-        })
-        @document.single_tag('input', :type => 'hidden', :name => n, :value => '0')
-        name(n)
-        value('1')
-      end
-      super
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/FileUploadTag.html b/doc/rdoc/classes/Wee/Brush/FileUploadTag.html deleted file mode 100644 index fb90a3d..0000000 --- a/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - Class: Wee::Brush::FileUploadTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::FileUploadTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::InputTag -
-
- - -
- - - -
- -
-

-Use a <form> tag with enctype_multipart! -

- -
- - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TYPE='file'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 459
-    def initialize
-      super(HTML_TYPE)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/FormTag.html b/doc/rdoc/classes/Wee/Brush/FormTag.html deleted file mode 100644 index c5fbf1d..0000000 --- a/doc/rdoc/classes/Wee/Brush/FormTag.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - Class: Wee::Brush::FormTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::FormTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- __callback   - enctype_multipart   - new   - with   -
-
- -
- - - -
-

Included Modules

- -
- CallbackMixin -
-
- -
- - -
-

Constants

- -
- - - - - - - - - - - -
HTML_TAG='form'.freeze
HTML_METHOD_POST='POST'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - -
action [HtmlAttribute] 
enctype [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 354
-    def initialize
-      super(HTML_TAG)
-      @attributes[:method] = HTML_METHOD_POST
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 369
-    def __callback; action(@canvas.url_for_callback(@callback)) end
-
-
-
-
- -
- - - - -
-

-Use this enctype when you have a FileUploadTag field. -

-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 350
-    def enctype_multipart
-      enctype('multipart/form-data')
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 359
-    def with(&block)
-      # If no action was specified, use a dummy one.
-      unless @attributes.has_key?(:action)
-        @attributes[:action] = @canvas.build_url
-      end
-      super
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html b/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html deleted file mode 100644 index e57fa97..0000000 --- a/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - Class: Wee::Brush::GenericEncodedTextBrush - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::GenericEncodedTextBrush
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTextBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- with   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 42
-    def with(text)
-      @document.encode_text(text)
-      @document = @canvas = nil
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html b/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html deleted file mode 100644 index d0402ad..0000000 --- a/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - Class: Wee::Brush::GenericSingleTagBrush - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::GenericSingleTagBrush
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- nesting?   - with   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 184
-    def self.nesting?() false end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 179
-    def with
-      @document.single_tag(@tag, @attributes) 
-      @document = @canvas = nil
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html b/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html deleted file mode 100644 index f71ad0b..0000000 --- a/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +++ /dev/null @@ -1,539 +0,0 @@ - - - - - - Class: Wee::Brush::GenericTagBrush - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::GenericTagBrush
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush -
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - -
-

Constants

- -
- - - - - - - - -
EVENTS={:click => 'onclick'.freeze, :dblclick => 'ondblclick'.freeze, :mouseover => 'onmouseover'.freeze, :mouseout => 'onmouseout'.freeze}.freeze  -generic support for onXXX events - -
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
css_class [HtmlAttribute] 
css_style [HtmlAttribute] 
html_name [HtmlAttribute] 
html_name [HtmlAttribute] 
id [HtmlAttribute] 
name [HtmlAttribute] 
onclick [HtmlAttribute] 
ondblclick [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 49
-    def self.html_attr(attr, hash={})
-      name = hash[:html_name] || attr
-      if hash[:type] == :bool
-        class_eval %{
-          def #{ attr }(bool=true)
-            if bool
-              @attributes[:"#{ name }"] = nil
-            else
-              @attributes.delete(:"#{ name }")
-            end
-            self
-          end
-        }
-      else
-        class_eval %{ 
-          def #{ attr }(value)
-            if value == nil
-              @attributes.delete(:"#{ name }")
-            else
-              @attributes[:"#{ name }"] = value
-            end
-            self
-          end
-        }
-      end
-
-      (hash[:aliases] || []).each do |a|
-        class_eval "alias #{ a } #{ attr }"
-      end
-
-      (hash[:shortcuts] || {}).each_pair do |k, v|
-        class_eval "def #{ k }() #{ attr }(#{ v.inspect }) end"
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 93
-    def initialize(tag)
-      super()
-      @tag = tag
-      @attributes = Hash.new
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 129
-    def callback_on(event, &block)
-      raise ArgumentError unless block
-      url = @canvas.url_for_callback(block)
-      javascript_on(event, "document.location.href='#{ url }'")
-      self
-    end
-
-
-
-
- -
- - - - -
-

-Returns a unique DOM id for the underlying component -

-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 109
-    def get_oid
-      "wee_#{@canvas.current_component.object_id}"
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 122
-    def javascript_on(event, javascript)
-      ev = EVENTS[event] 
-      raise ArgumentError unless ev
-      @attributes[ev] = "javascript: #{javascript};"
-      self
-    end
-
-
-
-
- -
- - - - -
-

-Assigns a unique DOM id -

-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 102
-    def oid
-      id(get_oid())
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 160
-    def onclick_callback(&block)
-      callback_on(:click, &block)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 156
-    def onclick_javascript(v)
-      javascript_on(:click, v)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 164
-    def ondblclick_callback(&block)
-      callback_on(:dblclick, &block)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 143
-    def update_component_on(event, component=nil, &callback_block)
-      component ||= @canvas.current_component
-
-      render_block = proc {|r|
-        callback_block.call if callback_block
-        r.render(component)
-      }
-
-      url = @canvas.url_for_callback(@canvas.session.render_ajax_proc(render_block, component))
-      javascript_on(event, "wee.update('#{ url }')")
-      self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 136
-    def update_on(event, &render_block)
-      raise ArgumentError unless render_block
-      url = @canvas.url_for_callback(@canvas.session.render_ajax_proc(render_block, @canvas.current_component))
-      javascript_on(event, "wee.update('#{ url }')")
-      self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 168
-    def with(text=nil, &block)
-      @document.start_tag(@tag, @attributes)
-      @document.text(text) if text
-      @canvas.nest(&block) if block
-      @document.end_tag(@tag)
-      @document = @canvas = nil
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html b/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html deleted file mode 100644 index dc72da4..0000000 --- a/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - Class: Wee::Brush::GenericTextBrush - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::GenericTextBrush
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- nesting?   - with   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 38
-    def self.nesting?() false end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 33
-    def with(text)
-      @document.text(text)
-      @document = @canvas = nil
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html b/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html deleted file mode 100644 index fac8b25..0000000 --- a/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - Class: Wee::Brush::HiddenInputTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::HiddenInputTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::InputTag -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TYPE='hidden'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 418
-    def initialize
-      super(HTML_TYPE)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html b/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html deleted file mode 100644 index c1a0897..0000000 --- a/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - Class: Wee::Brush::ImageButtonTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::ImageButtonTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::ActionInputTag -
-
- - -
- - - -
- -
-

-NOTE: The form-fields returned by a image-button-tag is browser-specific. -Most browsers do not send the "name" key together with the value -specified by "value", only "name.x" and -"name.y". This conforms to the standard. But Firefox also sends -"name"="value". This is why I raise an exception from -the value method. Note that it‘s neccessary to parse the passed -form-fields and generate a "name" fields in the request, to make -this image-button work. -

- -
- - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TYPE='image'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 494
-    def initialize
-      super(HTML_TYPE)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/ImageTag.html b/doc/rdoc/classes/Wee/Brush/ImageTag.html deleted file mode 100644 index 7dd5d76..0000000 --- a/doc/rdoc/classes/Wee/Brush/ImageTag.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - Class: Wee::Brush::ImageTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::ImageTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericSingleTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='img'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
alt [HtmlAttribute] 
border [HtmlAttribute] 
height [HtmlAttribute] 
src [HtmlAttribute] 
width [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 196
-    def initialize
-      super(HTML_TAG)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/InputTag.html b/doc/rdoc/classes/Wee/Brush/InputTag.html deleted file mode 100644 index 5608429..0000000 --- a/doc/rdoc/classes/Wee/Brush/InputTag.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - Class: Wee::Brush::InputTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::InputTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericSingleTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- __callback   - new   -
-
- -
- - - -
-

Included Modules

- -
- CallbackMixin -
-
- -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='input'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
checked [HtmlAttribute] 
disabled [HtmlAttribute] 
maxlength [HtmlAttribute] 
name [HtmlAttribute] 
readonly [HtmlAttribute] 
size [HtmlAttribute] 
src [HtmlAttribute] 
type [HtmlAttribute] 
type [HtmlAttribute] 
type [HtmlAttribute] 
type [HtmlAttribute] 
value [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 397
-    def initialize(_type)
-      super(HTML_TAG)
-      type(_type)
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 404
-    def __callback; name(@canvas.register_callback(:input, @callback)) end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/JavascriptTag.html b/doc/rdoc/classes/Wee/Brush/JavascriptTag.html deleted file mode 100644 index 17c593c..0000000 --- a/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - Class: Wee::Brush::JavascriptTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::JavascriptTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - - - - - - -
HTML_TAG='script'.freeze
HTML_TYPE='text/javascript'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - -
src [HtmlAttribute] 
type [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 208
-    def initialize
-      super(HTML_TAG)
-      type(HTML_TYPE)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/LinkTag.html b/doc/rdoc/classes/Wee/Brush/LinkTag.html deleted file mode 100644 index fbebe1c..0000000 --- a/doc/rdoc/classes/Wee/Brush/LinkTag.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - Class: Wee::Brush::LinkTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::LinkTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='link'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - -
aliases [HtmlAttribute] 
href [HtmlAttribute] 
rel [HtmlAttribute] 
type [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 697
-    def initialize
-      super(HTML_TAG)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/Page.html b/doc/rdoc/classes/Wee/Brush/Page.html deleted file mode 100644 index b07579a..0000000 --- a/doc/rdoc/classes/Wee/Brush/Page.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - Class: Wee::Brush::Page - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::Page
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- head   - title   - with   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - - - - - - - - - - - - - - - - -
HTML_HTML='html'.freeze
HTML_HEAD='head'.freeze
HTML_TITLE='title'.freeze
HTML_BODY='body'.freeze
-
-
- - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 765
-    def head(&block)
-      raise ArgumentError unless block
-      @head = block
-      self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 760
-    def title(t)
-      @title = t
-      self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 730
-    def with(text=nil, &block)
-      @document.start_tag(HTML_HTML)
-      @document.start_tag(HTML_HEAD)
-
-      if @title
-        @document.start_tag(HTML_TITLE)
-        @document.text(@title)
-        @document.end_tag(HTML_TITLE)
-      end
-
-      if @head
-        @canvas.nest(&@head)
-      end
-
-      @document.end_tag(HTML_HEAD)
-      @document.start_tag(HTML_BODY)
-
-      if text
-        raise ArgumentError if block
-        @document.text(text)
-      else
-        @canvas.nest(&block) if block 
-      end
-
-      @document.end_tag(HTML_BODY)
-      @document.end_tag(HTML_HTML)
-
-      @document = @canvas = nil
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/PasswordInputTag.html b/doc/rdoc/classes/Wee/Brush/PasswordInputTag.html deleted file mode 100644 index 8b7405b..0000000 --- a/doc/rdoc/classes/Wee/Brush/PasswordInputTag.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - Class: Wee::Brush::PasswordInputTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::PasswordInputTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::InputTag -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TYPE='password'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 426
-    def initialize
-      super(HTML_TYPE)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html b/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html deleted file mode 100644 index 46777b0..0000000 --- a/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - Class: Wee::Brush::RadioButtonTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::RadioButtonTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::InputTag -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- __callback   - group   - new   - with   -
-
- -
- - - -
-

Included Modules

- -
- CallbackMixin -
-
- -
- - -
-

Constants

- -
- - - - - - -
HTML_TYPE='radio'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 663
-    def initialize
-      super(HTML_TYPE)
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 674
-    def __callback; end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 667
-    def group(radio_group)
-      @group = radio_group
-      self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 676
-    def with
-      if @group
-        n, v = @group.add_callback(@callback)
-        name(n)
-        value(v)
-      end
-      super
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/RadioGroup.html b/doc/rdoc/classes/Wee/Brush/RadioGroup.html deleted file mode 100644 index a8df913..0000000 --- a/doc/rdoc/classes/Wee/Brush/RadioGroup.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - Class: Wee::Brush::RadioGroup - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::RadioGroup
In: - - lib/wee/html_brushes.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- add_callback   - call   - new   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 638
-    def initialize(canvas)
-      @name = canvas.register_callback(:input, self)
-      @callbacks = {}
-      @ids = Wee::IdGenerator::Sequential.new 
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 644
-    def add_callback(callback)
-      value = @ids.next.to_s
-      @callbacks[value] = callback
-      return [@name, value]
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 650
-    def call(value)
-      if @callbacks.has_key?(value)
-        cb = @callbacks[value]
-        cb.call(value) if cb
-      else
-        raise "invalid radio button/group value"
-      end
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/SelectListTag.html b/doc/rdoc/classes/Wee/Brush/SelectListTag.html deleted file mode 100644 index 2850155..0000000 --- a/doc/rdoc/classes/Wee/Brush/SelectListTag.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - Class: Wee::Brush::SelectListTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::SelectListTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- __callback   - handler   - items   - labels   - new   - selected   - with   -
-
- -
- - - -
-

Included Modules

- -
- CallbackMixin -
-
- -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='select'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
disabled [HtmlAttribute] 
multiple [HtmlAttribute] 
readonly [HtmlAttribute] 
size [HtmlAttribute] 
type [HtmlAttribute] 
type [HtmlAttribute] 
type [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 550
-    def initialize(items)
-      super(HTML_TAG)
-      @items = items
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 578
-    def __callback
-      #
-      # A callback was specified. We have to wrap it inside another
-      # callback, as we want to perform some additional actions.
-      #
-      name(@canvas.register_callback(:input, method(:handler)) + "[]") 
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 555
-    def items(items)
-      @items = items
-      self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 566
-    def labels(arg=nil, &block)
-      raise ArgumentError if arg and block
-      if block
-        @labels = proc {|i| block.call(@items[i])}
-      else
-        @labels = arg
-      end
-      self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 560
-    def selected(arg=nil, &block)
-      raise ArgumentError if arg and block
-      @selected = block || arg
-      self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 604
-    def with
-      @labels ||= @items.collect {|i| i.to_s}
-
-      if @attributes.has_key?(:multiple)
-        @selected ||= Array.new
-        meth = @selected.kind_of?(Proc) ? (:call) : (:include?)
-      else
-        meth = @selected.kind_of?(Proc) ? (:call) : (:==)
-      end
-
-      super {
-        @items.each_index do |i|
-          @canvas.option.value(i).selected(@selected.send(meth, @items[i])).with(@labels[i])
-        end 
-      }
-    end
-
-
-
-
- -

Protected Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 586
-    def handler(input)
-      choosen = input.map {|idx|
-        idx = Integer(idx)
-        raise IndexError if idx < 0 or idx > @items.size
-        @items[idx]
-      }
-
-      if @attributes.has_key?(:multiple)
-        @callback.call(choosen)
-      elsif choosen.size > 1
-        raise "more than one element was choosen from a not-multiple SelectListTag" 
-      else
-        @callback.call(choosen.first)
-      end
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html b/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html deleted file mode 100644 index 5efec0d..0000000 --- a/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - Class: Wee::Brush::SelectOptionTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::SelectOptionTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='option'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
selected [HtmlAttribute] 
type [HtmlAttribute] 
value [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 628
-    def initialize
-      super(HTML_TAG)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html b/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html deleted file mode 100644 index 7ded4ef..0000000 --- a/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - Class: Wee::Brush::SubmitButtonTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::SubmitButtonTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::ActionInputTag -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TYPE='submit'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 477
-    def initialize
-      super(HTML_TYPE)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/TableDataTag.html b/doc/rdoc/classes/Wee/Brush/TableDataTag.html deleted file mode 100644 index d6ed62f..0000000 --- a/doc/rdoc/classes/Wee/Brush/TableDataTag.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - Class: Wee::Brush::TableDataTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::TableDataTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='td'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
align [HtmlAttribute] 
colspan [HtmlAttribute] 
shortcuts [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 286
-    def initialize
-      super(HTML_TAG)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html b/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html deleted file mode 100644 index a2592e4..0000000 --- a/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - Class: Wee::Brush::TableHeaderTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::TableHeaderTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='th'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
align [HtmlAttribute] 
colspan [HtmlAttribute] 
shortcuts [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 300
-    def initialize
-      super(HTML_TAG)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/TableRowTag.html b/doc/rdoc/classes/Wee/Brush/TableRowTag.html deleted file mode 100644 index d130561..0000000 --- a/doc/rdoc/classes/Wee/Brush/TableRowTag.html +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - Class: Wee::Brush::TableRowTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::TableRowTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- columns   - headings   - new   - spacer   - spanning_column   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='tr'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - -
align [HtmlAttribute] 
shortcuts [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 236
-    def initialize
-      super(HTML_TAG)
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 240
-    def columns(*cols, &block)
-      with {
-        cols.each {|col|
-          @canvas.table_data.with {
-            if block
-              block.call(col)
-            else
-              @canvas.text(col)
-            end
-          }
-        }
-      } 
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 254
-    def headings(*headers, &block)
-      with {
-        headers.each {|header|
-          @canvas.table_header.with {
-            if block
-              block.call(header)
-            else
-              @canvas.text(header)
-            end
-          }
-        }
-      } 
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 272
-    def spacer
-      with { @canvas.table_data { @canvas.space } }
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 268
-    def spanning_column(str, colspan)
-      with { @canvas.table_data.col_span(colspan).with(str) }
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/TableTag.html b/doc/rdoc/classes/Wee/Brush/TableTag.html deleted file mode 100644 index cf925da..0000000 --- a/doc/rdoc/classes/Wee/Brush/TableTag.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - Class: Wee::Brush::TableTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::TableTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='table'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - -
border [HtmlAttribute] 
cellspacing [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 224
-    def initialize
-      super(HTML_TAG)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/TextAreaTag.html b/doc/rdoc/classes/Wee/Brush/TextAreaTag.html deleted file mode 100644 index dd1efef..0000000 --- a/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - Class: Wee::Brush::TextAreaTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::TextAreaTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::GenericTagBrush -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- __callback   - new   - value   - with   -
-
- -
- - - -
-

Included Modules

- -
- CallbackMixin -
-
- -
- - -
-

Constants

- -
- - - - - - -
HTML_TAG='textarea'.freeze
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
accesskey [HtmlAttribute] 
cols [HtmlAttribute] 
disabled [HtmlAttribute] 
name [HtmlAttribute] 
onblur [HtmlAttribute] 
onchange [HtmlAttribute] 
onfocus [HtmlAttribute] 
onselect [HtmlAttribute] 
readonly [HtmlAttribute] 
rows [HtmlAttribute] 
tabindex [HtmlAttribute] 
type [HtmlAttribute] 
type [HtmlAttribute] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 520
-    def initialize
-      super(HTML_TAG)
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 535
-    def __callback; name(@canvas.register_callback(:input, @callback)) end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 524
-    def value(val)
-      @value = val
-      self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 529
-    def with(value=nil)
-      super(value || @value)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Brush/TextInputTag.html b/doc/rdoc/classes/Wee/Brush/TextInputTag.html deleted file mode 100644 index 5f18f35..0000000 --- a/doc/rdoc/classes/Wee/Brush/TextInputTag.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - Class: Wee::Brush::TextInputTag - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Brush::TextInputTag
In: - - lib/wee/html_brushes.rb - -
-
Parent: - Brush::InputTag -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
HTML_TYPE='text'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 410
-    def initialize
-      super(HTML_TYPE)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/CallAnswerMixin.html b/doc/rdoc/classes/Wee/CallAnswerMixin.html deleted file mode 100644 index f43b179..0000000 --- a/doc/rdoc/classes/Wee/CallAnswerMixin.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - Module: Wee::CallAnswerMixin - - - - - - - - - - -
- - - - - - - - - - -
ModuleWee::CallAnswerMixin
In: - - lib/wee/call_answer.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- answer   - call   - callcc   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Return from a called component. -

-

-NOTE that answer never returns. -

-

-See call for a detailed -description of the call/answer mechanism. -

-

[Source]

-
-
-# File lib/wee/call_answer.rb, line 132
-    def answer(*args)
-      raise AnswerDecoration::Answer.new(args)
-    end
-
-
-
-
- -
- - - - -
-

-Call another component. The calling component is neither rendered nor are -it‘s callbacks processed until the called component answers using -method answer. -

-
-
component
The component to be called. - -
-
return_callback
Is invoked when the called component answers. - -
-
-

-How it works -

-

-The component to be called is wrapped with an AnswerDecoration and a Delegate decoration. The latter is used to -redirect to the called component. Once the decorations are installed, we -end the processing of callbacks prematurely. -

-

-When at a later point in time the called component invokes answer, this will raise a AnswerDecoration::Answer exception -which is catched by the AnswerDecoration we installed before -calling this component, and as such, whose process_callbacks method was -called before we gained control. -

-

-The AnswerDecoration then invokes the -answer_callback to cleanup the decorations we added during call and finally passes control to -the return_callback. -

-

[Source]

-
-
-# File lib/wee/call_answer.rb, line 85
-    def call(component, &return_callback)
-      delegate = Wee::Delegate.new(component)
-      answer = Wee::AnswerDecoration.new {|answ|
-        remove_decoration(delegate)
-        component.remove_decoration(answer)       
-        return_callback.call(*answ.args) if return_callback
-      }
-      add_decoration(delegate)
-      component.add_decoration(answer)
-      session.send_response(nil)
-    end
-
-
-
-
- -
- - - - -
-

-Similar to method call, but -using continuations. -

-

[Source]

-
-
-# File lib/wee/call_answer.rb, line 100
-    def callcc(component)
-      delegate = Wee::Delegate.new(component)
-      answer = Wee::AnswerDecoration.new
-
-      add_decoration(delegate)
-      component.add_decoration(answer)
-
-      answ = Kernel.callcc {|cc|
-        answer.answer_callback = cc
-        session.send_response(nil)
-      }
-      remove_decoration(delegate)
-      component.remove_decoration(answer)
-
-      args = answ.args
-      case args.size
-      when 0
-        return
-      when 1
-        return args.first
-      else
-        return *args
-      end
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/CallbackMixin.html b/doc/rdoc/classes/Wee/CallbackMixin.html deleted file mode 100644 index 3b1e26f..0000000 --- a/doc/rdoc/classes/Wee/CallbackMixin.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - Module: Wee::CallbackMixin - - - - - - - - - - -
- - - - - - - - - - -
ModuleWee::CallbackMixin
In: - - lib/wee/html_brushes.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- call   - callback   - callback_method   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Is called when callback_method was -used. -

-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 329
-    def call(*args)
-      args.push(*@callback_args)
-      @callback_object.send(@callback_id, *args)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 320
-    def callback(&block)
-      @callback = block
-      __callback()
-      return self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_brushes.rb, line 311
-    def callback_method(id, *args)
-      @callback = self
-      @callback_object = @canvas.current_component 
-      @callback_id = id
-      @callback_args = args
-      __callback()
-      return self
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/CallbackRegistry.html b/doc/rdoc/classes/Wee/CallbackRegistry.html deleted file mode 100644 index bb77636..0000000 --- a/doc/rdoc/classes/Wee/CallbackRegistry.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - Class: Wee::CallbackRegistry - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::CallbackRegistry
In: - - lib/wee/callback.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 4
-    def initialize(prefix="")
-      @prefix = prefix
-      @next_id = 0
-      @callbacks = {}    # {callback_id1 => callback1, callback_id2 => callback2}
-      @triggered = nil
-      @obj_map = {}      # obj => [callback_id1, callback_id2, ...]
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 53
-    def each_triggered(object)
-      if ary = @obj_map[object]
-        for id in ary
-          yield @callbacks[id], @triggered[id] if @triggered.has_key?(id)
-        end
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 61
-    def each_triggered_call_with_value(object)
-      if ary = @obj_map[object]
-        for id in ary
-          @callbacks[id].call(@triggered[id]) if @triggered.has_key?(id)
-        end
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 69
-    def first_triggered(object)
-      if ary = @obj_map[object]
-        for id in ary
-          return @callbacks[id] if @triggered.has_key?(id)
-        end
-      end
-      return nil
-    end
-
-
-
-
- -
- - - - -
-

-NOTE that if fields named "xxx" and "xxx.yyy" occur, -the value of @fields[‘xxx’] is { nil => …, -‘yyy’ => … }. This is required to make image buttons -work correctly. -

-

[Source]

-
-
-# File lib/wee/callback.rb, line 31
-    def prepare_triggered(ids_and_values)
-      @triggered = {}
-      ids_and_values.each do |id, value|
-        if id =~ /^#{@prefix}(\d+)([.](.*))?$/
-          id, suffix = Integer($1), $3
-          next unless @callbacks[id]
-
-          if @triggered[id].kind_of?(Hash)
-            @triggered[id][suffix] = value
-          elsif suffix
-            @triggered[id] = {nil => @triggered[id], suffix => value}
-          else
-            @triggered[id] = value
-          end
-        end
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 12
-    def register(object, callback)
-      id = @next_id
-      @next_id += 1
-      @callbacks[id] = callback
-      (@obj_map[object] ||= []) << id
-      return "#{@prefix}#{id}"
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 49
-    def reset_triggered
-      @triggered = nil
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 20
-    def unregister(object)
-      if arr = @obj_map.delete(object)
-        arr.each {|id| @callbacks.delete(id) }
-      end
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Callbacks.html b/doc/rdoc/classes/Wee/Callbacks.html deleted file mode 100644 index 5366db8..0000000 --- a/doc/rdoc/classes/Wee/Callbacks.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - Class: Wee::Callbacks - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Callbacks
In: - - lib/wee/callback.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   - unregister   - with_triggered   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
action_callbacks [R] 
input_callbacks [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 84
-    def initialize
-      @input_callbacks = CallbackRegistry.new("")
-      @action_callbacks = CallbackRegistry.new("a")
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 89
-    def unregister(object)
-      @input_callbacks.unregister(object)
-      @action_callbacks.unregister(object)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/callback.rb, line 94
-    def with_triggered(ids_and_values)
-      @input_callbacks.prepare_triggered(ids_and_values)
-      @action_callbacks.prepare_triggered(ids_and_values)
-      yield
-    ensure
-      @input_callbacks.reset_triggered
-      @action_callbacks.reset_triggered
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Component.html b/doc/rdoc/classes/Wee/Component.html deleted file mode 100644 index 3ea9771..0000000 --- a/doc/rdoc/classes/Wee/Component.html +++ /dev/null @@ -1,553 +0,0 @@ - - - - - - Class: Wee::Component - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Component
In: - - lib/wee/conversation.rb - -
- - lib/wee/component.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-The base class of all components. You should at least overwrite method render in your own subclasses. -

- -
- - -
- -
-

Methods

- -
- children   - choose_from   - confirm   - display   - inform   - instanciate   - new   - process_callbacks   - render   - root?   - state   - state_decoration   -
-
- -
- - - -
-

Included Modules

- -
- Wee::DecorationMixin - Wee::CallAnswerMixin -
-
- -
- - -
-

Constants

- -
- - - - - - -
NO_CHILDREN=[].freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Constructs a new instance of the -component and adds neccessary decorations. -

-

[Source]

-
-
-# File lib/wee/component.rb, line 17
-    def self.instanciate(*args, &block)
-      obj = new(*args, &block)
-      unless obj.respond_to?(:root?) and obj.root?
-        obj.add_decoration Wee::PageDecoration.new
-        obj.add_decoration Wee::FormDecoration.new
-      end
-      obj
-    end
-
-
-
-
- -
- - - - -
-

-Initializes a newly created component. -

-

[Source]

-
-
-# File lib/wee/component.rb, line 37
-    def initialize
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Return all child components. -

-

-OVERWRITE this method and return all child components collected in -an array. -

-

[Source]

-
-
-# File lib/wee/component.rb, line 90
-    def children
-      return NO_CHILDREN
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/conversation.rb, line 35
-    def choose_from(items, caption=nil)
-      display do |r|
-        r.h3 caption if caption
-        selection = nil
-        r.select_list(items).callback {|s| selection = s }
-        r.break
-        r.submit_button.callback { answer selection }.value("Ok"); r.space
-        r.submit_button.callback { answer nil }.value("Cancel")
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/conversation.rb, line 20
-    def confirm(question)
-      display do |r|
-        r.h3 question
-        r.submit_button.callback { answer true }.value("Yes"); r.space
-        r.submit_button.callback { answer false }.value("No")
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/conversation.rb, line 16
-    def display(&block)
-      callcc BlockComponent.new(&block) 
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/conversation.rb, line 28
-    def inform(message)
-      display do |r|
-        r.h3 message  
-        r.submit_button.callback { answer }.value("Ok")
-      end
-    end
-
-
-
-
- -
- - - - -
-

-Process and invoke all input callbacks specified for this component and all -of it‘s child components. -

-

-Returns the action callback to be invoked. -

-

[Source]

-
-
-# File lib/wee/component.rb, line 100
-    def process_callbacks(callbacks)
-      callbacks.input_callbacks.each_triggered_call_with_value(self)
-
-      action_callback = nil
-
-      # process callbacks of all children
-      for child in self.children
-        if act = child.decoration.process_callbacks(callbacks)
-          raise "Duplicate action callback" if action_callback
-          action_callback = act
-        end
-      end
-
-      if act = callbacks.action_callbacks.first_triggered(self)
-        raise "Duplicate action callback" if action_callback
-        action_callback = act
-      end
-
-      return action_callback
-    end
-
-
-
-
- -
- - - - -
-

-This method renders the content of the component. -

-

-OVERWRITE this method in your own component classes to implement the -view. By default this method does nothing! -

-
-
r
An instance of class renderer_class() - -
-
-

[Source]

-
-
-# File lib/wee/component.rb, line 49
-    def render(r)
-    end
-
-
-
-
- -
- - - - -
-

-Is this a root component, which doesn‘t need to be wrapped with a PageDecoration and FormDecoration. -

-

[Source]

-
-
-# File lib/wee/component.rb, line 30
-    def root?
-      false
-    end
-
-
-
-
- -
- - - - -
-

-Take snapshots of objects that should correctly be backtracked. -

-

-Backtracking means that you can go back in time of the components’ state. Therefore it is neccessary to take -snapshots of those objects that want to participate in backtracking. Taking -snapshots of the whole component tree would be too expensive and -unflexible. Note that methods take_snapshot and -restore_snapshot are called for those objects to take the snapshot -(they behave like marshal_dump and marshal_load). -Overwrite them if you want to define special behaviour. -

-

-By default only the decoration chain is backtracked. This is required to -correctly backtrack called components. To disable backtracking of the -decorations, change method Component#state_decoration to a -no-operation: -

-
-  def state_decoration(s)
-    # nothing here
-  end
-
-
-
s
An object of class State - -
-
-

[Source]

-
-
-# File lib/wee/component.rb, line 76
-    def state(s)
-      state_decoration(s)
-      for child in self.children
-        child.decoration.state(s)
-      end
-    end
-
-
-
-
- -

Protected Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/component.rb, line 123
-    def state_decoration(s)
-      s.add_ivar(self, :@decoration, @decoration)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Decoration.html b/doc/rdoc/classes/Wee/Decoration.html deleted file mode 100644 index 54d91ac..0000000 --- a/doc/rdoc/classes/Wee/Decoration.html +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - Class: Wee::Decoration - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Decoration
In: - - lib/wee/decoration.rb - -
-
Parent: - - Presenter - -
-
- - -
- - - -
- -
-

-Abstract base class of all decorations. Forwards the methods process_callbacks, render_on and state to the next decoration in the -chain. Subclasses should provide special behaviour in these methods, -otherwise the decoration does not make sense. -

-

-For example, a HeaderFooterDecoration class could draw a header and footer -around the decorations or components below itself: -

-
-  class HeaderFooterDecoration < Wee::Decoration
-    alias render_on render_presenter_on
-    def render(r)
-      r.text "header"
-      r.render_decoration(@next)
-      r.text "footer"
-    end
-  end
-
- -
- - -
- -
-

Methods

- -
- global?   - process_callbacks   - render_on   - state   -
-
- -
- - - - -
- - - -
-

External Aliases

- -
- - - - - - -
render_on->render_presenter_on
-
-
- - -
-

Attributes

- -
- - - - - - -
next [RW]  -Points to the next decoration in the chain. A decoration is responsible for -all decorations or components "below" it (everything that follows -this decoration in the chain). In other words, it‘s the owner of -everything "below" itself. - -
-
-
- - - - -
-

Public Instance methods

- -
- - - - -
-

-Is this decoration a global or a local one? By default all decorations are -local unless this method is overwritten. -

-

-A global decoration is added in front of the decoration chain, a local -decoration is added in front of all other local decorations but after all -global decorations. -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 41
-    def global?() false end
-
-
-
-
- -
- - - - -
-

-Forwards method call to the next decoration in the chain. -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 46
-    def process_callbacks(callbacks)
-      @next.process_callbacks(callbacks)
-    end
-
-
-
-
- -
- - - - -
-

-Forwards method call to the next decoration in the chain. -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 54
-    def render_on(r)
-      @next.render_on(r)
-    end
-
-
-
-
- -
- - - - -
-

-We have to save the @next attribute to be able to correctly backtrack -calls, as method Wee::Component#call modifies it in the call to -component.remove_decoration(answer). Removing the -answer-decoration has the advantage to be able to call a component more -than once! -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 65
-    def state(s)
-      @next.state(s)
-      s.add_ivar(self, :@next, @next)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/DecorationMixin.html b/doc/rdoc/classes/Wee/DecorationMixin.html deleted file mode 100644 index e444825..0000000 --- a/doc/rdoc/classes/Wee/DecorationMixin.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - Module: Wee::DecorationMixin - - - - - - - - - - -
- - - - - - - - - - -
ModuleWee::DecorationMixin
In: - - lib/wee/decoration.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Adds decoration d to -the decoration chain. -

-

-A global decoration is added in -front of the decoration chain, a -local decoration is added in -front of all other local decorations but after all global decorations. -

-

-Returns: self -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 97
-    def add_decoration(d)
-      if d.global?
-        d.next = self.decoration
-        self.decoration = d
-      else
-        last_global = nil
-        each_decoration {|i| 
-          if i.global?
-            last_global = i
-          else
-            break
-          end
-        }
-        if last_global.nil?
-          # no global decorations specified -> add in front
-          d.next = self.decoration
-          self.decoration = d
-        else
-          # add after last_global
-          d.next = last_global.next
-          last_global.next = d
-        end
-      end
-
-      return self
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 75
-    def decoration() @decoration || self end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 74
-    def decoration=(d) @decoration = d end
-
-
-
-
- -
- - - - -
-

-Iterates over all decorations (note that the component itself is excluded). -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 80
-    def each_decoration # :yields: decoration
-      d = @decoration
-      while d and d != self
-        yield d
-        d = d.next
-      end
-    end
-
-
-
-
- -
- - - - -
-

-Remove decoration d -from the decoration chain. -

-

-Returns the removed decoration -or nil if it did not exist in the decoration chain. -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 130
-    def remove_decoration(d)
-      if d == self.decoration  # 'd' is in front
-        self.decoration = d.next
-      else
-        last_decoration = self.decoration
-        next_decoration = nil
-        loop do
-          return nil if last_decoration == self or last_decoration.nil?
-          next_decoration = last_decoration.next
-          break if d == next_decoration
-          last_decoration = next_decoration
-        end
-        last_decoration.next = d.next
-      end
-      d.next = nil  # decoration 'd' no longer is an owner of anything!
-      return d
-    end
-
-
-
-
- -
- - - - -
-

-Remove all decorations that match the block condition. -

-

-Example (removes all decorations of class HaloDecoration): -

-
-  remove_decoration_if {|d| d.class == HaloDecoration}
-
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 155
-    def remove_decoration_if # :yields: decoration
-      to_remove = []
-      each_decoration {|d| to_remove << d if yield d}
-      to_remove.each {|d| remove_decoration(d)}
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Delegate.html b/doc/rdoc/classes/Wee/Delegate.html deleted file mode 100644 index 348c600..0000000 --- a/doc/rdoc/classes/Wee/Delegate.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - Class: Wee::Delegate - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Delegate
In: - - lib/wee/decoration.rb - -
-
Parent: - - Decoration - -
-
- - -
- - - -
- -
-

-A Wee::Delegate breaks the decoration chain and -forwards the methods process_callbacks, -render_on and state to the corresponding chain -method of it‘s delegate component (a Wee::Component). -

- -
- - -
- -
-

Methods

- -
- new   - process_callbacks   - render_on   - state   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 170
-    def initialize(delegate)
-      @delegate = delegate
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Forwards method to the corresponding top-level chain method of the -delegate component. -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 178
-    def process_callbacks(callbacks)
-      @delegate.decoration.process_callbacks(callbacks)
-    end
-
-
-
-
- -
- - - - -
-

-Forwards method to the corresponding top-level chain method of the -delegate component. -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 186
-    def render_on(r)
-      @delegate.decoration.render_on(r)
-    end
-
-
-
-
- -
- - - - -
-

-Forwards method to the corresponding top-level chain method of the -delegate component. We also take snapshots of all non-visible -components, thus we follow the @next decoration (via super). -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 195
-    def state(s)
-      super
-      @delegate.decoration.state(s)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html b/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html deleted file mode 100644 index c512842..0000000 --- a/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - Module: Wee::DupReplaceSnapshotMixin - - - - - - - - - - -
- - - - - - - - - - -
ModuleWee::DupReplaceSnapshotMixin
In: - - lib/wee/state.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 58
-    def restore_snapshot(snap)
-      replace(snap)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 54
-    def take_snapshot
-      dup
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/ErrorResponse.html b/doc/rdoc/classes/Wee/ErrorResponse.html deleted file mode 100644 index f019397..0000000 --- a/doc/rdoc/classes/Wee/ErrorResponse.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - Class: Wee::ErrorResponse - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::ErrorResponse
In: - - lib/wee/response.rb - -
-
Parent: - - Response - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - -
-

Included Modules

- -
- Rack::Utils -
-
- -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/response.rb, line 49
-    def initialize(exception)
-      super()
-      self << "<html><head><title>Error occured</title></head><body>"
-      self << "<p>#{ escape_html(@exception.inspect) }<br/>"
-      self << exception.backtrace.map{|s| escape_html(s)}.join("<br/>") 
-      self << "</p>"
-      self << "</body></html>"
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/FormDecoration.html b/doc/rdoc/classes/Wee/FormDecoration.html deleted file mode 100644 index b50f954..0000000 --- a/doc/rdoc/classes/Wee/FormDecoration.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Class: Wee::FormDecoration - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::FormDecoration
In: - - lib/wee/decoration.rb - -
-
Parent: - - WrapperDecoration - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- global?   - render   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 234
-    def global?() true end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 236
-    def render(r)
-      r.form { render_inner(r) }
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/GenericResponse.html b/doc/rdoc/classes/Wee/GenericResponse.html deleted file mode 100644 index 5e64b15..0000000 --- a/doc/rdoc/classes/Wee/GenericResponse.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - Class: Wee::GenericResponse - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::GenericResponse
In: - - lib/wee/response.rb - -
-
Parent: - - Response - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - - - - - - -
EXPIRE_OFFSET=3600*24*365*20
EXPIRES_HEADER='Expires'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/response.rb, line 14
-    def initialize(*args)
-      super
-      self[EXPIRES_HEADER] ||= (Time.now + EXPIRE_OFFSET).rfc822
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/HtmlCanvas.html b/doc/rdoc/classes/Wee/HtmlCanvas.html deleted file mode 100644 index b3cfa01..0000000 --- a/doc/rdoc/classes/Wee/HtmlCanvas.html +++ /dev/null @@ -1,1054 +0,0 @@ - - - - - - Class: Wee::HtmlCanvas - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::HtmlCanvas
In: - - lib/wee/html_canvas.rb - -
-
Parent: - - Renderer - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- <<   - brush_tag   - build_url   - close   - css   - divert   - encode_text   - generic_single_tag   - generic_tag   - handle   - handle2   - handle3   - link_css   - multiline_text   - nest   - new   - new_radio_group   - once   - register_callback   - select_list   - set_brush   - space   - text   - url_for_callback   - url_for_callback_id   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - - - - - - - - - - - -
HTML_NBSP="&nbsp;".freeze
HTML_TYPE_CSS='text/css'.freeze
HTML_REL_STYLESHEET='stylesheet'.freeze
-
-
- -
-

External Aliases

- -
- - - - - - -
check_box->checkbox
-
-
- - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
anchor [Brush] 
body [GenericTagBrush] 
bold [Brush] 
break [Brush] 
check_box [Brush] 
div [GenericTagBrush] 
file_upload [Brush] 
form [Brush] 
h1 [GenericTagBrush] 
h2 [GenericTagBrush] 
h3 [GenericTagBrush] 
h4 [GenericTagBrush] 
h5 [GenericTagBrush] 
head [GenericTagBrush] 
hidden_input [Brush] 
hr [GenericSingleTagBrush] 
html [GenericTagBrush] 
image [Brush] 
image_button [Brush] 
input [Brush] 
javascript [Brush] 
label [GenericTagBrush] 
li [GenericTagBrush] 
link [Brush] 
ol [GenericTagBrush] 
option [Brush] 
page [Brush] 
paragraph [Brush] 
password_input [Brush] 
pre [GenericTagBrush] 
radio_button [Brush] 
span [GenericTagBrush] 
style [GenericTagBrush] 
submit_button [Brush] 
table [Brush] 
table_data [Brush] 
table_header [Brush] 
table_row [Brush] 
text_area [Brush] 
text_input [Brush] 
title [GenericTagBrush] 
ul [GenericTagBrush] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 27
-    def self.brush_tag(attr, klass, *args_to_new)
-      args_to_new = args_to_new.map {|a| a.inspect}.join(", ")
-      if klass.instance_method(:with).arity != 0
-        class_eval %{ 
-          def #{attr}(*args, &block)
-            handle(#{klass}.new(#{args_to_new}), *args, &block)
-          end
-        }
-      elsif klass.nesting?
-        class_eval %{ 
-          def #{attr}(&block)
-            handle2(#{klass}.new(#{args_to_new}), &block)
-          end
-        }
-      else
-        class_eval %{ 
-          def #{attr}
-            handle3(#{klass}.new(#{args_to_new}))
-          end
-        }
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 54
-    def self.generic_single_tag(*attrs)
-      attrs.each {|attr| brush_tag attr, Brush::GenericSingleTagBrush, attr }
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 50
-    def self.generic_tag(*attrs)
-      attrs.each {|attr| brush_tag attr, Brush::GenericTagBrush, attr }
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 7
-    def initialize(*args)
-      super
-      @current_brush = nil
-    end
-
-
-
-
- -

Public Instance methods

- -
- - -
- <<(str) -
- -
-

-Alias for text -

-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 186
-    def build_url(*args)
-      @request.build_url(*args)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 12
-    def close
-      @current_brush.close if @current_brush
-      @current_brush = nil
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 115
-    def css(str)
-      @current_brush.close if @current_brush
-      @current_brush = nil
-      @document.start_tag(:style, 'type' => 'text/css')
-      @document.write("<!--\n")
-      @document.text(str)
-      @document.write("-->\n")
-      @document.end_tag(:style)
-    end
-
-
-
-
- -
- - - - -
-

-Define a divert location or change -into an existing divert location (and -append txt or the contents of block). -

-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 149
-    def divert(tag, txt=nil, &block)
-      @document.divert(tag, txt, &block)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 108
-    def encode_text(str)
-      @current_brush.close if @current_brush
-      @current_brush = nil
-      @document.encode_text(str)
-      nil
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 166
-    def link_css(url)
-      link.type(HTML_TYPE_CSS).rel(HTML_REL_STYLESHEET).href(url)
-    end
-
-
-
-
- -
- - - - -
-

-converts \n into <br/> -

-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 128
-    def multiline_text(str, encode=true)
-      @current_brush.close if @current_brush
-      @current_brush = nil
-
-      first = true
-      str.each_line do |line|
-        @document.single_tag(:br) unless first
-        first = false
-
-        if encode
-          @document.encode_text(line)
-        else
-          @document.text(line)
-        end
-      end 
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 17
-    def nest
-      old_brush = @current_brush
-      # we don't want that Brush#close is calledas #nest
-      # is called from #with -> this avoids an infinite loop
-      @current_brush = nil 
-      yield
-      @current_brush.close if @current_brush
-      @current_brush = old_brush
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 170
-    def new_radio_group
-      Wee::Brush::RadioButtonTag::RadioGroup.new(self)
-    end
-
-
-
-
- -
- - - - -
-

-Render specific markup only once. For -example style and/or javascript of a component which has many instances. -

-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 157
-    def once(tag)
-      return if  @document.set.has_key?(tag)
-      @document.set[tag] = true
-      yield if block_given? 
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 190
-    def register_callback(type, callback)
-      cbs = @callbacks
-      if cbs.respond_to?("#{type}_callbacks")
-        cbs.send("#{type}_callbacks").register(@current_component, callback)
-      else
-        raise
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 89
-    def select_list(items, &block)
-      handle2(Brush::SelectListTag.new(items), &block)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 95
-    def space(n=1)
-      text(HTML_NBSP*n)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 99
-    def text(str)
-      @current_brush.close if @current_brush
-      @current_brush = nil
-      @document.text(str)
-      nil
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 174
-    def url_for_callback(callback, type=:action, hash=nil)
-      url_for_callback_id(register_callback(type, callback), hash)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 178
-    def url_for_callback_id(callback_id, hash=nil)
-      if hash
-        build_url(hash.update(:callback_id => callback_id))
-      else
-        build_url(:callback_id => callback_id)
-      end
-    end
-
-
-
-
- -

Protected Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 210
-    def handle(brush, *args, &block)
-      if block or not args.empty?
-        set_brush(brush)
-        brush.with(*args, &block) 
-      else
-        set_brush(brush)
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 219
-    def handle2(brush, &block)
-      if block
-        set_brush(brush)
-        brush.with(&block) 
-      else
-        set_brush(brush)
-      end
-    end
-
-
-
-
- -
- - -
- handle3(brush) -
- -
-

-Alias for set_brush -

-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_canvas.rb, line 201
-    def set_brush(brush)
-      brush.setup(self, @document)
-
-      @current_brush.close if @current_brush
-      @current_brush = brush
-
-      return brush
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/HtmlDocument.html b/doc/rdoc/classes/Wee/HtmlDocument.html deleted file mode 100644 index 105807c..0000000 --- a/doc/rdoc/classes/Wee/HtmlDocument.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - Class: Wee::HtmlDocument - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::HtmlDocument
In: - - lib/wee/html_document.rb - -
-
Parent: - - HtmlWriter - -
-
- - -
- - - -
- -
-

-Represents a complete HTML document. -

- -
- - -
- -
-

Methods

- -
- divert   - new   - set   - to_s   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_document.rb, line 9
-    def initialize
-      super([])
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_document.rb, line 17
-    def divert(tag, txt=nil, &block)
-      raise ArgumentError if txt and block
-      @divert ||= {}
-
-      unless divert = @divert[tag]
-        @divert[tag] = divert = []
-        @port << divert
-      end
-
-      if txt
-        divert << txt
-      end
-
-      if block
-        old_port = @port
-        begin
-          @port = divert
-          block.call
-        ensure
-          @port = old_port
-        end
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_document.rb, line 13
-    def set
-      @set ||= {}
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_document.rb, line 41
-    def to_s
-      @port.join
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/HtmlWriter.html b/doc/rdoc/classes/Wee/HtmlWriter.html deleted file mode 100644 index dadd16a..0000000 --- a/doc/rdoc/classes/Wee/HtmlWriter.html +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - Class: Wee::HtmlWriter - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::HtmlWriter
In: - - lib/wee/html_writer.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-A class used to write out HTML -documents easily. -

-

-Usage: -

-
-  w = Wee::HtmlWriter.new(doc='')
-  w.start_tag('html')
-  w.start_tag('body')
-  w.start_tag('a', 'href' => 'http://...')
-  w.text('link')
-  w.end_tag('a')
-  w.end_tag('body')
-  w.end_tag('html')
-
-  p doc  # => '<html><body><a href="http://...">link</a></body></html>'
-
- -
- - -
- -
-

Methods

- -
- <<   - encode_text   - end_tag   - new   - single_tag   - start_tag   - text   - write   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - - - - - - -
CLOSING=">".freeze
SINGLE_CLOSING=" />".freeze
-
-
- - - -
-

Attributes

- -
- - - - - - -
port [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_writer.rb, line 25
-    def initialize(port=[])
-      @port = port
-    end
-
-
-
-
- -

Public Instance methods

- -
- - -
- <<(str) -
- -
-

-Alias for write -

-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_writer.rb, line 60
-    def encode_text(str)
-      @port << Rack::Utils.escape_html(str.to_s)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_writer.rb, line 52
-    def end_tag(tag)
-      @port << "</#{tag}>"
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_writer.rb, line 48
-    def single_tag(tag, attributes=nil)
-      start_tag(tag, attributes, true)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_writer.rb, line 32
-    def start_tag(tag, attributes=nil, single=false)
-      if attributes
-        @port << "<#{tag}"
-        attributes.each {|k, v| 
-          if v
-            @port << %[ #{ k }="#{ v }"] 
-          else
-            @port << %[ #{ k }] 
-          end
-        }
-        @port << (single ? SINGLE_CLOSING : CLOSING)
-      else
-        @port << (single ? "<#{tag} />" : "<#{tag}>")
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_writer.rb, line 56
-    def text(str)
-      @port << str.to_s
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/html_writer.rb, line 64
-    def write(str)
-      @port << str
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/IdGenerator.html b/doc/rdoc/classes/Wee/IdGenerator.html deleted file mode 100644 index 5e7c08e..0000000 --- a/doc/rdoc/classes/Wee/IdGenerator.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - Class: Wee::IdGenerator - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::IdGenerator
In: - - lib/wee/id_generator.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-Abstract base class of all id generators. -

- -
- - -
- -
-

Methods

- -
- next   -
-
- -
- - - - -
- -
-

Classes and Modules

- - Class Wee::IdGenerator::Secure
-Class Wee::IdGenerator::Sequential
- -
- - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/id_generator.rb, line 7
-    def next
-      raise "subclass responsibility"
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/IdGenerator/Secure.html b/doc/rdoc/classes/Wee/IdGenerator/Secure.html deleted file mode 100644 index e034b32..0000000 --- a/doc/rdoc/classes/Wee/IdGenerator/Secure.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - Class: Wee::IdGenerator::Secure - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::IdGenerator::Secure
In: - - lib/wee/id_generator.rb - -
-
Parent: - IdGenerator -
-
- - -
- - - -
- -
-

-Returned ids are unique with a very high probability and it‘s very -hard to guess the next or any used id. -

- -
- - -
- -
-

Methods

- -
- new   - next   - next_md5   - next_secure   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/id_generator.rb, line 39
-    def initialize(salt='wee')
-      @salt = salt
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/id_generator.rb, line 60
-    def next
-      str = defined?(::SecureRandom) ? next_secure : next_md5
-      packed = [str].pack('m')
-      packed.tr!("=\r\n", '')
-      packed.tr!('+/', '-_')
-      packed
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/id_generator.rb, line 43
-    def next_md5
-      now = Time.now
-      dig = Digest::MD5.new
-      dig.update(now.to_s)
-      dig.update(now.usec.to_s)
-      dig.update(rand(0).to_s)
-      dig.update($$.to_s)
-      dig.update(@salt.to_s)
-      dig.digest
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/id_generator.rb, line 54
-    def next_secure
-      SecureRandom.random_bytes(16)
-    rescue NotImplementedError
-      next_md5
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/IdGenerator/Sequential.html b/doc/rdoc/classes/Wee/IdGenerator/Sequential.html deleted file mode 100644 index 225ed67..0000000 --- a/doc/rdoc/classes/Wee/IdGenerator/Sequential.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - Class: Wee::IdGenerator::Sequential - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::IdGenerator::Sequential
In: - - lib/wee/id_generator.rb - -
-
Parent: - IdGenerator -
-
- - -
- - - -
- -
-

-Sequential id generator. -

-

-Returned ids are guaranteed to be unique, but they are easily guessable. -

- -
- - -
- -
-

Methods

- -
- new   - next   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/id_generator.rb, line 18
-    def initialize(initial_value=0)
-      @value = initial_value - 1
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/id_generator.rb, line 22
-    def next
-      (@value += 1).to_s(36)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/JQuery.html b/doc/rdoc/classes/Wee/JQuery.html deleted file mode 100644 index 626c5b7..0000000 --- a/doc/rdoc/classes/Wee/JQuery.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - Class: Wee::JQuery - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::JQuery
In: - - lib/wee/jquery/jquery.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - -
-

Constants

- -
- - - - - - - - - - - -
FILES=%w(jquery-1.3.2.min.js wee-jquery.js)
PUBLIC_DIR=File.expand_path(File.join(File.dirname(__FILE__), 'public'))
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/jquery/jquery.rb, line 6
-    def self.install(mount_path, builder)
-      builder.map(@mount_path = mount_path) do
-        run Rack::File.new(Wee::JQuery::PUBLIC_DIR)
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/jquery/jquery.rb, line 12
-    def self.javascript_includes(r)
-      raise "JQuery.install needs to be called" unless @mount_path
-      FILES.each {|f| r.javascript.src("#{@mount_path}/#{f}") }
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/LRUCache.html b/doc/rdoc/classes/Wee/LRUCache.html deleted file mode 100644 index 58cf579..0000000 --- a/doc/rdoc/classes/Wee/LRUCache.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - - - Class: Wee::LRUCache - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::LRUCache
In: - - lib/wee/lru_cache.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-Implementation of a Least Recently Used (LRU) Cache -

- -
- - -
- -
-

Methods

- -
- []   - []=   - delete   - delete_if   - each   - fetch   - garbage_collect   - has_key?   - min_key   - new   - store   -
-
- -
- - - - -
- -
-

Classes and Modules

- - Class Wee::LRUCache::Item
- -
- - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 19
-    def initialize(capacity=20, &replace_callback)
-      @capacity = capacity
-      @replace_callback = replace_callback
-      @store = Hash.new
-      @time = 0
-    end
-
-
-
-
- -

Public Instance methods

- -
- - -
- [](key, default_value=nil) -
- -
-

-Alias for fetch -

-
-
- -
- - -
- []=(key, value) -
- -
-

-Alias for store -

-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 30
-    def delete(key)
-      @store.delete(key)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 34
-    def delete_if
-      @store.delete_if {|id, item|
-        yield id, item.value
-      }
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 71
-    def each(&block)
-      @store.each(&block)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 40
-    def fetch(key, default_value=nil)
-      if item = @store[key]
-        item.time = (@time += 1)
-        item.value
-      else
-        default_value
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 68
-    def garbage_collect
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 26
-    def has_key?(key)
-      @store.has_key?(key)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 49
-    def store(key, value)
-      if item = @store[key]
-        # update item only
-        item.time = (@time += 1)
-        item.value = value
-      else
-        # insert new item
-        item = Item.new
-        item.time = (@time += 1)
-        item.value = value
-        garbage_collect() if @store.size >= @capacity
-        while @store.size >= @capacity
-          old_item = @store.delete(min_key()) || raise
-          @replace_callback.call(old_item) if @replace_callback
-        end
-        @store[key] = item
-      end
-    end
-
-
-
-
- -

Protected Instance methods

- -
- - - - -
-

-Returns the key of the minimum item -

-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 83
-    def min_key
-      min_k, min_time = nil, @time
-      @store.each {|k, v|
-        if v.time < min_time 
-          min_k, min_time = k, v.time
-        end
-      }
-      return min_k
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/LRUCache/Item.html b/doc/rdoc/classes/Wee/LRUCache/Item.html deleted file mode 100644 index 8c62689..0000000 --- a/doc/rdoc/classes/Wee/LRUCache/Item.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - Class: Wee::LRUCache::Item - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::LRUCache::Item
In: - - lib/wee/lru_cache.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- <=>   - new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
time [RW] 
value [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 10
-      def initialize(value=nil, time=nil)
-        @value, @time = value, time
-      end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/lru_cache.rb, line 14
-      def <=>(other)
-        @time <=> other.time
-      end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/ObjectSnapshotMixin.html b/doc/rdoc/classes/Wee/ObjectSnapshotMixin.html deleted file mode 100644 index c121b76..0000000 --- a/doc/rdoc/classes/Wee/ObjectSnapshotMixin.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Module: Wee::ObjectSnapshotMixin - - - - - - - - - - -
- - - - - - - - - - -
ModuleWee::ObjectSnapshotMixin
In: - - lib/wee/state.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 72
-    def restore_snapshot(snap)
-      snap.each do |k,v|
-        instance_variable_set(k, v)
-      end
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 64
-    def take_snapshot
-      snap = Hash.new
-      instance_variables.each do |iv|
-        snap[iv] = instance_variable_get(iv)
-      end
-      snap
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/OidDecoration.html b/doc/rdoc/classes/Wee/OidDecoration.html deleted file mode 100644 index 5366928..0000000 --- a/doc/rdoc/classes/Wee/OidDecoration.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - Class: Wee::OidDecoration - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::OidDecoration
In: - - lib/wee/decoration.rb - -
-
Parent: - - WrapperDecoration - -
-
- - -
- - - -
- -
-

-Renders a <div> tag with a unique "id" around the wrapped -component. Useful for components that want to update their content in-place -using AJAX. -

- -
- - -
- -
-

Methods

- -
- render   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 227
-    def render(r)
-      r.div.oid.with { render_inner(r) }
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/PageDecoration.html b/doc/rdoc/classes/Wee/PageDecoration.html deleted file mode 100644 index 0e7cb77..0000000 --- a/doc/rdoc/classes/Wee/PageDecoration.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - Class: Wee::PageDecoration - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::PageDecoration
In: - - lib/wee/decoration.rb - -
-
Parent: - - WrapperDecoration - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- global?   - new   - render   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 244
-    def initialize(title='', stylesheets=[], javascripts=[])
-      @title = title
-      @stylesheets = stylesheets
-      @javascripts = javascripts
-      super()
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 251
-    def global?() true end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 253
-    def render(r)
-      r.page.title(@title).head {
-        @stylesheets.each {|s| r.link_css(s) }
-        @javascripts.each {|j| r.javascript.src(j) }
-      }.with {
-        render_inner(r)
-      }
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Presenter.html b/doc/rdoc/classes/Wee/Presenter.html deleted file mode 100644 index cef8008..0000000 --- a/doc/rdoc/classes/Wee/Presenter.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - Class: Wee::Presenter - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Presenter
In: - - lib/wee/presenter.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-Presenter is the superclass of all classes -that want to participate in rendering and callback-processing. It merely -specifies an interface without actual implementation. -

-

-Class Component and Decoration are it‘s two most important -subclasses. -

- -
- - -
- -
-

Methods

- -
- process_callbacks   - render   - render_on   - renderer_class   - session   - state   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/presenter.rb, line 19
-    def process_callbacks(callbacks); raise end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/presenter.rb, line 16
-    def render(r); raise end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/presenter.rb, line 12
-    def render_on(r)
-      r.with(self) {|new_r| render(new_r)}
-    end
-
-
-
-
- -
- - - - -
-

-Returns the class used as Renderer for this -presenter. Overwrite this method if you want to use a different Renderer than the default one. -

-

-Returned class must be a subclass of Wee::Renderer. -

-

[Source]

-
-
-# File lib/wee/presenter.rb, line 27
-    def renderer_class
-      Wee::DefaultRenderer
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/presenter.rb, line 17
-    def state(s); raise end
-
-
-
-
- -

Protected Instance methods

- -
- - - - -
-

-Returns the current session. A -presenter (or component) has always an associated session. The returned object is of class -Wee::Session or a subclass thereof. -

-

[Source]

-
-
-# File lib/wee/presenter.rb, line 38
-    def session
-      Wee::Session.current
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/RedirectResponse.html b/doc/rdoc/classes/Wee/RedirectResponse.html deleted file mode 100644 index 595be9a..0000000 --- a/doc/rdoc/classes/Wee/RedirectResponse.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - Class: Wee::RedirectResponse - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::RedirectResponse
In: - - lib/wee/response.rb - -
-
Parent: - - Response - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
LOCATION_HEADER='Location'.freeze
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/response.rb, line 23
-    def initialize(location)
-      super(['<title>302 - Redirect</title><h1>302 - Redirect</h1>',
-             '<p>You are being redirected to <a href="', location, '">', 
-             location, '</a>'], 302, LOCATION_HEADER => location)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/RefreshResponse.html b/doc/rdoc/classes/Wee/RefreshResponse.html deleted file mode 100644 index 2a659c6..0000000 --- a/doc/rdoc/classes/Wee/RefreshResponse.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - Class: Wee::RefreshResponse - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::RefreshResponse
In: - - lib/wee/response.rb - -
-
Parent: - - Response - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/response.rb, line 31
-    def initialize(message, location, seconds=5)
-      super([%[<html>
-        <head>
-          <meta http-equiv="REFRESH" content="#{seconds};URL=#{location}">
-          <title>#{message}</title>
-        </head>
-        <body>
-          <h1>#{message}</h1>
-          You are being redirected to <a href="#{location}">#{location}</a> 
-          in #{seconds} seconds.
-        </body>
-        </html>]])
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Renderer.html b/doc/rdoc/classes/Wee/Renderer.html deleted file mode 100644 index 1888a95..0000000 --- a/doc/rdoc/classes/Wee/Renderer.html +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - Class: Wee::Renderer - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Renderer
In: - - lib/wee/renderer.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-Base class of all Renderer classes. -

- -
- - -
- -
-

Methods

- -
- close   - new   - render   - render_decoration   - with   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
callbacks [RW] 
current_component [RW] 
document [RW] 
request [RW] 
response [RW] 
session [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/renderer.rb, line 14
-    def initialize(session=nil, request=nil, response=nil, callbacks=nil, document=nil, current_component=nil)
-      @session = session
-      @request = request
-      @response = response
-      @callbacks = callbacks
-      @document = document
-      @current_component = current_component
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Subclass responsibility. -

-

[Source]

-
-
-# File lib/wee/renderer.rb, line 67
-    def close
-    end
-
-
-
-
- -
- - - - -
-

-NOTE: unregister will do nothing for a regular request, only for an AJAX -request. Only if you would render one -and the same component twice it would behave differently. -

-

[Source]

-
-
-# File lib/wee/renderer.rb, line 50
-    def render(component)
-      close
-      self.callbacks.unregister(component)
-      component.decoration.render_on(self)
-      nil
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/renderer.rb, line 57
-    def render_decoration(decoration)
-      close
-      self.callbacks.unregister(decoration)
-      decoration.render_on(self)
-      nil
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/renderer.rb, line 23
-    def with(component)
-      rclass = component.renderer_class
-      if rclass == self
-        # reuse renderer
-        old_component = @current_component 
-        begin
-          @current_component = component
-          yield self
-        ensure
-          @current_component = old_component
-        end
-      else
-        close
-        r = rclass.new(@session, @request, @response, @callbacks, @document, component)
-        begin
-          yield r
-        ensure
-          r.close
-        end
-      end
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Request.html b/doc/rdoc/classes/Wee/Request.html deleted file mode 100644 index 0571dd4..0000000 --- a/doc/rdoc/classes/Wee/Request.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - Class: Wee::Request - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Request
In: - - lib/wee/request.rb - -
-
Parent: - Rack::Request -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- action?   - build_url   - new   - new   - render?   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
fields [R] 
page_id [RW] 
session_id [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/request.rb, line 15
-    def initialize(env)
-      super(env)
-      @fields = self.params
-      @session_id = @fields.delete("_s")
-      @page_id = @fields.delete("_p")
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/request.rb, line 7
-    def self.new(env)
-      env['wee.request'] ||= super 
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Is this an action request? -

-

[Source]

-
-
-# File lib/wee/request.rb, line 23
-    def action?
-      not render?
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/request.rb, line 32
-    def build_url(hash={})
-      session_id = hash.has_key?(:session_id) ? hash[:session_id] : @session_id
-      page_id = hash.has_key?(:page_id) ? hash[:page_id] : @page_id
-      callback_id = hash[:callback_id]
-      info = hash.has_key?(:info) ? hash[:info] : @info
-
-      raise ArgumentError if session_id.nil? and not page_id.nil?
-      raise ArgumentError if page_id.nil? and not callback_id.nil?
-
-      q = {}
-      q['_s'] = session_id if session_id
-      q['_p'] = page_id if page_id
-      q[callback_id] = nil if callback_id 
-
-      path = script_name() + (info || path_info())
-      path << "?" << Rack::Utils.build_query(q) unless q.empty? 
-
-      return path
-    end
-
-
-
-
- -
- - - - -
-

-Is this a render request? -

-

[Source]

-
-
-# File lib/wee/request.rb, line 28
-    def render?
-      @fields.empty?
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Response.html b/doc/rdoc/classes/Wee/Response.html deleted file mode 100644 index 5c0b412..0000000 --- a/doc/rdoc/classes/Wee/Response.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - Class: Wee::Response - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Response
In: - - lib/wee/response.rb - -
-
Parent: - Rack::Response -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - -
-

External Aliases

- -
- - - - - - -
write-><<
-
-
- - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Session.html b/doc/rdoc/classes/Wee/Session.html deleted file mode 100644 index 51bc708..0000000 --- a/doc/rdoc/classes/Wee/Session.html +++ /dev/null @@ -1,750 +0,0 @@ - - - - - - Class: Wee::Session - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Session
In: - - lib/wee/session.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- action   - alive?   - awake   - call   - current   - dead?   - handle   - new   - render   - render_ajax_proc   - send_response   - sleep   - statistics   - take_snapshot   - terminate   -
-
- -
- - - - -
- -
-

Classes and Modules

- - Class Wee::Session::AbortProcessing
-Class Wee::Session::MutexSerializer
-Class Wee::Session::Page
-Class Wee::Session::ThreadSerializer
- -
- - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
application [RW]  -Points to the Wee::Application object this -session belongs to. - -
expire_after [RW]  -Expire the session after this number of seconds of inactivity. If this -value is nil, the Session will never -expire due to inactivity. (but still may expire for example due to -max_lifetime). - -

-Default: 1800 seconds (30 minutes) -

-
id [RW]  -The (application-wide) unique id of this session. - -
max_lifetime [RW]  -The maximum lifetime of this session in seconds. A value of nil -means infinite lifetime. - -

-Default: nil (infinite lifetime) -

-
max_requests [RW]  -The maximum number of requests this session is allowed to serve. A value of -nil means no limitation. - -

-Default: nil (infinite number of requests) -

-
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

-Returns the current session -(thread-local). -

-

[Source]

-
-
-# File lib/wee/session.rb, line 164
-    def self.current
-      Thread.current[:wee_session] || (raise "Not in session")
-    end
-
-
-
-
- -
- - - - -
-

-Creates a new session. -

-

[Source]

-
-
-# File lib/wee/session.rb, line 100
-    def initialize(root_component, serializer=nil, page_cache_capacity=20)
-      @root_component = root_component
-      @page_cache = Wee::LRUCache.new(page_cache_capacity)
-      @page_ids = Wee::IdGenerator::Sequential.new
-      @current_page = nil
-
-      @running = true
-
-      @expire_after = 30*60
-      @max_lifetime = nil
-      @max_requests = nil
-
-      @last_access = @creation_time = Time.now 
-      @request_count = 0
-      
-      @serializer = serializer || MutexSerializer.new
-    end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Queries whether the session is still alive. -

-

[Source]

-
-
-# File lib/wee/session.rb, line 131
-    def alive?
-      now = Time.now
-      return false if not @running
-      return false if @expire_after and now - @last_access > @expire_after 
-      return false if @max_lifetime and now - @creation_time > @max_lifetime 
-      return false if @max_requests and @request_count >= @max_requests
-      return true
-    end
-
-
-
-
- -
- - - - -
-

-Handles a web request. -

-

[Source]

-
-
-# File lib/wee/session.rb, line 171
-    def call(env)
-      if env['wee.session']
-        # we are already serialized
-        raise if env['wee.session'] != self
-        begin
-          Thread.current[:wee_session] = self
-          @request_count += 1
-          @last_access = Time.now
-          awake
-          response = handle(env)
-          sleep
-          return response
-        ensure
-          Thread.current[:wee_session] = nil
-        end
-      else
-        env['wee.session'] = self
-        @serializer.call(env)
-      end
-    end
-
-
-
-
- -
- - - - -
-

-Queries whether the session is dead. -

-

[Source]

-
-
-# File lib/wee/session.rb, line 143
-    def dead?
-      not alive?
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/session.rb, line 257
-    def render_ajax_proc(block, component)
-      proc {
-        r = component.renderer_class.new
-        r.session   = self
-        r.request   = @request
-        r.response  = Wee::Response.new
-        r.document  = Wee::HtmlDocument.new
-        r.callbacks = @page.callbacks
-        r.current_component = component
-
-        begin
-          block.call(r)
-        ensure
-          r.close
-        end
-
-        r.response << r.document.to_s
-        send_response(r.response)
-      }
-    end
-
-
-
-
- -
- - - - -
-

-Send a premature response -

-

[Source]

-
-
-# File lib/wee/session.rb, line 195
-    def send_response(response)
-      raise AbortProcessing.new(response)
-    end
-
-
-
-
- -
- - - - -
-

-Returns some statistics -

-

[Source]

-
-
-# File lib/wee/session.rb, line 150
-    def statistics
-      now = Time.now
-      {
-        :last_access => @last_access,        # The time when this session was last accessed
-        :inactivity => now - @last_access,   # The number of seconds of inactivity
-        :creation_time => @creation_time,    # The time at which this session was created 
-        :lifetime =>  now - @creation_time,  # The lifetime of this session in seconds
-        :request_count => @request_count     # The number of requests served by this session
-      }
-    end
-
-
-
-
- -
- - - - -
-

-Terminates the session. -

-

-This will usually not immediatly terminate the session from running, but -further requests will not be answered. -

-

[Source]

-
-
-# File lib/wee/session.rb, line 124
-    def terminate
-      @running = false
-    end
-
-
-
-
- -

Protected Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/session.rb, line 300
-    def action(request, page)
-      @current_page = nil
-
-      begin
-        @page = page # CONTINUATIONS!
-        action_callback = page.callbacks.with_triggered(request.fields) do
-          @root_component.decoration.process_callbacks(page.callbacks)
-        end
-        action_callback.call if action_callback
-      rescue AbortProcessing => abort
-        page = @page # CONTINUATIONS!
-        if abort.response
-          #
-          # replace the state of the current page
-          #
-          @current_page = page
-          page.state = take_snapshot()
-          @page_cache[page.id] = page
-          return abort.response
-        else
-          # pass on - this is a premature response from Component#call
-        end
-      end
-      request = @request # CONTINUATIONS!
-
-      #
-      # create new page (state)
-      #
-      new_page = Page.new(@page_ids.next, take_snapshot(), nil) 
-      @page_cache[new_page.id] = new_page
-      @current_page = new_page
-
-      url = request.build_url(:page_id => new_page.id)
-      return Wee::RedirectResponse.new(url)
-    end
-
-
-
-
- -
- - - - -
-

-Is called before process_request is invoked. -

-

-Can be used e.g. to setup a database connection. -

-

[Source]

-
-
-# File lib/wee/session.rb, line 206
-    def awake
-    end
-
-
-
-
- -
- - - - -
-

-The main routine where the request is processed. -

-

[Source]

-
-
-# File lib/wee/session.rb, line 220
-    def handle(env)
-      request = Wee::Request.new(env)
-      @request = request # CONTINUATIONS!
-      page = @page_cache.fetch(request.page_id)
-
-      if page
-        if page != @current_page
-          @current_page = nil
-          page.state.restore
-          @current_page = page
-        end
-
-        if request.render?
-          return render(request, page).finish
-        else # request.action?
-          return action(request, page).finish
-        end
-      else
-        #
-        # either no or invalid page_id specified.  reset to initial state (or
-        # create initial state if no such exists yet)
-        #
-        @initial_state ||= take_snapshot() 
-        new_page = Page.new(@page_ids.next, @initial_state, nil) 
-        @page_cache[new_page.id] = new_page
-
-        url = request.build_url(:page_id => new_page.id)
-        if request.page_id
-          return Wee::RefreshResponse.new("Invalid or expired page", url).finish
-        else
-          return Wee::RedirectResponse.new(url).finish
-        end
-      end
-    ensure
-      @request = nil
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/session.rb, line 280
-    def render(request, page)
-      r = Wee::Renderer.new
-      r.session   = self
-      r.request   = request
-      r.response  = Wee::GenericResponse.new
-      r.document  = Wee::HtmlDocument.new
-      r.callbacks = Wee::Callbacks.new
-
-      begin
-        @root_component.decoration.render_on(r)
-        r.close
-        r.response << r.document.to_s
-      rescue AbortProcessing => abort
-        r.response = abort.response
-      end
-
-      page.callbacks = r.callbacks
-      return r.response
-    end
-
-
-
-
- -
- - - - -
-

-Is called after process_request is run. -

-

-Can be used e.g. to release a database connection. -

-

[Source]

-
-
-# File lib/wee/session.rb, line 214
-    def sleep
-    end
-
-
-
-
- -
- - - - -
-

-This method takes a snapshot from the current state of the root component and -returns it. -

-

[Source]

-
-
-# File lib/wee/session.rb, line 340
-    def take_snapshot
-      @root_component.decoration.state(s = Wee::State.new)
-      return s.freeze
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Session/AbortProcessing.html b/doc/rdoc/classes/Wee/Session/AbortProcessing.html deleted file mode 100644 index 36a5716..0000000 --- a/doc/rdoc/classes/Wee/Session/AbortProcessing.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - Class: Wee::Session::AbortProcessing - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Session::AbortProcessing
In: - - lib/wee/session.rb - -
-
Parent: - Exception -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - -
response [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/session.rb, line 57
-      def initialize(response)
-        @response = response
-      end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Session/MutexSerializer.html b/doc/rdoc/classes/Wee/Session/MutexSerializer.html deleted file mode 100644 index 46ac46e..0000000 --- a/doc/rdoc/classes/Wee/Session/MutexSerializer.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - Class: Wee::Session::MutexSerializer - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Session::MutexSerializer
In: - - lib/wee/session.rb - -
-
Parent: - Mutex -
-
- - -
- - - -
- -
-

-The default serializer, when no continuation are going to be used. Ensures -that only one request of the same session is executed at the same time. -

- -
- - -
- -
-

Methods

- -
- call   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/session.rb, line 16
-      def call(env)
-        synchronize { env['wee.session'].call(env) }
-      end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Session/Page.html b/doc/rdoc/classes/Wee/Session/Page.html deleted file mode 100644 index e5c7d6a..0000000 --- a/doc/rdoc/classes/Wee/Session/Page.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - Class: Wee::Session::Page - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Session::Page
In: - - lib/wee/session.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
callbacks [RW] 
id [RW] 
state [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/session.rb, line 50
-      def initialize(id=nil, state=nil, callbacks=nil)
-        @id, @state, @callbacks = id, state, callbacks
-      end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Session/ThreadSerializer.html b/doc/rdoc/classes/Wee/Session/ThreadSerializer.html deleted file mode 100644 index 3c4b9b7..0000000 --- a/doc/rdoc/classes/Wee/Session/ThreadSerializer.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - Class: Wee::Session::ThreadSerializer - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Session::ThreadSerializer
In: - - lib/wee/session.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-This serializer ensures that all requests of a session are executed within -the same thread. This is required if continuations are going to be used. -

-

-You can run multiple sessions within the same ThreadSerializer, or allocate one ThreadSerializer (and as such one Thread) -per session as you want. -

- -
- - -
- -
-

Methods

- -
- call   - new   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/session.rb, line 31
-      def initialize
-        @in, @out = Queue.new, Queue.new
-        @thread = Thread.new {
-          Thread.abort_on_exception = true
-          while true 
-            env = @in.pop
-            @out.push(env['wee.session'].call(env))
-          end
-        }
-      end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/session.rb, line 42
-      def call(env)
-        @in.push(env)
-        @out.pop
-      end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/State.html b/doc/rdoc/classes/Wee/State.html deleted file mode 100644 index 2e95c01..0000000 --- a/doc/rdoc/classes/Wee/State.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - Class: Wee::State - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::State
In: - - lib/wee/state.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- -
-

-This class is for backtracking the state of components (or -decorations/presenters). Components that want an undo-facility to be -implemented (triggered for example by a browsers back-button), have to -overwrite the Component#state method. -Class Wee::State simply represents a collection of -objects from which snapshots were taken via methods take_snapshot. -

- -
- - -
- -
-

Methods

- -
- <<   - add   - add_ivar   - new   - restore   -
-
- -
- - - - -
- -
-

Classes and Modules

- - Class Wee::State::Snapshot
-Class Wee::State::SnapshotIVars
- -
- - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 32
-    def initialize
-      @objects = Hash.new
-      @objects_ivars = Hash.new 
-    end
-
-
-
-
- -

Public Instance methods

- -
- - -
- <<(object) -
- -
-

-Alias for add -

-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 37
-    def add(object)
-      @objects[object.object_id] ||= Snapshot.new(object, object.take_snapshot)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 41
-    def add_ivar(object, ivar, value)
-      (@objects_ivars[object.object_id] ||= SnapshotIVars.new(object, {})).add(ivar, value)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 47
-    def restore
-      @objects.each_value {|s| s.object.restore_snapshot(s.snapshot) }
-      @objects_ivars.each_value {|s| s.restore }
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/State/Snapshot.html b/doc/rdoc/classes/Wee/State/Snapshot.html deleted file mode 100644 index 465324c..0000000 --- a/doc/rdoc/classes/Wee/State/Snapshot.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - Class: Wee::State::Snapshot - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::State::Snapshot
In: - - lib/wee/state.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
object [RW] 
snapshot [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 14
-      def initialize(object, snapshot)
-        @object, @snapshot = object, snapshot
-      end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/State/SnapshotIVars.html b/doc/rdoc/classes/Wee/State/SnapshotIVars.html deleted file mode 100644 index 45dda57..0000000 --- a/doc/rdoc/classes/Wee/State/SnapshotIVars.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - Class: Wee::State::SnapshotIVars - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::State::SnapshotIVars
In: - - lib/wee/state.rb - -
-
Parent: - - Object - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- add   - new   - restore   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
ivars [RW] 
object [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 21
-      def initialize(object, ivars)
-        @object, @ivars = object, ivars
-      end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 24
-      def add(ivar, value)
-        @ivars[ivar] = value
-      end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 27
-      def restore
-        @ivars.each_pair {|k,v| @object.instance_variable_set(k, v) }
-      end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/StructSnapshotMixin.html b/doc/rdoc/classes/Wee/StructSnapshotMixin.html deleted file mode 100644 index 8ba125a..0000000 --- a/doc/rdoc/classes/Wee/StructSnapshotMixin.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - Module: Wee::StructSnapshotMixin - - - - - - - - - - -
- - - - - - - - - - -
ModuleWee::StructSnapshotMixin
In: - - lib/wee/state.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 86
-    def restore_snapshot(snap)
-      snap.each_pair {|k,v| send(k.to_s + "=", v)} 
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/state.rb, line 80
-    def take_snapshot
-      snap = Hash.new
-      each_pair {|k,v| snap[k] = v}
-      snap
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/Task.html b/doc/rdoc/classes/Wee/Task.html deleted file mode 100644 index c4e501c..0000000 --- a/doc/rdoc/classes/Wee/Task.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - Class: Wee::Task - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::Task
In: - - lib/wee/task.rb - -
-
Parent: - - Component - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- go   - render   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-# File lib/wee/task.rb, line 7
-    def go
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/task.rb, line 10
-    def render(r)
-      r.session.send_response(RedirectResponse.new(r.url_for_callback(method(:go))))
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/classes/Wee/WrapperDecoration.html b/doc/rdoc/classes/Wee/WrapperDecoration.html deleted file mode 100644 index 645e55f..0000000 --- a/doc/rdoc/classes/Wee/WrapperDecoration.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - Class: Wee::WrapperDecoration - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassWee::WrapperDecoration
In: - - lib/wee/decoration.rb - -
-
Parent: - - Decoration - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- render   - render_inner   -
-
- -
- - - - -
- - - -
-

External Aliases

- -
- - - - - - -
render_presenter_on->render_on
-
-
- - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Overwrite this method, and call render_inner(r) where you want -the inner content to be drawn. -

-

[Source]

-
-
-# File lib/wee/decoration.rb, line 210
-    def render(r)
-      render_inner(r)
-    end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-# File lib/wee/decoration.rb, line 214
-    def render_inner(r)
-      r.render_decoration(@next)
-    end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/created.rid b/doc/rdoc/created.rid deleted file mode 100644 index c38f222..0000000 --- a/doc/rdoc/created.rid +++ /dev/null @@ -1 +0,0 @@ -Fri, 01 Jan 2010 15:06:17 +0100 diff --git a/doc/rdoc/files/README_rdoc.html b/doc/rdoc/files/README_rdoc.html deleted file mode 100644 index 90b7be0..0000000 --- a/doc/rdoc/files/README_rdoc.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - File: README.rdoc - - - - - - - - - - -
-

README.rdoc

- - - - - - - - - -
Path:README.rdoc -
Last Update:Fri Jan 01 15:06:06 +0100 2010
-
- - -
- - - -
- -
-

Wee Web Framework

-

Copyright and License

-

-Copyright (c) 2004, 2005, 2009, 2010 by Michael Neumann -(mneumann@ntecs.de). -

-

-Released under the same terms of license as Ruby. -

-

Introduction

-

-Wee is a light-weight, very high-level -and modern web-framework that makes Web engineering -easy. It mainly inherits many ideas and features from Seaside, but was written from scratch without -ever looking at the Seaside (or any other) sources. All code was developed -from ideas and lots of discussions with Avi Bryant. -

-

Features

-

Reusable components

-

-Wee has real components, which -are like widgets in a GUI. Once written, you can use them everywhere. They -are completely independent and do not interfere with other components. -Components encapsulate state, a view and actions. Of course you can use an -external model or use templates for rendering. -

-

Backtracking

-

-See the What is backtracking? section below. In short, -backtracking lets the browser‘s back and forward-button play well -together with your application. -

-

Clean and concise

-

-Wee is well thought out, is written in -and supports clean and concise code. Furthermore I think most parts -are now very well documented. -

-

Templating-independent

-

-Wee does not depend on a special -templating-engine. You can use a different templating engine for each -component if you want. -

-

Powerful programmatic HTML generation

-

-Wee ships with an easy to use and very -powerful programmatic HTML-generation library. For example you can create a -select list easily with this piece of code: -

-
-   # select an object from these items
-   items = [1, 2, 3, 4]
-
-   # the labels shown to the user
-   labels = items.map {|i| i.to_s}
-
-   # render it
-   r.select_list(items).labels(labels).callback {|choosen| p choosen}
-
-   # render a multi-select list, with objects 2 and 4 selected
-   r.select_list(items).multi.labels(labels).selected([2,4])
-
-

-The callback is called with the selected objects from the items -array. Items can be any object, even whole components: -

-
-   labels = ["msg1", "msg2"]
-   items = labels.collect {|m| MessageBox.new(m)}
-   r.select_list(items).labels(labels).callback {|choosen| call choosen.first}
-
-

Observations and Limitations

-
    -
  • Components are thread-safe by nature as a fresh components-tree is created -for each session and requests inside a session are serialized. - -
  • -
-

What is backtracking?

-

-If you want, you can make the back-button of your browser work correctly -together with your web-application. Imagine you have a simple counter -application, which shows the current count and two links inc and -dec with which you can increase or decrease the current count. -Starting with an inital count of 0 you increase the counter up to 8, then -click three times the back button of your browser (now displays 5). Finally -you decrease by one and your counter shows what you‘d have expected: -4. In contrast, traditional web applications would have shown 7, because -the back button usually does not trigger a HTTP request and as such the -server-side state still has a value of 8 for the counter when the request -to decrease comes in. -

-

-The solution to this problem is to take snapshots of the components state -after an action is performed and restoring the state before peforming -actions. Each action generates a new state, which is indicated by a -so-called page-id within the URL. -

-

Decorations

-

-Decorations are used to modify the look and behaviour of a component -without modifying the components tree itself. A component can have more -than one decoration. Decorations are implemented as a linked list -(Wee::Decoration#next points to the next decoration), starting at -Wee::Component#decoration, which either points to the next decoration in -the chain, or to itself. -

-

The request/response cycle

-

-The request/response cycle in Wee is -actually split into two separate phases. -

-

Render Phase

-

-The rendering phase is assumed to be side-effect free! So, you as a -programmer should take care to meet this assumption. Rendering is performed -by method Wee::Component#render_on. -

-

Action Phase (Invoking Callbacks)

-

-Possible sources for callbacks are links (anchors) and all kinds of -form-elements like submit buttons, input-fields etc. There are two -different kinds of callbacks: -

-
    -
  • Input callbacks (input-fields) - -
  • -
  • Action callbacks (anchor, submit-button) - -
  • -
-

-The distinction between input and action callbacks is important, as action -callbacks might depend on values of input-fields being assigned to instance -variables of the controlling component. Hence, Wee first invokes all input callbacks before -any action callback is triggered. Callback processing is performed by -method Wee::Component#process_callbacks. -

-

-The result of the action phase is an updated components state. As such, a -snapshot is taken of the new state and stored under a new page-id. Then, a -redirect requests is sent back to the client, including this new page-id. -The client automatically follows this redirect and triggers a render phase -of the new page. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/application_rb.html b/doc/rdoc/files/lib/wee/application_rb.html deleted file mode 100644 index 506a2b7..0000000 --- a/doc/rdoc/files/lib/wee/application_rb.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - File: application.rb - - - - - - - - - - -
-

application.rb

- - - - - - - - - -
Path:lib/wee/application.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- thread   - wee/id_generator   - wee/lru_cache   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/call_answer_rb.html b/doc/rdoc/files/lib/wee/call_answer_rb.html deleted file mode 100644 index f37d299..0000000 --- a/doc/rdoc/files/lib/wee/call_answer_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: call_answer.rb - - - - - - - - - - -
-

call_answer.rb

- - - - - - - - - -
Path:lib/wee/call_answer.rb -
Last Update:Thu Dec 17 15:09:56 +0100 2009
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/callback_rb.html b/doc/rdoc/files/lib/wee/callback_rb.html deleted file mode 100644 index 797b06d..0000000 --- a/doc/rdoc/files/lib/wee/callback_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: callback.rb - - - - - - - - - - -
-

callback.rb

- - - - - - - - - -
Path:lib/wee/callback.rb -
Last Update:Thu Dec 17 14:46:27 +0100 2009
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/component_rb.html b/doc/rdoc/files/lib/wee/component_rb.html deleted file mode 100644 index bf80029..0000000 --- a/doc/rdoc/files/lib/wee/component_rb.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - File: component.rb - - - - - - - - - - -
-

component.rb

- - - - - - - - - -
Path:lib/wee/component.rb -
Last Update:Wed Dec 30 12:28:24 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- wee/presenter   - wee/decoration   - wee/call_answer   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/conversation_rb.html b/doc/rdoc/files/lib/wee/conversation_rb.html deleted file mode 100644 index b5a34cd..0000000 --- a/doc/rdoc/files/lib/wee/conversation_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: conversation.rb - - - - - - - - - - -
-

conversation.rb

- - - - - - - - - -
Path:lib/wee/conversation.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- wee/component   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/decoration_rb.html b/doc/rdoc/files/lib/wee/decoration_rb.html deleted file mode 100644 index 9e30ef8..0000000 --- a/doc/rdoc/files/lib/wee/decoration_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: decoration.rb - - - - - - - - - - -
-

decoration.rb

- - - - - - - - - -
Path:lib/wee/decoration.rb -
Last Update:Thu Dec 17 14:56:49 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- wee/presenter   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/html_brushes_rb.html b/doc/rdoc/files/lib/wee/html_brushes_rb.html deleted file mode 100644 index 3f873ed..0000000 --- a/doc/rdoc/files/lib/wee/html_brushes_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: html_brushes.rb - - - - - - - - - - -
-

html_brushes.rb

- - - - - - - - - -
Path:lib/wee/html_brushes.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/html_canvas_rb.html b/doc/rdoc/files/lib/wee/html_canvas_rb.html deleted file mode 100644 index 385f204..0000000 --- a/doc/rdoc/files/lib/wee/html_canvas_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: html_canvas.rb - - - - - - - - - - -
-

html_canvas.rb

- - - - - - - - - -
Path:lib/wee/html_canvas.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- wee/renderer   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/html_document_rb.html b/doc/rdoc/files/lib/wee/html_document_rb.html deleted file mode 100644 index 7f6d7cc..0000000 --- a/doc/rdoc/files/lib/wee/html_document_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: html_document.rb - - - - - - - - - - -
-

html_document.rb

- - - - - - - - - -
Path:lib/wee/html_document.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- wee/html_writer   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/html_writer_rb.html b/doc/rdoc/files/lib/wee/html_writer_rb.html deleted file mode 100644 index 25c9863..0000000 --- a/doc/rdoc/files/lib/wee/html_writer_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: html_writer.rb - - - - - - - - - - -
-

html_writer.rb

- - - - - - - - - -
Path:lib/wee/html_writer.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- rack   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/id_generator_rb.html b/doc/rdoc/files/lib/wee/id_generator_rb.html deleted file mode 100644 index 36626cf..0000000 --- a/doc/rdoc/files/lib/wee/id_generator_rb.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - File: id_generator.rb - - - - - - - - - - -
-

id_generator.rb

- - - - - - - - - -
Path:lib/wee/id_generator.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- digest/md5   - securerandom   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/jquery/jquery_rb.html b/doc/rdoc/files/lib/wee/jquery/jquery_rb.html deleted file mode 100644 index 8caec89..0000000 --- a/doc/rdoc/files/lib/wee/jquery/jquery_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: jquery.rb - - - - - - - - - - -
-

jquery.rb

- - - - - - - - - -
Path:lib/wee/jquery/jquery.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/jquery_rb.html b/doc/rdoc/files/lib/wee/jquery_rb.html deleted file mode 100644 index 6a139a6..0000000 --- a/doc/rdoc/files/lib/wee/jquery_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: jquery.rb - - - - - - - - - - -
-

jquery.rb

- - - - - - - - - -
Path:lib/wee/jquery.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- wee/jquery/jquery   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/lru_cache_rb.html b/doc/rdoc/files/lib/wee/lru_cache_rb.html deleted file mode 100644 index 4192e06..0000000 --- a/doc/rdoc/files/lib/wee/lru_cache_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: lru_cache.rb - - - - - - - - - - -
-

lru_cache.rb

- - - - - - - - - -
Path:lib/wee/lru_cache.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/presenter_rb.html b/doc/rdoc/files/lib/wee/presenter_rb.html deleted file mode 100644 index 6a5112c..0000000 --- a/doc/rdoc/files/lib/wee/presenter_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: presenter.rb - - - - - - - - - - -
-

presenter.rb

- - - - - - - - - -
Path:lib/wee/presenter.rb -
Last Update:Thu Dec 17 14:57:10 +0100 2009
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/renderer_rb.html b/doc/rdoc/files/lib/wee/renderer_rb.html deleted file mode 100644 index 5c0af99..0000000 --- a/doc/rdoc/files/lib/wee/renderer_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: renderer.rb - - - - - - - - - - -
-

renderer.rb

- - - - - - - - - -
Path:lib/wee/renderer.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/request_rb.html b/doc/rdoc/files/lib/wee/request_rb.html deleted file mode 100644 index 7052b5d..0000000 --- a/doc/rdoc/files/lib/wee/request_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: request.rb - - - - - - - - - - -
-

request.rb

- - - - - - - - - -
Path:lib/wee/request.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- rack   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/response_rb.html b/doc/rdoc/files/lib/wee/response_rb.html deleted file mode 100644 index b92ae06..0000000 --- a/doc/rdoc/files/lib/wee/response_rb.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - File: response.rb - - - - - - - - - - -
-

response.rb

- - - - - - - - - -
Path:lib/wee/response.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- time   - rack   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/session_rb.html b/doc/rdoc/files/lib/wee/session_rb.html deleted file mode 100644 index bc478cf..0000000 --- a/doc/rdoc/files/lib/wee/session_rb.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - File: session.rb - - - - - - - - - - -
-

session.rb

- - - - - - - - - -
Path:lib/wee/session.rb -
Last Update:Thu Dec 17 15:24:21 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- thread   - wee/lru_cache   - wee/id_generator   - wee/renderer   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/state_rb.html b/doc/rdoc/files/lib/wee/state_rb.html deleted file mode 100644 index ced7962..0000000 --- a/doc/rdoc/files/lib/wee/state_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: state.rb - - - - - - - - - - -
-

state.rb

- - - - - - - - - -
Path:lib/wee/state.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee/task_rb.html b/doc/rdoc/files/lib/wee/task_rb.html deleted file mode 100644 index 3df7618..0000000 --- a/doc/rdoc/files/lib/wee/task_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: task.rb - - - - - - - - - - -
-

task.rb

- - - - - - - - - -
Path:lib/wee/task.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- wee/component   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/files/lib/wee_rb.html b/doc/rdoc/files/lib/wee_rb.html deleted file mode 100644 index 8c58a86..0000000 --- a/doc/rdoc/files/lib/wee_rb.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - File: wee.rb - - - - - - - - - - -
-

wee.rb

- - - - - - - - - -
Path:lib/wee.rb -
Last Update:Sun Dec 06 09:13:46 +0100 2009
-
- - -
- - - -
- - -
-

Required files

- -
- rack   - wee/state   - wee/callback   - wee/presenter   - wee/decoration   - wee/component   - wee/task   - wee/application   - wee/request   - wee/response   - wee/session   - wee/html_document   - wee/html_brushes   - wee/html_canvas   - continuation   - rack/handler/webrick   -
-
- -
- - -
- - - - -
- - -
-

Constants

- -
- - - - - - -
DefaultRenderer=Wee::HtmlCanvas
-
-
- - - - - - - - - -
- - -
-

[Validate]

-
- - - \ No newline at end of file diff --git a/doc/rdoc/fr_class_index.html b/doc/rdoc/fr_class_index.html deleted file mode 100644 index 86e6e2a..0000000 --- a/doc/rdoc/fr_class_index.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - Classes - - - - - -
-

Classes

-
- Array
- Hash
- Object
- String
- Struct
- Wee
- Wee::AnswerDecoration
- Wee::AnswerDecoration::Answer
- Wee::AnswerDecoration::Interceptor
- Wee::Application
- Wee::Application::SessionCache
- Wee::BlockComponent
- Wee::Brush
- Wee::Brush::ActionInputTag
- Wee::Brush::AnchorTag
- Wee::Brush::CheckboxTag
- Wee::Brush::FileUploadTag
- Wee::Brush::FormTag
- Wee::Brush::GenericEncodedTextBrush
- Wee::Brush::GenericSingleTagBrush
- Wee::Brush::GenericTagBrush
- Wee::Brush::GenericTextBrush
- Wee::Brush::HiddenInputTag
- Wee::Brush::ImageButtonTag
- Wee::Brush::ImageTag
- Wee::Brush::InputTag
- Wee::Brush::JavascriptTag
- Wee::Brush::LinkTag
- Wee::Brush::Page
- Wee::Brush::PasswordInputTag
- Wee::Brush::RadioButtonTag
- Wee::Brush::RadioGroup
- Wee::Brush::SelectListTag
- Wee::Brush::SelectOptionTag
- Wee::Brush::SubmitButtonTag
- Wee::Brush::TableDataTag
- Wee::Brush::TableHeaderTag
- Wee::Brush::TableRowTag
- Wee::Brush::TableTag
- Wee::Brush::TextAreaTag
- Wee::Brush::TextInputTag
- Wee::CallAnswerMixin
- Wee::CallbackMixin
- Wee::CallbackRegistry
- Wee::Callbacks
- Wee::Component
- Wee::Decoration
- Wee::DecorationMixin
- Wee::Delegate
- Wee::DupReplaceSnapshotMixin
- Wee::ErrorResponse
- Wee::FormDecoration
- Wee::GenericResponse
- Wee::HtmlCanvas
- Wee::HtmlDocument
- Wee::HtmlWriter
- Wee::IdGenerator
- Wee::IdGenerator::Secure
- Wee::IdGenerator::Sequential
- Wee::JQuery
- Wee::LRUCache
- Wee::LRUCache::Item
- Wee::ObjectSnapshotMixin
- Wee::OidDecoration
- Wee::PageDecoration
- Wee::Presenter
- Wee::RedirectResponse
- Wee::RefreshResponse
- Wee::Renderer
- Wee::Request
- Wee::Response
- Wee::Session
- Wee::Session::AbortProcessing
- Wee::Session::MutexSerializer
- Wee::Session::Page
- Wee::Session::ThreadSerializer
- Wee::State
- Wee::State::Snapshot
- Wee::State::SnapshotIVars
- Wee::StructSnapshotMixin
- Wee::Task
- Wee::WrapperDecoration
-
-
- - \ No newline at end of file diff --git a/doc/rdoc/fr_file_index.html b/doc/rdoc/fr_file_index.html deleted file mode 100644 index f8b3d9f..0000000 --- a/doc/rdoc/fr_file_index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - Files - - - - - -
-

Files

-
- README.rdoc
- lib/wee.rb
- lib/wee/application.rb
- lib/wee/call_answer.rb
- lib/wee/callback.rb
- lib/wee/component.rb
- lib/wee/conversation.rb
- lib/wee/decoration.rb
- lib/wee/html_brushes.rb
- lib/wee/html_canvas.rb
- lib/wee/html_document.rb
- lib/wee/html_writer.rb
- lib/wee/id_generator.rb
- lib/wee/jquery.rb
- lib/wee/jquery/jquery.rb
- lib/wee/lru_cache.rb
- lib/wee/presenter.rb
- lib/wee/renderer.rb
- lib/wee/request.rb
- lib/wee/response.rb
- lib/wee/session.rb
- lib/wee/state.rb
- lib/wee/task.rb
-
-
- - \ No newline at end of file diff --git a/doc/rdoc/fr_method_index.html b/doc/rdoc/fr_method_index.html deleted file mode 100644 index cb21f23..0000000 --- a/doc/rdoc/fr_method_index.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - Methods - - - - - -
-

Methods

-
- << (Wee::HtmlCanvas)
- << (Wee::State)
- << (Wee::HtmlWriter)
- <=> (Wee::LRUCache::Item)
- [] (Wee::LRUCache)
- []= (Wee::LRUCache)
- __callback (Wee::Brush::InputTag)
- __callback (Wee::Brush::SelectListTag)
- __callback (Wee::Brush::AnchorTag)
- __callback (Wee::Brush::ActionInputTag)
- __callback (Wee::Brush::TextAreaTag)
- __callback (Wee::Brush::CheckboxTag)
- __callback (Wee::Brush::FormTag)
- __callback (Wee::Brush::RadioButtonTag)
- action (Wee::Session)
- action? (Wee::Request)
- add (Wee::State)
- add (Wee::State::SnapshotIVars)
- add_callback (Wee::Brush::RadioGroup)
- add_decoration (Wee::DecorationMixin)
- add_ivar (Wee::State)
- alive? (Wee::Session)
- answer (Wee::CallAnswerMixin)
- awake (Wee::Session)
- brush_tag (Wee::HtmlCanvas)
- build_url (Wee::HtmlCanvas)
- build_url (Wee::Request)
- call (Wee::AnswerDecoration::Interceptor)
- call (Wee::CallbackMixin)
- call (Wee::Brush::RadioGroup)
- call (Wee::Session)
- call (Wee::CallAnswerMixin)
- call (Wee::Session::MutexSerializer)
- call (Wee::Session::ThreadSerializer)
- call (Wee::Application)
- callback (Wee::CallbackMixin)
- callback_method (Wee::CallbackMixin)
- callback_on (Wee::Brush::GenericTagBrush)
- callcc (Wee::CallAnswerMixin)
- children (Wee::Component)
- choose_from (Wee::Component)
- cleanup_sessions (Wee::Application)
- close (Wee::HtmlCanvas)
- close (Wee::Brush)
- close (Wee::Renderer)
- columns (Wee::Brush::TableRowTag)
- confirm (Wee::Component)
- css (Wee::HtmlCanvas)
- current (Wee::Session)
- dead? (Wee::Session)
- decoration (Wee::DecorationMixin)
- decoration= (Wee::DecorationMixin)
- delete (Wee::LRUCache)
- delete_if (Wee::LRUCache)
- display (Wee::Component)
- divert (Wee::HtmlCanvas)
- divert (Wee::HtmlDocument)
- each (Wee::LRUCache)
- each_decoration (Wee::DecorationMixin)
- each_triggered (Wee::CallbackRegistry)
- each_triggered_call_with_value (Wee::CallbackRegistry)
- encode_text (Wee::HtmlWriter)
- encode_text (Wee::HtmlCanvas)
- enctype_multipart (Wee::Brush::FormTag)
- end_tag (Wee::HtmlWriter)
- fetch (Wee::LRUCache)
- first_triggered (Wee::CallbackRegistry)
- for (Wee::Application)
- garbage_collect (Wee::LRUCache)
- garbage_collect (Wee::Application::SessionCache)
- generic_single_tag (Wee::HtmlCanvas)
- generic_tag (Wee::HtmlCanvas)
- get_oid (Wee::Brush::GenericTagBrush)
- global? (Wee::Decoration)
- global? (Wee::PageDecoration)
- global? (Wee::FormDecoration)
- go (Wee::Task)
- group (Wee::Brush::RadioButtonTag)
- handle (Wee::Session)
- handle (Wee::HtmlCanvas)
- handle2 (Wee::HtmlCanvas)
- handle3 (Wee::HtmlCanvas)
- handler (Wee::Brush::SelectListTag)
- has_key? (Wee::LRUCache)
- head (Wee::Brush::Page)
- headings (Wee::Brush::TableRowTag)
- html_attr (Wee::Brush::GenericTagBrush)
- info (Wee::Brush::AnchorTag)
- inform (Wee::Component)
- insert_session (Wee::Application)
- install (Wee::JQuery)
- instanciate (Wee::Component)
- items (Wee::Brush::SelectListTag)
- javascript_includes (Wee::JQuery)
- javascript_on (Wee::Brush::GenericTagBrush)
- labels (Wee::Brush::SelectListTag)
- link_css (Wee::HtmlCanvas)
- min_key (Wee::LRUCache)
- multiline_text (Wee::HtmlCanvas)
- nest (Wee::HtmlCanvas)
- nesting? (Wee::Brush::GenericTextBrush)
- nesting? (Wee::Brush)
- nesting? (Wee::Brush::GenericSingleTagBrush)
- new (Wee::Brush::FileUploadTag)
- new (Wee::IdGenerator::Sequential)
- new (Wee::Brush::RadioGroup)
- new (Wee::Renderer)
- new (Wee::RedirectResponse)
- new (Wee::HtmlDocument)
- new (Wee::Brush::RadioButtonTag)
- new (Wee::IdGenerator::Secure)
- new (Wee::Callbacks)
- new (Wee::State)
- new (Wee::CallbackRegistry)
- new (Wee::State::Snapshot)
- new (Wee::Application)
- new (Wee::State::SnapshotIVars)
- new (Wee::Brush::TextInputTag)
- new (Wee::Request)
- new (Wee::Request)
- new (Wee::Brush::HiddenInputTag)
- new (Wee::AnswerDecoration)
- new (Wee::Brush::TableRowTag)
- new (Wee::AnswerDecoration::Answer)
- new (Wee::AnswerDecoration::Interceptor)
- new (Wee::Session)
- new (Wee::RefreshResponse)
- new (Wee::Brush::TableDataTag)
- new (Wee::Brush::ImageButtonTag)
- new (Wee::Delegate)
- new (Wee::Brush::JavascriptTag)
- new (Wee::Brush::InputTag)
- new (Wee::Brush::SelectOptionTag)
- new (Wee::Brush::TableHeaderTag)
- new (Wee::HtmlCanvas)
- new (Wee::Session::ThreadSerializer)
- new (Wee::Brush::LinkTag)
- new (Wee::Brush::SelectListTag)
- new (Wee::LRUCache::Item)
- new (Wee::Brush::AnchorTag)
- new (Wee::Brush::CheckboxTag)
- new (Wee::Session::AbortProcessing)
- new (Wee::LRUCache)
- new (Wee::GenericResponse)
- new (Wee::Brush::TextAreaTag)
- new (Wee::Brush::GenericTagBrush)
- new (Wee::ErrorResponse)
- new (Wee::PageDecoration)
- new (Wee::Brush::PasswordInputTag)
- new (Wee::Component)
- new (Wee::Brush::FormTag)
- new (Wee::Brush::TableTag)
- new (Wee::BlockComponent)
- new (Wee::Brush::ImageTag)
- new (Wee::HtmlWriter)
- new (Wee::Brush::SubmitButtonTag)
- new (Wee::Session::Page)
- new_radio_group (Wee::HtmlCanvas)
- new_session (Wee::Application)
- next (Wee::IdGenerator::Secure)
- next (Wee::IdGenerator)
- next (Wee::IdGenerator::Sequential)
- next_md5 (Wee::IdGenerator::Secure)
- next_secure (Wee::IdGenerator::Secure)
- oid (Wee::Brush::GenericTagBrush)
- once (Wee::HtmlCanvas)
- onclick_callback (Wee::Brush::GenericTagBrush)
- onclick_javascript (Wee::Brush::GenericTagBrush)
- ondblclick_callback (Wee::Brush::GenericTagBrush)
- prepare_triggered (Wee::CallbackRegistry)
- process_callbacks (Wee::Presenter)
- process_callbacks (Wee::AnswerDecoration)
- process_callbacks (Wee::Decoration)
- process_callbacks (Wee::Component)
- process_callbacks (Wee::Delegate)
- register (Wee::CallbackRegistry)
- register_callback (Wee::HtmlCanvas)
- remove_decoration (Wee::DecorationMixin)
- remove_decoration_if (Wee::DecorationMixin)
- render (Wee::FormDecoration)
- render (Wee::Session)
- render (Wee::Component)
- render (Wee::PageDecoration)
- render (Wee::Renderer)
- render (Wee::Presenter)
- render (Wee::Task)
- render (Wee::BlockComponent)
- render (Wee::WrapperDecoration)
- render (Wee::OidDecoration)
- render? (Wee::Request)
- render_ajax_proc (Wee::Session)
- render_decoration (Wee::Renderer)
- render_inner (Wee::WrapperDecoration)
- render_on (Wee::Decoration)
- render_on (Wee::Presenter)
- render_on (Wee::Delegate)
- renderer_class (Wee::Presenter)
- reset_triggered (Wee::CallbackRegistry)
- restore (Wee::State::SnapshotIVars)
- restore (Wee::State)
- restore_snapshot (Wee::StructSnapshotMixin)
- restore_snapshot (Wee::DupReplaceSnapshotMixin)
- restore_snapshot (Wee::ObjectSnapshotMixin)
- root? (Wee::Component)
- run (Wee)
- runcc (Wee)
- select_list (Wee::HtmlCanvas)
- selected (Wee::Brush::SelectListTag)
- send_response (Wee::Session)
- session (Wee::Presenter)
- set (Wee::HtmlDocument)
- set_brush (Wee::HtmlCanvas)
- setup (Wee::Brush)
- single_tag (Wee::HtmlWriter)
- sleep (Wee::Session)
- space (Wee::HtmlCanvas)
- spacer (Wee::Brush::TableRowTag)
- spanning_column (Wee::Brush::TableRowTag)
- start_tag (Wee::HtmlWriter)
- state (Wee::Presenter)
- state (Wee::Component)
- state (Wee::Decoration)
- state (Wee::Delegate)
- state_decoration (Wee::Component)
- statistics (Wee::Session)
- store (Wee::LRUCache)
- take_snapshot (Wee::DupReplaceSnapshotMixin)
- take_snapshot (Wee::Session)
- take_snapshot (Wee::StructSnapshotMixin)
- take_snapshot (Wee::ObjectSnapshotMixin)
- terminate (Wee::Session)
- text (Wee::HtmlWriter)
- text (Wee::HtmlCanvas)
- title (Wee::Brush::Page)
- to_s (Wee::HtmlDocument)
- unregister (Wee::CallbackRegistry)
- unregister (Wee::Callbacks)
- update_component_on (Wee::Brush::GenericTagBrush)
- update_on (Wee::Brush::GenericTagBrush)
- url_for_callback (Wee::HtmlCanvas)
- url_for_callback_id (Wee::HtmlCanvas)
- value (Wee::Brush::TextAreaTag)
- with (Wee::Brush)
- with (Wee::Brush::GenericTextBrush)
- with (Wee::Brush::GenericTagBrush)
- with (Wee::Brush::TextAreaTag)
- with (Wee::Brush::FormTag)
- with (Wee::Brush::SelectListTag)
- with (Wee::Brush::GenericEncodedTextBrush)
- with (Wee::Brush::RadioButtonTag)
- with (Wee::Renderer)
- with (Wee::Brush::CheckboxTag)
- with (Wee::Brush::GenericSingleTagBrush)
- with (Wee::Brush::Page)
- with_triggered (Wee::Callbacks)
- write (Wee::HtmlWriter)
-
-
- - \ No newline at end of file diff --git a/doc/rdoc/index.html b/doc/rdoc/index.html deleted file mode 100644 index d779f41..0000000 --- a/doc/rdoc/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - RDoc Documentation - - - - - - - - - - - \ No newline at end of file diff --git a/doc/rdoc/rdoc-style.css b/doc/rdoc/rdoc-style.css deleted file mode 100644 index 44c7b3d..0000000 --- a/doc/rdoc/rdoc-style.css +++ /dev/null @@ -1,208 +0,0 @@ - -body { - font-family: Verdana,Arial,Helvetica,sans-serif; - font-size: 90%; - margin: 0; - margin-left: 40px; - padding: 0; - background: white; -} - -h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; } -h1 { font-size: 150%; } -h2,h3,h4 { margin-top: 1em; } - -a { background: #eef; color: #039; text-decoration: none; } -a:hover { background: #039; color: #eef; } - -/* Override the base stylesheet's Anchor inside a table cell */ -td > a { - background: transparent; - color: #039; - text-decoration: none; -} - -/* and inside a section title */ -.section-title > a { - background: transparent; - color: #eee; - text-decoration: none; -} - -/* === Structural elements =================================== */ - -div#index { - margin: 0; - margin-left: -40px; - padding: 0; - font-size: 90%; -} - - -div#index a { - margin-left: 0.7em; -} - -div#index .section-bar { - margin-left: 0px; - padding-left: 0.7em; - background: #ccc; - font-size: small; -} - - -div#classHeader, div#fileHeader { - width: auto; - color: white; - padding: 0.5em 1.5em 0.5em 1.5em; - margin: 0; - margin-left: -40px; - border-bottom: 3px solid #006; -} - -div#classHeader a, div#fileHeader a { - background: inherit; - color: white; -} - -div#classHeader td, div#fileHeader td { - background: inherit; - color: white; -} - - -div#fileHeader { - background: #057; -} - -div#classHeader { - background: #048; -} - - -.class-name-in-header { - font-size: 180%; - font-weight: bold; -} - - -div#bodyContent { - padding: 0 1.5em 0 1.5em; -} - -div#description { - padding: 0.5em 1.5em; - background: #efefef; - border: 1px dotted #999; -} - -div#description h1,h2,h3,h4,h5,h6 { - color: #125;; - background: transparent; -} - -div#validator-badges { - text-align: center; -} -div#validator-badges img { border: 0; } - -div#copyright { - color: #333; - background: #efefef; - font: 0.75em sans-serif; - margin-top: 5em; - margin-bottom: 0; - padding: 0.5em 2em; -} - - -/* === Classes =================================== */ - -table.header-table { - color: white; - font-size: small; -} - -.type-note { - font-size: small; - color: #DEDEDE; -} - -.xxsection-bar { - background: #eee; - color: #333; - padding: 3px; -} - -.section-bar { - color: #333; - border-bottom: 1px solid #999; - margin-left: -20px; -} - - -.section-title { - background: #79a; - color: #eee; - padding: 3px; - margin-top: 2em; - margin-left: -30px; - border: 1px solid #999; -} - -.top-aligned-row { vertical-align: top } -.bottom-aligned-row { vertical-align: bottom } - -/* --- Context section classes ----------------------- */ - -.context-row { } -.context-item-name { font-family: monospace; font-weight: bold; color: black; } -.context-item-value { font-size: small; color: #448; } -.context-item-desc { color: #333; padding-left: 2em; } - -/* --- Method classes -------------------------- */ -.method-detail { - background: #efefef; - padding: 0; - margin-top: 0.5em; - margin-bottom: 1em; - border: 1px dotted #ccc; -} -.method-heading { - color: black; - background: #ccc; - border-bottom: 1px solid #666; - padding: 0.2em 0.5em 0 0.5em; -} -.method-signature { color: black; background: inherit; } -.method-name { font-weight: bold; } -.method-args { font-style: italic; } -.method-description { padding: 0 0.5em 0 0.5em; } - -/* --- Source code sections -------------------- */ - -a.source-toggle { font-size: 90%; } -div.method-source-code { - background: #262626; - color: #ffdead; - margin: 1em; - padding: 0.5em; - border: 1px dashed #999; - overflow: hidden; -} - -div.method-source-code pre { color: #ffdead; overflow: hidden; } - -/* --- Ruby keyword styles --------------------- */ - -.standalone-code { background: #221111; color: #ffdead; overflow: hidden; } - -.ruby-constant { color: #7fffd4; background: transparent; } -.ruby-keyword { color: #00ffff; background: transparent; } -.ruby-ivar { color: #eedd82; background: transparent; } -.ruby-operator { color: #00ffee; background: transparent; } -.ruby-identifier { color: #ffdead; background: transparent; } -.ruby-node { color: #ffa07a; background: transparent; } -.ruby-comment { color: #b22222; font-weight: bold; background: transparent; } -.ruby-regexp { color: #ffa07a; background: transparent; } -.ruby-value { color: #7fffd4; background: transparent; } \ No newline at end of file diff --git a/examples/demo.rb b/examples/demo.rb index 6d956ab..c780efb 100644 --- a/examples/demo.rb +++ b/examples/demo.rb @@ -1,8 +1,10 @@ +puts File.open(__FILE__).path + $LOAD_PATH.unshift "../lib" require 'rubygems' require 'wee' -$LOAD_PATH.unshift "./demo" +$LOAD_PATH.unshift "./examples/demo" require 'demo/calculator' require 'demo/counter' require 'demo/calendar' diff --git a/lib/wee.rb b/lib/wee.rb index 5bc7a88..fd092c7 100644 --- a/lib/wee.rb +++ b/lib/wee.rb @@ -1,5 +1,5 @@ module Wee - Version = "2.2.0" + Version = "2.2.1" end require 'rack' @@ -47,14 +47,15 @@ def Wee.run(component_class=nil, params=nil, &block) params[:use_continuations] ||= false params[:print_message] ||= false params[:autoreload] ||= false + params[:server] ||= "WEBrick" if component_class <= Wee::RootComponent - component_class.external_resources.each do |ext_res| + component_class.external_resources.each do |ext_res| params[:additional_builder_procs] << proc {|builder| ext_res.install(builder)} end end - raise ArgumentError if params[:use_continuations] and block + raise ArgumentError if params[:use_continuations] and block unless block block ||= if params[:use_continuations] @@ -75,7 +76,7 @@ def Wee.run(component_class=nil, params=nil, &block) else timer = 0 end - use Rack::Reloader, timer + use Rack::Reloader, timer end if params[:public_path] @@ -94,8 +95,10 @@ def Wee.run(component_class=nil, params=nil, &block) io.puts "Open your browser at: #{url}" io.puts end + server = eval ("Rack::Handler::#{params[:server]}") + server.run(app, :Port => params[:port]) - Rack::Handler::WEBrick.run(app, :Port => params[:port]) +# Rack::Handler::WEBrick.run(app, :Port => params[:port]) end # @@ -106,3 +109,5 @@ def Wee.runcc(component_class, params=nil) params[:use_continuations] = true Wee.run(component_class, params) end + + diff --git a/lib/wee/application.rb b/lib/wee/application.rb index 9300b4a..2481133 100644 --- a/lib/wee/application.rb +++ b/lib/wee/application.rb @@ -16,7 +16,7 @@ def self.for(component_class, session_class=Wee::Session, *component_args) class SessionCache < Wee::LRUCache def garbage_collect - delete_if {|id, session| session.dead? } + delete_if {|id, session| session.dead?} end end @@ -26,7 +26,7 @@ def garbage_collect # # Wee::Application.new { Wee::Session.new(root_component) } # - def initialize(max_sessions=10_000, &block) + def initialize(max_sessions=10_000, &block)#max sessions??? @session_factory = block || raise(ArgumentError) @session_ids ||= Wee::IdGenerator::Secure.new @sessions = SessionCache.new(max_sessions) @@ -45,11 +45,11 @@ def cleanup_sessions # def call(env) request = Wee::Request.new(env) - + puts "call #{Time.now}" if request.session_id session = @mutex.synchronize { @sessions[request.session_id] } if session and session.alive? - session.call(env) + session.call(env) else url = request.build_url(:session_id => nil, :page_id => nil) Wee::RefreshResponse.new("Invalid or expired session", url).finish diff --git a/lib/wee/component.rb b/lib/wee/component.rb index 7d0da59..3a05266 100644 --- a/lib/wee/component.rb +++ b/lib/wee/component.rb @@ -9,6 +9,15 @@ module Wee # class Component < Presenter + # create a Wee::Application around this component, suitable for running in Rack::Builder.app + def self.app (cc = true) + if cc then + Wee::Application.new { Wee::Session.new(self.instanciate, Wee::Session::ThreadSerializer.new) } + else + Wee::Application.new { Wee::Session.new(self.instanciate) } + end + end + # # Constructs a new instance of the component. # @@ -103,17 +112,18 @@ def process_callbacks(callbacks) callbacks.input_callbacks.each_triggered_call_with_value(self) action_callback = nil - + callback_child = nil # process callbacks of all children for child in self.children if act = child.decoration.process_callbacks(callbacks) - raise "Duplicate action callback" if action_callback + raise "Duplicate action callback in child: #{child}" if action_callback + callback_child = child action_callback = act end end if act = callbacks.action_callbacks.first_triggered(self) - raise "Duplicate action callback" if action_callback + raise "Duplicate action callback in self, already one from #{callback_child}" if action_callback action_callback = act end @@ -312,7 +322,6 @@ def callcc(component) return *args end end - protected :callcc # @@ -333,7 +342,8 @@ def call_inline(&render_block) callcc BlockComponent.new(&render_block) end - protected :call_inline + #i'm unprotecting these because it breaks the ArcChallenge2 example + # protected :call_inline # # Return from a called component. @@ -346,7 +356,7 @@ def answer(*args) raise AnswerDecoration::Answer.new(args) end - protected :answer + protected :answer end # class Component diff --git a/lib/wee/decoration.rb b/lib/wee/decoration.rb index aded9bd..6e319bf 100644 --- a/lib/wee/decoration.rb +++ b/lib/wee/decoration.rb @@ -236,14 +236,14 @@ def initialize(title='', stylesheets=[], javascripts=[]) def global?() true end def render(r) - r.page.title(@title).head { + r.page.title(@title).head { @stylesheets.each {|s| r.link_css(s) } @javascripts.each {|j| r.javascript.src(j) } r.style.type('text/css').with { r.define_divert(:styles) } - r.javascript.with { r.define_divert(:javascripts) } + r.javascript.with { r.define_divert(:javascripts) } }.with { render_inner(r) - } + } end end # class PageDecoration diff --git a/lib/wee/html_canvas.rb b/lib/wee/html_canvas.rb index 608a96f..978f566 100644 --- a/lib/wee/html_canvas.rb +++ b/lib/wee/html_canvas.rb @@ -211,10 +211,10 @@ def build_url(*args) def register_callback(type, callback) cbs = @callbacks - if cbs.respond_to?("#{type}_callbacks") + if cbs.respond_to?("#{type}_callbacks")#type is either action or input... funny way to do it. cbs.send("#{type}_callbacks").register(@current_component, callback) else - raise + raise "callbacks(#{cbs}.inspect) does not respond_to? (\"#{type}_callbacks\")" end end @@ -248,6 +248,7 @@ def handle2(brush, &block) end alias handle3 set_brush +# to_s end # class HtmlCanvas diff --git a/lib/wee/html_document.rb b/lib/wee/html_document.rb index a183110..2d62482 100644 --- a/lib/wee/html_document.rb +++ b/lib/wee/html_document.rb @@ -45,8 +45,43 @@ def divert(tag, txt=nil, &block) end end +# def to_s + # @port.join + # end + public + alias_method :orig_to_s,:to_s def to_s - @port.join - end + # @port.join + #out insert new lines and indentation to make html human-readable + #start of tag gets new line & increase indent. + #closetag decrease indent + s = "" + indent = "" + intag = false + indent_str = " " + @port.each{|e| + if (e =~ /^<\w+$/) then #start of a tag. + s << indent << e + indent << indent_str + intag = true + elsif (e =~ /^<\/\w+>$/) then #start of a closing tag. + indent = indent.sub(indent_str,"") #sub only applies once. so removes the first indent_str from indent. + s << indent << e << "\n" + elsif e == ">" then #end of tag. + s << e << "\n" + intag = false + elsif e =~ /^\s+\/>$/ then #closing a start tag. cancel indent + s << e << "\n" + intag = false + indent = indent.sub(indent_str,"") #sub only applies once. so removes the first indent_str from indent. + + elsif intag #attributes of a starting tab. + s << e + else + s << indent << e.to_s << "\n" + end + } + s + end end end diff --git a/lib/wee/presenter.rb b/lib/wee/presenter.rb index 4393dc4..90f9632 100644 --- a/lib/wee/presenter.rb +++ b/lib/wee/presenter.rb @@ -10,7 +10,9 @@ module Wee class Presenter def render!(r) + #begin r.with(self) {|new_r| render(new_r)} + # end def render(r); raise end diff --git a/lib/wee/request.rb b/lib/wee/request.rb index bcc0d1d..f266b69 100644 --- a/lib/wee/request.rb +++ b/lib/wee/request.rb @@ -13,6 +13,7 @@ def self.new(env) attr_accessor :page_id def initialize(env) + #puts env.inspect.gsub(", ",",\n") super(env) @fields = self.params @session_id = @fields.delete("_s") @@ -37,6 +38,8 @@ def build_url(hash={}) callback_id = hash[:callback_id] info = hash.has_key?(:info) ? hash[:info] : @info + puts "callback_id: #{callback_id}" + raise ArgumentError if session_id.nil? and not page_id.nil? raise ArgumentError if page_id.nil? and not callback_id.nil? diff --git a/lib/wee/response.rb b/lib/wee/response.rb index a6f38ef..594b1fe 100644 --- a/lib/wee/response.rb +++ b/lib/wee/response.rb @@ -28,7 +28,7 @@ def initialize(location) end class RefreshResponse < Response - def initialize(message, location, seconds=5) + def initialize(message, location, seconds=2) super([%[ @@ -36,11 +36,12 @@ def initialize(message, location, seconds=5)

#{message}

- You are being redirected to #{location} - in #{seconds} seconds. + You are being redirected to #{location} + in #{seconds} seconds. ]]) end +#made the anchor around whe whole line because it is annoying to try and click on '/'and set seconds default to 2. Dominic end class NotFoundResponse < Response diff --git a/lib/wee/root_component.rb b/lib/wee/root_component.rb index c89aeea..a4ce524 100644 --- a/lib/wee/root_component.rb +++ b/lib/wee/root_component.rb @@ -1,4 +1,4 @@ -require 'wee/component' + require 'wee/component' require 'wee/external_resource' module Wee diff --git a/lib/wee/session.rb b/lib/wee/session.rb index 96e5e9a..982dcd7 100644 --- a/lib/wee/session.rb +++ b/lib/wee/session.rb @@ -2,6 +2,7 @@ require 'wee/lru_cache' require 'wee/id_generator' require 'wee/renderer' +require 'wee/response' module Wee @@ -180,8 +181,10 @@ def call(env) response = handle(env) sleep return response + rescue Exception => e #before this was added wee would just hang when there was an exception in Component.render + return Response.new(Rack::ShowExceptions.new(application).pretty(env,e)).finish#### ensure - Thread.current[:wee_session] = nil + Thread.current[:wee_session] = nil end else env['wee.session'] = self @@ -219,6 +222,7 @@ def sleep # def handle(env) request = Wee::Request.new(env) + @request = request # CONTINUATIONS! page = @page_cache.fetch(request.page_id) @@ -232,7 +236,8 @@ def handle(env) if request.render? return render(request, page).finish else # request.action? - return action(request, page).finish + #if everything is good, it will return a new RedirectResponse. + return action(request, page).finish end else # @@ -278,6 +283,8 @@ def render_ajax_proc(block, component) public :render_ajax_proc def render(request, page) + puts "RENDER!" + r = Wee::Renderer.new r.session = self r.request = request @@ -296,12 +303,13 @@ def render(request, page) page.callbacks = r.callbacks return r.response end - + #the request fields are passed into the def action(request, page) @current_page = nil - + puts "ACTION!" begin @page = page # CONTINUATIONS! + #puts request.fields action_callback = page.callbacks.with_triggered(request.fields) do @root_component.decoration.process_callbacks(page.callbacks) end diff --git a/test/test_html_canvas.rb b/test/test_html_canvas.rb index e56d7aa..f75b93d 100644 --- a/test/test_html_canvas.rb +++ b/test/test_html_canvas.rb @@ -1,16 +1,35 @@ +require 'rubygems' require 'test/unit' module Wee; end -require 'wee/renderer/html/writer' -require 'wee/renderer/html/brushes' -require 'wee/renderer/html/canvas' -require 'wee/context' +require 'wee/html_document' +require 'wee/html_brushes' +require 'wee/html_canvas' +require 'wee/callback' +require 'wee/request' +require 'flexmock/test_unit' +#require 'wee/context' class Test_HtmlCanvas < Test::Unit::TestCase - def test_simple - rctx = Wee::RenderingContext.new - rctx.document = Wee::HtmlWriter.new(doc='') +def new_canvas (doc,cbs = nil,req = nil) + session=nil + request=req + response=nil + callbacks=cbs + document=doc +current_component=nil + c = Wee::HtmlCanvas.new(session,request,response,callbacks,document,current_component) +end - c = Wee::HtmlCanvas.new(rctx) + def assert_html_equal (expect,other, message = "") + + r = /#{expect.gsub(/\s+/,"\\s*")}/ + assert r =~ other, "expected #{r}} =~ #{other} \n#{message}" + +end + def test_simple + + doc = Wee::HtmlDocument.new + c = new_canvas(doc) c.form.action("foo").with { c.table { c.table_row.id("myrow").with { @@ -19,7 +38,34 @@ def test_simple } c.space } - - assert_equal %[
Hello world
 
], doc + string = %[
Hello world
 
] + assert_html_equal string, doc.to_s end +def test_wrong_brushname + doc = Wee::HtmlDocument.new + c = new_canvas(doc) + begin + c.form.action("foo").with { + c.password_field.value "hello" + } + fail "expected exception" + rescue; end + +end +def test_mock_callback + doc = Wee::HtmlDocument.new + cbs = Wee::Callbacks.new + req = flexmock(:build_url => "test/") #THIS SETS UP THE ROUT BACK TO THE CALLBACK. MAY WANT A MORE FULL MOCK OF REQUEST. + +# cb = flexmock("callbacks") +# sensor.should_receive(:"respond_to?").times(1). +# and_return(10, 12, 14) + + c = new_canvas(doc,cbs,req) + @callback = false + c.anchor.callback {@callback = true}.with("hello!") + +end + end + diff --git a/test/test_html_canvas2.rb b/test/test_html_canvas2.rb new file mode 100644 index 0000000..2df03db --- /dev/null +++ b/test/test_html_canvas2.rb @@ -0,0 +1,7 @@ + + +require 'rubygems' +require 'wee' +require 'wee/html_canvas' + + diff --git a/test/test_request.rb b/test/test_request.rb index 4c1d033..b212a7f 100644 --- a/test/test_request.rb +++ b/test/test_request.rb @@ -1,42 +1,57 @@ require 'test/unit' module Wee; end require 'wee/request' +require 'rack' class Test_Request < Test::Unit::TestCase - def test_parse - d = Wee::Request::DELIM - req = Wee::Request.new('/app', "/app/info#{d}req_handler_id/page_id", nil, nil, nil) - assert_equal 'info', req.info - assert_equal 'req_handler_id', req.request_handler_id - assert_equal 'page_id', req.page_id - end + def env +############################# + +#SEE RACK TEST CODE FOR HOW TO DO THIS PROPERLY. + +############################# + + +{"HTTP_HOST"=>"localhost:2000", +"HTTP_ACCEPT"=>"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", +"SERVER_NAME"=>"localhost", +"rack.url_scheme"=>"http", +"REQUEST_PATH"=>"/", +"HTTP_USER_AGENT"=>"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.6) Gecko/20100628 Ubuntu/10.04 (lucid) Firefox/3.6.6", +"HTTP_KEEP_ALIVE"=>"115", +#"rack.errors"=>#, +"HTTP_ACCEPT_LANGUAGE"=>"en-us,en;q=0.5", +"SERVER_PROTOCOL"=>"HTTP/1.1", +"rack.version"=>[1,1], +"rack.run_once"=>false, +"SERVER_SOFTWARE"=>"Mongrel 1.1.5", +"PATH_INFO"=>"/", +"REMOTE_ADDR"=>"127.0.0.1", +"SCRIPT_NAME"=>"", +"rack.multithread"=>true, +"HTTP_VERSION"=>"HTTP/1.1", +#"HTTP_COOKIE"=>"innate.sid=25bcc7066795b60c5a6eef6e8c07ecf8e77a6bafd233c6c91ac96808a276fc309e795f47bac7265a6f985b54b9fa7bf1e5184f842c8215a45a864a128833c2a0", +"rack.multiprocess"=>false, +#"REQUEST_URI"=>"/?_p=0&_s=Uwp0dIXiB96s4DQiNUqcqg", +"HTTP_ACCEPT_CHARSET"=>"ISO-8859-1,utf-8;q=0.7,*;q=0.7", +"SERVER_PORT"=>"2000", +"REQUEST_METHOD"=>"GET", +"rack.input"=>StringIO.new, #, +#"QUERY_STRING"=>"_p=0&_s=Uwp0dIXiB96s4DQiNUqcqg",##page=0session_id=... +"HTTP_ACCEPT_ENCODING"=>"gzip,deflate", +"HTTP_CONNECTION"=>"keep-alive", +"GATEWAY_INTERFACE"=>"CGI/1.2"} - def test_fields - fields = { - 'a' => 1, - 'b' => 2, - 'a.x' => 3, - 'a.y' => 4, - } - - parsed = { - 'a' => {nil => 1, 'x' => 3, 'y' => 4}, - 'b' => 2 - } - - req = Wee::Request.new('/app', "/app", nil, fields, nil) - assert_equal parsed, req.fields end - def test_build_url - d = Wee::Request::DELIM - req = Wee::Request.new('/app', "/app/info#{d}req_handler_id/page_id", nil, nil, nil) - - assert_equal "/app/info#{d}req_handler_id/page_id?c", req.build_url(:callback_id => 'c') - - assert_equal "/app/info#{d}a/b?c", req.build_url(:request_handler_id => 'a', :page_id => 'b', :callback_id => 'c') - assert_equal "/app/info#{d}req_handler_id/b", req.build_url(:request_handler_id => 'req_handler_id', :page_id => 'b') - - assert_equal "/app/info", req.build_url(:request_handler_id => nil, :page_id => nil) + def test_parse + #I think may have been written before Wee used rack. + #d = Wee::Request::DELIM + req = Wee::Request.new(env) + #assert_equal 'info', req.info + #assert_equal 'req_handler_id', req.request_handler_id + #assert_equal 'page_id', req.page_id + end + end diff --git a/wee-2.2.0.gem b/wee-2.2.0.gem new file mode 100644 index 0000000..9c8fa3a Binary files /dev/null and b/wee-2.2.0.gem differ diff --git a/wee-2.2.1.gem b/wee-2.2.1.gem new file mode 100644 index 0000000..1126fdf Binary files /dev/null and b/wee-2.2.1.gem differ