! camping 1.5 + markaby 0.5

why the lucky stiff why at whytheluckystiff.net
Tue Oct 3 17:33:37 EDT 2006


Not too different from their corresponding last releases, but documentation
has been filled in for both.

To upgrade:

  gem install camping --source code.whytheluckystiff.net

And, here is a complete changelog:

== Camping 1.5
* Camping::Apps stores an array of classes for all loaded apps.
* bin/camping can be given a directory. Like: <tt>camping examples/</tt>
* Console mode -- thank zimbatm. Use: camping -C yourapp.rb
* Call controllers with Camping.method_missing.

    Tepee.get(:Index) #=> (Response)
    Blog.post(:Delete, id) #=> (Response)

    Blog.post(:Login, :input => {'username' => 'admin', 'password' =>
'camping'})
      #=> #<Blog::Controllers::Login @user=... >

    Blog.get(:Info, :env => {:HTTP_HOST => 'wagon'})
      #=> #<Blog::Controllers::Info @env={'HTTP_HOST'=>'wagon'} ...>

* Using \r\n instead of \n on output. FastCGI has these needs.
* ActiveRecord no longer required or installed.
* If you refer to Models::Base, however, ActiveRecord will be loaded with
autoload. (see lib/camping/db.rb)
* new Camping::FastCGI.serve which will serve a whole directory of apps
  (see http://code.whytheluckystiff.net/camping/wiki/TheCampingServer)
* ~/.campingrc can contain database connection info if you want your default to
be something other than SQLite.    

    database:
      adapter: mysql
      username: camping
      socket: /tmp/mysql.sock
      password: NOFORESTFIRES
      database: camping

* controllers are now *ordered*. uses the inherited hook to keep track of all
  classes created with R. those classes are scanned, in order, when a request is
  made. any other controllers are handled first. so if you plan on overriding
the
  urls method, be sure to subclass from R().
* Console mode will load .irbrc in the working directory, if present.
  (for example, in my ~/git/balloon directory, i have this in the .irbrc:
  include Balloon::Models
  when camping -C balloon.rb gets run, the models all get included in main.)
* And, of course, many other bugfixes from myself and the loyal+kind zimbatm...
* Markaby updated to 0.5. (See its CHANGELOG.)

== Markaby 0.5
* XHTML Validation built in.  So, if you have an invalid tag: error.  Invalid
attribute: error.
  And two identical IDs in the same document: error.  Optional, of course.  But
handy!
* New Markaby::Fragment class adds much flexibility.  If it discovers you are
using a tag as a string,
  the tag is removed from the stream.  (<tt>div { strong("Real") + " Giraffes"
}</tt>)
* The prevailing rule now is: if you want it escaped, pass it to a block.  If
not, pass it as an arg.
* Again, escaped: <tt>h1("Me & You Have a Giraffe")</tt>
* And, not escaped: <tt>h1 { "<a href='/'>Home</a>" }</tt>
* Less method_missing, meaning: faster calls all around.  Tag methods generated
based on doctype.
* The <tt>html</tt> method doesn't write the doctype tags and meta tags.  You
must use <tt>xhtml_transitional</tt> or <tt>xhtml_strict</tt> methods to do
that.
* The <tt>img</tt> method doesn't try to inject an empty alt tag and a zero
border.  No more of that.

_why


More information about the Camping-list mailing list