From zimba.tm at gmail.com Wed Mar 15 11:32:03 2006 From: zimba.tm at gmail.com (zimba.tm) Date: Wed, 15 Mar 2006 17:32:03 +0100 Subject: [Wee-talk] Wee repo ? Message-ID: <200603151732.03284.zimba.tm@gmail.com> Hi list, is there a repository where I can get the latest wee source ? The rubyforge's CVS is empty. -- Cheers, zimba.tm weblog : http://zimba.oree.ch From mneumann at ntecs.de Wed Mar 15 11:42:13 2006 From: mneumann at ntecs.de (Michael Neumann) Date: Wed, 15 Mar 2006 17:42:13 +0100 Subject: [Wee-talk] Wee repo ? In-Reply-To: <200603151732.03284.zimba.tm@gmail.com> References: <200603151732.03284.zimba.tm@gmail.com> Message-ID: <16D028AF-3BA2-4486-9331-DB403A2DC6F1@ntecs.de> Hi, You can get the current sources from the latest gem. My svn is currently only running over ssh, so not public. Regards, Michael Am 15.03.2006 um 17:32 schrieb zimba.tm: > Hi list, > > is there a repository where I can get the latest wee source ? The > rubyforge's > CVS is empty. > > -- > Cheers, > zimba.tm > > weblog : http://zimba.oree.ch > _______________________________________________ > Wee-talk mailing list > Wee-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/wee-talk From zimba.tm at gmail.com Thu Mar 16 15:53:21 2006 From: zimba.tm at gmail.com (zimba.tm) Date: Thu, 16 Mar 2006 21:53:21 +0100 Subject: [Wee-talk] Form submission Message-ID: <200603162153.22009.zimba.tm@gmail.com> Hi list, thanks Michael for your previous answer. Now I'm starting to play with Wee and I have tons of questions that raise up :-p I would like if possible, to have some hints on two things : * how to get the values from the two input boxes. In all examples, I've only seen single input submits. * how to store the data so that it's accessible from other components or decorators ? To start, I have used the ComponentDispatcher to build different pages (it seems bugged but I have to investigate on this). I now have a simple page that shows up pretty well. I then wanted to add authentication to the application. So I implemented the LoginDecoration like specified in the source code and created another component to work with. As you can see below, it will certainly shows that I didn't grasp all the philosophy yet. I have just included the two concerned pages as the rest seems to work pretty well. ==== snip ==== class ProVision::Page::Login < Wee::Component attr_reader :user attr_accessor :username attr_accessor :password def render r.h1 "Login : " + @wesh.to_s # r.text.class('error').with { @error } r.form.action(:login).with do r.text "login : " r.text_input.value(@username).callback { |v| username = v } r.break r.text "password : " r.text_input.value(@password).callback { |v| password = v } r.break r.submit_button.value("login").callback { login } end end def login if user = User.find_by_username(@username) and user.password == user.crypt_password(@password) @user = user else @error = "Unable to login" end end def logout @user = nil end def logged_in? not @user.nil? end end class ProVision::Decoration::Login < Wee::LoginDecoration def logged_in? @login_page.logged_in?() end end ==== snip ==== -- Cheers, zimba.tm weblog : http://zimba.oree.ch From zimba.tm at gmail.com Fri Mar 17 05:06:22 2006 From: zimba.tm at gmail.com (zimba.tm) Date: Fri, 17 Mar 2006 11:06:22 +0100 Subject: [Wee-talk] First contribution : Wee::HtmlPrettyWriter Message-ID: <200603171106.23067.zimba.tm@gmail.com> Hi list, I'm really happy with Wee. Lots of things are still obscure but it has a great potential. Especially, the architecture is really nice and I have a good feeling :-) Here is my first contribution to the Wee project. It's an extension of the HtmlWriter which will indent the code. It's not perfect yet. I need more html to test all the cases, etc.. == Usage Build your own session and re-implement the respond method. class MySession < Wee::Session def respond(context, callbacks) pre_respond_hook set_response(context, Wee::GenericResponse.new('text/html', '')) rctx = Wee::RenderingContext.new(context, callbacks, Wee::HtmlPrettyWriter.new(context.response.content)) @component_runner.render(rctx) end end end -- Cheers, zimba.tm weblog : http://zimba.oree.ch -------------- next part -------------- A non-text attachment was scrubbed... Name: pretty_writer.rb Type: application/x-ruby Size: 674 bytes Desc: not available Url : http://rubyforge.org/pipermail/wee-talk/attachments/20060317/a5bd9c00/attachment.bin From zimba.tm at gmail.com Fri Mar 17 13:27:06 2006 From: zimba.tm at gmail.com (zimba.tm) Date: Fri, 17 Mar 2006 19:27:06 +0100 Subject: [Wee-talk] Corrected version of OgScaffolder Message-ID: <200603171927.07103.zimba.tm@gmail.com> Hi list, you can find attached, a corrected version of the OgScaffolder class that works with the last version of Og (0.29.0) -- Cheers, zimba.tm weblog : http://zimba.oree.ch -------------- next part -------------- A non-text attachment was scrubbed... Name: scaffolder.rb Type: application/x-ruby Size: 5415 bytes Desc: not available Url : http://rubyforge.org/pipermail/wee-talk/attachments/20060317/784453a7/attachment-0001.bin From zimba.tm at gmail.com Mon Mar 27 12:04:25 2006 From: zimba.tm at gmail.com (zimba.tm) Date: Mon, 27 Mar 2006 19:04:25 +0200 Subject: [Wee-talk] Mongrel adapter Message-ID: <200603271904.25453.zimba.tm@gmail.com> Hi list, attached, you will find a mongrel adapter. == Usage #!/usr/bin/env ruby require 'wee/adaptors/mongrel' # Your application require 'hello_world' h = Mongrel::HttpServer.new('0.0.0.0', 2000) h.register('/app', Wee::MongrelAdaptor.new('/app', HelloWorldApplication.new())) h.register('/media', Mongrel::DirHandler.new('/path_to/media'), false)) # false disables dir-listing trap("INT") { h.stop } h.run puts "Server started on #{h.instance_variable_get('@host')}:#{h.instance_variable_get('@port')}" h.acceptor.join -- Cheers, zimba.tm weblog : http://zimba.oree.ch -------------- next part -------------- A non-text attachment was scrubbed... Name: mongrel.rb Type: application/x-ruby Size: 1231 bytes Desc: not available Url : http://rubyforge.org/pipermail/wee-talk/attachments/20060327/3fbed752/attachment.bin