Posts Tagged ‘thin’

Release 0.8.2

Sunday, November 30th, 2008

Hey there folks, sorry for the long wait for this release, but it’s here. It’s been a long November for yours truly. I’ve had to find a new job. I’ve had pneumonia. We, at least in America, have celebrated Thanksgiving. And, of course, who can forget RubyConf 2008?

So with that said, what’s in 0.8.2? Honestly, not a whole lot. There are a couple of bug fixes, a button_to_remote (think submit_to_remote in Rails) helper, and deferred routes. More on deferred routes in a moment, as it’s actually a pretty cool feature that only Mack and Merb share. And finally there is bundled gems.

Bundled Gems

What do I mean I say ‘bundled gems’? Well, because of the rather large number of gems that get installed with Mack, and because of some gem version dependency issues, Mack is now bundling it’s third party dependency gems inside itself. For example, mack-facets used to rely on the gems ‘facets’ and ‘english’. Those gems are now bundled inside the mack-facets gem and now longer need to be downloaded and installed by end users. This should make installing Mack super easy. It should also make dealing with having multiple versions of Mack installed on your system easier to deal with and maintain.

Deferred? Routes

So what are deferred routes? Ezra wrote a really great write up back in April. The idea is simple, with newer web servers such as Thin and Ebb, you can tell them to spawn a new thread to handle particular requests, such as long running processes like file uploads. This can really help speed things up as server can process regular requests using an event machine model, which is very fast, but can be really slow and block the server for longer processes. Now those processes can spawn into their own threads and not block the server.

In Mack 0.8.2 you can mark your routes with a deferred? => true option which will trigger this behavior. It’s much more advanced than the similar feature that can be found in Merb, which requires a separate configuration for your deferred actions, and the urls have to be ‘hard coded’. Mack let’s you use all the dynamic power of your routes, like you would want to. It’s just another option on the route itself. For a great tutorial on using deferred routes, check out the following page on www.mackery.com:

http://www.mackery.com/routing/deferred_routes

Upgraded Dependencies

A few gems have been upgraded as part of this release, the big ones include DataMapper to 0.9.7, ActiveRecord to 2.2.2, and Haml to 2.0.4.

Changelog:

  • [#237] Fixed render :rjs throws errors
  • [#236] Upgraded to ActiveRecord 2.2.2
  • [#235] Upgraded to DataMapper 0.9.7
  • [#230] Upgraded to facets 2.4.5
  • [#229] Upgraded to english 0.3.1
  • [#227] Removed WEBrick logging
  • [#226] Bundled gems.
  • [#225] Removed dependency on Thin
  • [#223] Fixed mackery console fails
  • [#148] Added button_to_remote helper method.
  • [#16] Added deferred? routes.
  • gem: active_record 2.2.2
  • gem: data_mapper 0.9.7
  • gem: addressable 2.0.0
  • gem: facets 2.4.5
  • gem: english 0.3.1
  • gem: rspec 1.1.11
  • gem: haml 2.0.4

Release 0.5.5.4

Tuesday, June 10th, 2008

This is actually a combined post about 0.5.5.3 and 0.5.5.4. They are both small patch releases, but they both address some pretty big problems.

0.5.5.3:

The new version of Passenger (aka mod_rails) now has support for Rack based applications. In their documentation they show how to use a Mack app with Passenger. The documentation is based on the yet to be released Thin adapter. With that said, both of those systems use a piece of Mack that’s no longer there. Because of that I’ve restored the small section of code, to make sure those two systems work with Mack. Which is great news.

On some flavors of Unix when you do a Dir.glob you don’t necessarily get back an ordered list of files. Because of that some people we’re getting uninitialized constant errors. This has also been addressed in 0.5.5.3.

0.5.5.4:

A couple of people have reported issues where they were getting the following error even with the most simple application:

“Rack::Lint::LintError: env missing required key QUERY_STRING”

A Mack supporter by the name of Andre Ludwig stepped up to help me try and figure out the problem. I couldn’t reproduce it on the machines I have access to, I suppose that goes without saying, because I could’ve reproduced it, I would’ve fixed it sooner. Anyway, Andre stepped up with both his time, spending most of his Sunday online with me, but also with his hardware. Andre opened up his server to me so I could go in there directly and play with things until I found the problem.

Sure enough, once I got in there, it didn’t take me too long to figure out what the problem was. It turned out to be a conflict between the latest version of Mongrel (1.1.5) and the latest version of Thin (0.8.1). A simple rewrite of the rake server task and voila! problem solved.

So I would like to say thanks so much to Andre Ludwig for all his time and his hardware. I would also like to thank Saji for originally reporting the problem and for doing some troubleshooting for me as well.

As the community grows I can’t help but be awed by not only how much people are loving what Mack is doing, but also by the communities willingness to get involved and help out. Thanks so much everyone!

Changelog 0.5.5.4:

  • Fixed the damn Lint error some people were facing!

Changelog 0.5.5.3:

  • Restored compatibility with Passenger and the next version of Thin.
  • Fixed ‘requires’ out of order in certain flavors or unix. Hopefully.

 

Release 0.4.7

Friday, April 25th, 2008

0.4.7 is a MUST have release. It fixes a few good bugs, like the ability to upload files now works! Plus it introduces a few nice little goodies.

File uploads are now pretty easy to do. There’s a new Mack::Request::UploadedFile that helps to wrap the Hash that Rack gives you when you upload a file. Here’s a simple example of it being used:

class UploadsController < Mack::Controller::Base
  def create
    @my_new_file = request.file(:my_new_file)
    @my_new_file.save_to([MACK_PUBLIC, "uploaded_files", @my_new_file.file_name])
  end
end

That’s it! That’s all you need to upload a file! I’m going to add file uploads to the blog demo over the next few days.

You can now do ‘namespaced’ routes, such as Admin::UserController. You can very simply map them in your routes.rb as:

r.resource "admin/users"

There’s now a new rake task, generator:list, that shows all the generators available to your app.

Darsono Sutedja gets the prize for being the first person, other than myself, to contribute to Mack. Thanks a ton Darsono! It’s much appreciated.

All of the generators now use the Genosaurus generator system. Not really that exciting, but it makes for a nice, cleaner code base.

There’s a few other things in there as well. The changelog below has a few more things. Enjoy!

Changelog:

  • Added Mack::Request::UploadFile class to make dealing with file uploads easy.
  • Fixed bug where if a controller didn’t exist it wasn’t checking the public directory.
  • Generated DataMapper models no longer extend DataMapper::Base, but rather ‘include DataMapper::Persistence’. This corresponds to the 0.9.0 upcoming release of DataMapper.
  • Fixed a bug in request.params that was making file uploads into strings.
  • Namespaced resourced routes, such as Admin::UserController, now work.
  • Added rake generator:list task to list all the available generators.
  • scaffold generator now creates a stub functional test.
  • model generator now creates a stub unit test.
  • Rake tasks in plugins now show up in the Rake tasks list.
  • All generators, including the ‘mack’ binary are now using Genosaurus.
  • [dsutedja] initializer will load MACK_APP/controllers/default_controller.rb if it exists
  • [dsutedja] added link_image_to and image_tag to html helper.
  • gem: thin 0.8.1
  • gem: genosaurus 1.1.1

Thin Adapter

Wednesday, April 23rd, 2008

So yesterday I committed a Mack adapter to Thin. What does this mean? It means that in the next release of Thin there will native support for Mack. That means We can get rid of those silly config/thin.yml and config/thin.ru files. It also means we can make really easy use of all that the ‘thin’ command line executable has to offer.

When the next version of Thin comes out, there will be an update to Mack to support these changes.

Release 0.4.6

Friday, April 18th, 2008

This is a pretty cool release. First off Thin has been updated to 0.8.0, a rather nice, stable release. ERB has been replaced with Erubis to give a significant improvement in speed, which, after all is one of Mack’s most important traits. 

There’s been a general overhaul of the generators included with Mack. Mostly, cleaning them up. With that said things like the scaffold, model, and migration generators have been updated to do what a lot of people have been asking for, that is take a ‘cols’ parameter and build out the generated code corrrectly. This really makes life, very, very simple.

There will be a re-written ‘blog’ tutorial coming out soon to make use of this, as well as migration support that’s now part of Mack.

Very exciting stuff! Enjoy!

Changelog:

  • Mack now uses Erubis, http://www.kuwata-lab.com/erubis/, for it’s rendering engine instead of ERB. This makes Mack even faster now! Yippie!
  • Added rake generate:model name=<model_name> (optional: cols=<col_1>:<col_1_type>,<col_2>:<col_2_type>) This will also create a migration for you.
  • Updated rake generate:migration name=<model_name> (optional: cols=<col_1>:<col_1_type>,<col_2>:<col_2_type>) This will create the proper table migration for you.
  • Updated rake generate:scaffold to use the ModelGenerator now.
  • ScaffoldGenerator now create input fields based on the type of columns, if any, passed in.
  • Overall general refactoring of the generator classes.
  • Fixed a bug with request logging not, well, logging.
  • gem: erubis 2.5.0
  • gem: thin 0.8.0