[ANN] Wee 0.7.0 + Tutorial Videos

Hi,

Wee 0.7.0 is out! In addition, I've recorded three tutorial sessions (screen
captures). You can download the MPEGs via BitTorrent here:

  http://rubyforge.org/frs/?group_id=427&release_id=1528

I'm open for suggestions and thankful for comments. If possible, please let
you BitTorrent client open.

The first tutorial is about installing Wee, creating an initial skeleton
application, simple forms and explains briefly decorations. The second is
about subcomponents and backtracking. The third is on using Wee together with
Og and a Postgres database.

== Philosophy/Features of Wee

  http://rubytalk.com/128432

== Download and Installation

  http://rubyforge.org/projects/wee

  gem install wee
  
Have a look at the 'wee' command!

== ChangeLog

Major changes (compared to 0.5.0) are:

  * Added ERB-templating. Example:

      # file: ~/components/main.rb
      class Test < Wee::Component

        # use template '~/components/main.tpl'
        template :render

        # use template '~/components/main.tpl-buttons'
        template :render_buttons
      end

    This allows you to use ERB-templates instead of the render_XXX
    methods. You can also call render_XXX methods from ERB, back and
    forth. The template file is relative to the file from which the
    'template :symbol' call is executed. The template method optionally
    takes the two hash-parameters :file and :property.

  * Added "Pageless" mode. In pageless mode, the URL displayed in your
    browser always looks like "/app". The session id is stored as cookie
    and there is no page_id, hence "pageless" mode. No backtracking is
    performed! Example:

      require 'wee/pageless'

      app = Wee::Utils.app_for(YourMainComponent,
        :session => Wee::PagelessSession,
        :application => Wee::PagelessApplication)

      Wee::WEBrickAdaptor.
        request_class(Wee::PagelessRequest).
        register('/app' => app).
        start

  * Added named callbacks. Example:

      r.anchor.named_callback('test') { ... }

    will use 'test' as callback_id instead of a generic one.

  * added 'wee' binary which generates a sample application and
    recommended directory structure for you (similar to the 'rails' command).

  * Wee::Request: Refactored a lot. Use =/ instead of @ as delimeter for
    the request_handler_id/page_id part ('@' looks ugly in Konqueror, as
    it is displayed as '%40')

  * Implemented a new OgScaffolder, which now is more like the Rails one.

Changes that break compatibility:

  * Wee::LiteralMethodCallback and Component#call: Additional arguments
    are now prepended instead of appended. Example:

      call MessageBox.new('msg'), :confirm, 1

      def confirm(one, msgbox_result)
      end

  * Methods ImageTag#src_for and GenericTagBrush#css_class_for no more
    prepend 'img.' or 'css.' in front of the property name.

  * Method Wee::Utils.app_for: Removed the id_seed option. Use id_gen
    instead, which expects a IdGenerator object (default is now the much more
    secure Md5IdGenerator).

  * SelectListTag (r.select_list): NON-backwards-compatible change!!!
    If it's NOT a multiple select list, then the callback is called
    with the choosen value (instead of an array of one element). Method
    #selected requires a single value in the same way. No changes if it's
    a multiple-select list!

For the full list of changes see:

  http://www.ntecs.de/viewcvs/viewcvs/Wee/trunk/ChangeLog?view=auto

== Hello World

   require 'wee'

   class HelloWorld < Wee::Component
      def click
       @clicks = (@clicks || 0) + 1
     end

     def render
       r.h1.onclick_callback(:click).with("Hello World!")
       r.text "#{ @clicks || 'No' } clicks"
     end
   end

   # And start the WEBrick web-server
   require 'wee/utils'
   require 'wee/adaptors/webrick'

   app = Wee::Utils.app_for {
     HelloWorld.new.add_decoration(Wee::PageDecoration.new("Hello World"))
   }
   Wee::WEBrickAdaptor.register('/app' => app).start

Make sure you run this application with the -rubygems option. Then point your
browser to http://localhost:2000/app and click on the h1-header. Every time
you click on it, you should see that the number of clicks increases. Have fun!

== Future?

I'd like improve the integration of models with Wee.

Regards,

   Michael

I'm playing with the wee and so far it looks very interesting. I hope I'll get more understanding after following tutorial videos (tahnks for those btw). The only minor thing I have noticed is that calendar.rb example seems to be a little bit outdated. The following change fixed it for me:

@@ -343,9 +343,7 @@
      # Call the calendar component

···

#
      def calendar()
- if date = call( CustomCalendar.new(@date) )
- @date = date
- end
+ call( CustomCalendar.new(@date), lambda { |date| @date = date if date })
      end
    end

Cheers,
Kent.

On Feb 1, 2005, at 3:44 PM, Michael Neumann wrote:

Hi,

Wee 0.7.0 is out! In addition, I've recorded three tutorial sessions (screen
captures). You can download the MPEGs via BitTorrent here:

  http://rubyforge.org/frs/?group_id=427&release_id=1528

I'm open for suggestions and thankful for comments. If possible, please let
you BitTorrent client open.

The first tutorial is about installing Wee, creating an initial skeleton
application, simple forms and explains briefly decorations. The second is
about subcomponents and backtracking. The third is on using Wee together with
Og and a Postgres database.

== Philosophy/Features of Wee

  | RubyTalk

== Download and Installation

  http://rubyforge.org/projects/wee

  gem install wee

Have a look at the 'wee' command!

== ChangeLog

Major changes (compared to 0.5.0) are:

  * Added ERB-templating. Example:

      # file: ~/components/main.rb
      class Test < Wee::Component

        # use template '~/components/main.tpl'
        template :render

        # use template '~/components/main.tpl-buttons'
        template :render_buttons
      end

    This allows you to use ERB-templates instead of the render_XXX
    methods. You can also call render_XXX methods from ERB, back and
    forth. The template file is relative to the file from which the
    'template :symbol' call is executed. The template method optionally
    takes the two hash-parameters :file and :property.

  * Added "Pageless" mode. In pageless mode, the URL displayed in your
    browser always looks like "/app". The session id is stored as cookie
    and there is no page_id, hence "pageless" mode. No backtracking is
    performed! Example:

      require 'wee/pageless'

      app = Wee::Utils.app_for(YourMainComponent,
        :session => Wee::PagelessSession,
        :application => Wee::PagelessApplication)

      Wee::WEBrickAdaptor.
        request_class(Wee::PagelessRequest).
        register('/app' => app).
        start

  * Added named callbacks. Example:

      r.anchor.named_callback('test') { ... }

    will use 'test' as callback_id instead of a generic one.

  * added 'wee' binary which generates a sample application and
    recommended directory structure for you (similar to the 'rails' command).

  * Wee::Request: Refactored a lot. Use =/ instead of @ as delimeter for
    the request_handler_id/page_id part ('@' looks ugly in Konqueror, as
    it is displayed as '%40')

  * Implemented a new OgScaffolder, which now is more like the Rails one.

Changes that break compatibility:

  * Wee::LiteralMethodCallback and Component#call: Additional arguments
    are now prepended instead of appended. Example:

      call MessageBox.new('msg'), :confirm, 1

      def confirm(one, msgbox_result)
      end

  * Methods ImageTag#src_for and GenericTagBrush#css_class_for no more
    prepend 'img.' or 'css.' in front of the property name.

  * Method Wee::Utils.app_for: Removed the id_seed option. Use id_gen
    instead, which expects a IdGenerator object (default is now the much more
    secure Md5IdGenerator).

  * SelectListTag (r.select_list): NON-backwards-compatible change!!!
    If it's NOT a multiple select list, then the callback is called
    with the choosen value (instead of an array of one element). Method
    #selected requires a single value in the same way. No changes if it's
    a multiple-select list!

For the full list of changes see:

  http://www.ntecs.de/viewcvs/viewcvs/Wee/trunk/ChangeLog?view=auto

== Hello World

   require 'wee'

   class HelloWorld < Wee::Component
      def click
       @clicks = (@clicks || 0) + 1
     end

     def render
       r.h1.onclick_callback(:click).with("Hello World!")
       r.text "#{ @clicks || 'No' } clicks"
     end
   end

   # And start the WEBrick web-server
   require 'wee/utils'
   require 'wee/adaptors/webrick'

   app = Wee::Utils.app_for {
     HelloWorld.new.add_decoration(Wee::PageDecoration.new("Hello World"))
   }
   Wee::WEBrickAdaptor.register('/app' => app).start

Make sure you run this application with the -rubygems option. Then point your
browser to http://localhost:2000/app and click on the h1-header. Every time
you click on it, you should see that the number of clicks increases. Have fun!

== Future?

I'd like improve the integration of models with Wee.

Regards,

   Michael

Wee 0.7.0 is out!

I'm having trouble getting Nemo to run with Wee 0.7.0. Any ideas?

I'd like improve the integration of models with Wee.

What kinds of "models"?

Michael Neumann <mneumann@ntecs.de> writes:

[ ... ]

  * Added "Pageless" mode. In pageless mode, the URL displayed in your
    browser always looks like "/app". The session id is stored as cookie
    and there is no page_id, hence "pageless" mode. No backtracking is
    performed! Example:

      require 'wee/pageless'

      app = Wee::Utils.app_for(YourMainComponent,
        :session => Wee::PagelessSession,
        :application => Wee::PagelessApplication)

      Wee::WEBrickAdaptor.
        request_class(Wee::PagelessRequest).
        register('/app' => app).
        start

Thank you for all your great work on wee.

I got the following error when trying to invoke an example in
"Pageless" mode (wrapped to fit it better in this email message):

  /usr/local/lib/ruby/gems/1.9/gems/wee-0.7.0/lib/wee/utils/helper.rb:29:
      in `app_for': uninitialized constant Wee::Md5IdGenerator (NameError)
      from ./hello-wee.rb:22

Here's my code:

  #!/usr/bin/ruby

  require 'rubygems'
  require 'wee'
  require 'wee/pageless'
  require 'wee/utils'
  require 'wee/adaptors/webrick'

  class HelloWorld < Wee::Component
    def click
      @clicks = (@clicks || 0) + 1
    end

    def render
      r.h1.onclick_callback(:click).with("Hello World!")
      r.text "#{ @clicks || 'No' } clicks"
    end
  end

  app = Wee::Utils.app_for(
    HelloWorld.new.add_decoration(
      Wee::PageDecoration.new("Hello World")),
    :session => Wee::PagelessSession,
    :application => Wee::PagelessApplication
  )

  Wee::WEBrickAdaptor.
    request_class(Wee::PagelessRequest).
    register('/app' => app).start

Any ideas as to what the problem might be?

Thanks in advance.

···

--
Lloyd Zusman
ljz@asfast.com
God bless you.

Michael, I may be doing something wrong, but none of the MPEGs worked
for me (with both WinDVD and MS Windows Media Player). Just thought I'd
let you know.

Thanks

Kent Sibilev wrote:

I'm playing with the wee and so far it looks very interesting. I hope I'll get more understanding after following tutorial videos (tahnks for those btw). The only minor thing I have noticed is that calendar.rb example seems to be a little bit outdated. The following change fixed it for me:

@@ -343,9 +343,7 @@
     # Call the calendar component
     #
     def calendar()
- if date = call( CustomCalendar.new(@date) )
- @date = date
- end
+ call( CustomCalendar.new(@date), lambda { |date| @date = date if date })
     end
   end

Thanks. Either your patch solves this, or put a require 'wee/continuation' at the top. There are probably some other examples broken.

Regards,

   Michael

itsme213@hotmail.com wrote:

Wee 0.7.0 is out!

I'm having trouble getting Nemo to run with Wee 0.7.0. Any ideas?

Yes. You should wait for Nemo 0.3.0.

I'd like improve the integration of models with Wee.

What kinds of "models"?

database models.

Regards,

   Michael

Lloyd Zusman wrote:

Michael Neumann <mneumann@ntecs.de> writes:

[ ... ]

* Added "Pageless" mode. In pageless mode, the URL displayed in your
  browser always looks like "/app". The session id is stored as cookie
  and there is no page_id, hence "pageless" mode. No backtracking is
  performed! Example:

    require 'wee/pageless'

    app = Wee::Utils.app_for(YourMainComponent,
      :session => Wee::PagelessSession,
      :application => Wee::PagelessApplication)

    Wee::WEBrickAdaptor.
      request_class(Wee::PagelessRequest).
      register('/app' => app).
      start

Thank you for all your great work on wee.

I got the following error when trying to invoke an example in
"Pageless" mode (wrapped to fit it better in this email message):

  /usr/local/lib/ruby/gems/1.9/gems/wee-0.7.0/lib/wee/utils/helper.rb:29:
      in `app_for': uninitialized constant Wee::Md5IdGenerator (NameError)
      from ./hello-wee.rb:22

Here's my code:

  #!/usr/bin/ruby

  require 'rubygems'
  require 'wee'
  require 'wee/pageless'
  require 'wee/utils'
  require 'wee/adaptors/webrick'

  class HelloWorld < Wee::Component
    def click
      @clicks = (@clicks || 0) + 1
    end

    def render
      r.h1.onclick_callback(:click).with("Hello World!")
      r.text "#{ @clicks || 'No' } clicks"
    end
  end

  app = Wee::Utils.app_for(
    HelloWorld.new.add_decoration(
      Wee::PageDecoration.new("Hello World")),
    :session => Wee::PagelessSession,
    :application => Wee::PagelessApplication
  )

First argument of app_for is the root-component class, not an object thereof. An object does not work, as each session needs it's own root component object. So you should use a block:

    app = Wee::Utils.app_for(
      nil,
      :session => Wee::PagelessSession,
      :application => Wee::PagelessApplication
    ) {
      HelloWorld.new.add_decoration(
        Wee::PageDecoration.new("Hello World"))
    }

That should work, despite that it look a little bit ugly :wink:

Regards,

   Michael

I could not get the videos to work either. On OS, Linux or Win. All it showed was the starting screen that said WEE and that was all. I would really like to chekc them out though if you could repost some different vids.
-Thanks

···

On Feb 2, 2005, at 10:45 PM, itsme213@hotmail.com wrote:

Michael, I may be doing something wrong, but none of the MPEGs worked
for me (with both WinDVD and MS Windows Media Player). Just thought I'd
let you know.

Thanks

Mail from ezmobius1 won't change you life or will it?!?

itsme213@hotmail.com wrote:

Michael, I may be doing something wrong, but none of the MPEGs worked
for me (with both WinDVD and MS Windows Media Player). Just thought I'd
let you know.

There are in DIVX4 format. I'll try to convert them into some other format. Hope that works.

Now which codec should I use?
mpeg1, mpeg2, divx3 (MSMPEG4v3), or Windows Media Video (wmv1/2).

Thanks for reporting.

Regards,

   Michael

Michael Neumann <mneumann@ntecs.de> writes:

Lloyd Zusman wrote:

[ ... ]

/usr/local/lib/ruby/gems/1.9/gems/wee-0.7.0/lib/wee/utils/helper.rb:29:
      in `app_for': uninitialized constant Wee::Md5IdGenerator (NameError)
      from ./hello-wee.rb:22
Here's my code:
  #!/usr/bin/ruby
  require 'rubygems'
  require 'wee'
  require 'wee/pageless'
  require 'wee/utils'
  require 'wee/adaptors/webrick'
  class HelloWorld < Wee::Component
    def click
      @clicks = (@clicks || 0) + 1
    end
    def render
      r.h1.onclick_callback(:click).with("Hello World!")
      r.text "#{ @clicks || 'No' } clicks"
    end
  end
  app = Wee::Utils.app_for(
    HelloWorld.new.add_decoration(
      Wee::PageDecoration.new("Hello World")),
    :session => Wee::PagelessSession,
    :application => Wee::PagelessApplication
  )

First argument of app_for is the root-component class, not an object
thereof. An object does not work, as each session needs it's own root
component object. So you should use a block:

    app = Wee::Utils.app_for(
      nil,
      :session => Wee::PagelessSession,
      :application => Wee::PagelessApplication
    ) {
      HelloWorld.new.add_decoration(
        Wee::PageDecoration.new("Hello World"))
    }

That should work, despite that it look a little bit ugly :wink:

Thank you very much ... but sadly, I did this and got the same error
message (see above).

???

···

--
Lloyd Zusman
ljz@asfast.com
God bless you.

They worked fine for me on a windows XP box using windows media player 9.

Well fine except for a few garbled bits in the middle, but they looked like the screen capture software had lost it a bit rather than a problem with the recording itself.

BTW - The videos were most enlightening.

R.

Ezra Zygmuntowicz wrote:

···

I could not get the videos to work either. On OS, Linux or Win. All it showed was the starting screen that said WEE and that was all. I would really like to chekc them out though if you could repost some different vids.
-Thanks
On Feb 2, 2005, at 10:45 PM, itsme213@hotmail.com wrote:

Michael, I may be doing something wrong, but none of the MPEGs worked
for me (with both WinDVD and MS Windows Media Player). Just thought I'd
let you know.

Thanks

Mail from ezmobius1 won't change you life or will it?!?

Michael Neumann ha scritto:

···

itsme213@hotmail.com wrote:

Michael, I may be doing something wrong, but none of the MPEGs worked
for me (with both WinDVD and MS Windows Media Player). Just thought I'd
let you know.

There are in DIVX4 format. I'll try to convert them into some other format. Hope that works.

Now which codec should I use?
mpeg1, mpeg2, divx3 (MSMPEG4v3), or Windows Media Video (wmv1/2).

Thanks for reporting.

Divx5/Xvid :slight_smile:

Ezra Zygmuntowicz wrote:

I could not get the videos to work either. On OS, Linux or Win. All it showed was the starting screen that said WEE and that was all. I would really like to chekc them out though if you could repost some different vids.

Please try one of the videos and report me which one works for you:

http://ruwee.de/msmpeg4.avi
http://ruwee.de/wmv1.avi
http://ruwee.de/rv10.avi

There are only 60k - 100k in size. You should see the logo and then the first slide ("Outline"), that's all.

Sorry for the inconvienice. Next time will use a format other than mpeg4.

Regards,

   Michael

> I'm having trouble getting Nemo to run with Wee 0.7.0. Any ideas?

Yes. You should wait for Nemo 0.3.0.

I've released the 0.1.2 gem with updates for Wee 0.7.0 compatibility.

In the works though is Nemo 0.3.0, which introduces much change, including a
much cleaner MetaObject definition syntax, and database ORM integration.

Regards,
Kevin

Michael Neumann schrieb:

Michael, I may be doing something wrong, but none of the MPEGs worked
for me (with both WinDVD and MS Windows Media Player). Just thought I'd
let you know.

There are in DIVX4 format. I'll try to convert them into some other format. Hope that works.

Now which codec should I use?

Definately XVID 1.0x if you can.

I could see the movies just fine. But that is probably because I had the " Gordian Knot Codec Pack 1.9" installed. You can find it on www.doom9.org for Windows.

But I don't know how to encode on BSD (which I think you use).

Thanks for the videos. Wee is an interesting alternative to Rails.

Sascha Ebach

···

itsme213@hotmail.com wrote:

Lloyd Zusman wrote:

Michael Neumann <mneumann@ntecs.de> writes:

Lloyd Zusman wrote:

[ ... ]

/usr/local/lib/ruby/gems/1.9/gems/wee-0.7.0/lib/wee/utils/helper.rb:29:
     in `app_for': uninitialized constant Wee::Md5IdGenerator (NameError)
     from ./hello-wee.rb:22
Here's my code:
#!/usr/bin/ruby
require 'rubygems'
require 'wee'
require 'wee/pageless'
require 'wee/utils'
require 'wee/adaptors/webrick'
class HelloWorld < Wee::Component
   def click
     @clicks = (@clicks || 0) + 1
   end
   def render
     r.h1.onclick_callback(:click).with("Hello World!")
     r.text "#{ @clicks || 'No' } clicks"
   end
end
app = Wee::Utils.app_for(
   HelloWorld.new.add_decoration(
     Wee::PageDecoration.new("Hello World")),
   :session => Wee::PagelessSession,
   :application => Wee::PagelessApplication
)

First argument of app_for is the root-component class, not an object
thereof. An object does not work, as each session needs it's own root
component object. So you should use a block:

   app = Wee::Utils.app_for(
     nil,
     :session => Wee::PagelessSession,
     :application => Wee::PagelessApplication
   ) {
     HelloWorld.new.add_decoration(
       Wee::PageDecoration.new("Hello World"))
   }

That should work, despite that it look a little bit ugly :wink:

Thank you very much ... but sadly, I did this and got the same error
message (see above).

Hm, lets try this:

   ruby -rubygems -e 'require "wee"; p Wee::Md5IdGenerator'

and then this:

   ruby -e 'require "wee"; p Wee::Md5IdGenerator'

Regards,

   Michael

gabriele renzi ha scritto:

oops, the cat ate a line:
"but provide a message saying the code are tou using"

gabriele renzi wrote:

Michael Neumann ha scritto:

Michael, I may be doing something wrong, but none of the MPEGs worked
for me (with both WinDVD and MS Windows Media Player). Just thought I'd
let you know.

There are in DIVX4 format. I'll try to convert them into some other format. Hope that works.

Now which codec should I use?
mpeg1, mpeg2, divx3 (MSMPEG4v3), or Windows Media Video (wmv1/2).

Thanks for reporting.

Divx5/Xvid :slight_smile:

yeah, now try that with "transcode"... only ffmpeg works for me, and even with that, I have to transcode it twice, because the first time it is mirrored and blue/red is mixed (and -l and -k options do not work).

Hm, isn't Divx5 == HL263?

Regards,

   Michael

···

itsme213@hotmail.com wrote:

Sascha Ebach wrote:

Michael Neumann schrieb:

Michael, I may be doing something wrong, but none of the MPEGs worked
for me (with both WinDVD and MS Windows Media Player). Just thought I'd
let you know.

There are in DIVX4 format. I'll try to convert them into some other format. Hope that works.

Now which codec should I use?

Definately XVID 1.0x if you can.

Hm, sorry, that does not work here.

I could see the movies just fine. But that is probably because I had the " Gordian Knot Codec Pack 1.9" installed. You can find it on www.doom9.org for Windows.

The problem is: I can't try it on Windows nor MacOSX, only Linux and BSD. But I guess wmv1 should work on every Windows machine (even older ones).

But I don't know how to encode on BSD (which I think you use).

Thanks for the videos. Wee is an interesting alternative to Rails.

More to come after my holiday :wink:

Regards,

   Michael

···

itsme213@hotmail.com wrote: