[Aiml-programr-developers] Tests and Architecture
mauro at cicio.org
mauro at cicio.org
Tue Sep 18 03:26:01 EDT 2007
Hi,
Now that you guys have the smal example up and running, I think that
we can use it to get the names right.
The program has two porpouses: help us in finding names for things and
actually show a possible flow of control.
As you have probably seen by now, most of it is delegation.
I used several classes as "place holders" for the actors playing a
role in the FW game. For the sake of clarity, I have used names like
webserver, browser, Rails, Service and so on...
Besides, the program is also actually doing something: it is giving an
example of basic, but working, session management. It is not too
difficult to make it a real session management subsystem.
Ciao,
Mauro
On 17/09/2007, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:
> Mauro,
>
> Works a treat! Thanks for the help, I thought it might be something to
> do with an un-referenced library but was unsure what/how.
>
> Nicholas
>
> mauro at cicio.org wrote:
> > The to_yaml method is part of the standard library YAML module
> > (http://www.ruby-doc.org/stdlib/libdoc/yaml/rdoc/index.html).
> >
> > Why is not working on my PC but not on yours?
> > I think that the explanation can be one of the following:
> > 1 - ruby version (1.8.4)
> > 2 - I have all the rails library in the path
> >
> > One thing you might want to try is to include explicitely the YAML module:
> >
> > class Response
> > include YAML
> > attr_reader :body, :session_id
> > def initialize(body, session_id)
> > @body, @session_id = body, session_id
> > end
> > end
> >
> > and if this giver problems, to require the lib:
> > require 'yaml'
> > class Response
> > ...
> >
> >
> > I hope this will do...
> >
> > Ciao,
> > Mauro
> >
> >
> > On 17/09/2007, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:
> >
> >> Hi Mauro,
> >>
> >> Still no luck with the code you sent. The server part now runs but when
> >> the browser queries it I get the following:
> >>
> >> $ ruby browser.rb
> >> demo$ hello
> >> (druby://127.0.0.1:7001) ./lib/comm/bot_proxy.rb:11:in `handle':
> >> undefined method `to_yaml' for #<Response:0xb7c86718 @session_id=3,
> >> @body="olleh"> (NoMethodError)
> >> from ./lib/comm/p_r_plugin.rb:28:in `handle'
> >> from ./lib/comm/p_r_plugin.rb:14:in `hanlde'
> >> from ./webserver.rb:18:in `get'
> >> from browser.rb:18:in `start'
> >> from browser.rb:23
> >>
> >> As you can see, the thing seems to work up to returning the
> >> Response.to_yaml method. I've looked in the code and there isn't one
> >> defined. :-(
> >>
> >> Is there something missing?
> >>
> >> Best wishes,
> >>
> >> Nicholas
> >>
> >>
> >
> >
>
>
More information about the Aiml-programr-developers
mailing list