Thanks to Mack user, Diogo Almeida, there’s a great write up on the wiki on how to configure Apache using mod_rails to host a Mack app. Thanks Diogo.
http://www.mackwiki.com/using_passenger_phusion_to_host_a_mack_application
August 26th, 2008 — General, News
Thanks to Mack user, Diogo Almeida, there’s a great write up on the wiki on how to configure Apache using mod_rails to host a Mack app. Thanks Diogo.
http://www.mackwiki.com/using_passenger_phusion_to_host_a_mack_application
August 26th, 2008 — General, News, Press
Peter Cooper just posted a very nice article about Mack, which features an interview with me, Mark Bates, over on Ruby Inside. Please check it out:
http://www.rubyinside.com/mack-distributed-ruby-web-application-framework-releases-070-1107.html
August 25th, 2008 — General, Releases, Updates
I know that with every release I say something like, “This is a big release”, but the fact of the matter is this is a big release. Amongst the 49 tickets that make up release 0.7.0, there are two in particular that are at the core of Mack’s very existence, they are Distributed Objects and Distributed Views/Layouts.
Back on March 26th Mack 0.4.0 was released. This release brought the first of three large distributed features, Distributed Routes. With 0.7.0 Mack fully realizes it’s goal of making it easy to write fully distributed web applications. There is a very nice wiki page, on our new wiki, that shows in detail how to use the new distributed features. That page can found here. Also, don’t forget to watch the screencast of the new distributed features that can be found here.
Distributed objects allow you to easily distribute access to your library and model code amongst any of your other Mack applications. Allowing this access is as simple as requiring the mack-distributed gem, adding a few lines to your configuration, and starting the mack_ring_server binary. ‘Client’ applications just need to require the mack-distributed gem.
With distributed views and layouts you can now share the look and feel from one application with all of your applications. Configuration and use is just as easy using distributed objects.
People have been requesting more HTML and form helper methods, and we’re more than happy to comply. There are whole bunch of these new methods now to help you more easily build your applications. The generators have been updated to use these new methods, to make your job even easier. There is also now support for doing Date/Time drop downs, similar to Rails and Merb.
Rails folks know ‘tell’ messaging as ‘flash’ messaging and Merb folks know it as ‘message’ messaging. We went with ‘tell’. Tell messages are cleared after any non-redirect request. They’re a great way to send a simple message down to the client.
With this release there is also a new wiki at, http://www.mackwiki.com. This new wiki, incidentally built using Mack 0.7.0, will house all the tutorials and how-to’s for Mack. There are a few entries from the old wiki that still need to brought over during the next day or two.
Changelog:
August 18th, 2008 — General, News, Tutorials
On Monday, August 25th, Mack 0.7.0 will be released. This is an extremely important release for Mack. Why is that you ask? Good question. Well, this is release that finally brings the much talked about distributed feature set to Mack. Distributed routes have been around for quite some time, but distributed views/layouts and distributed objects (models) have been missing. Well, in less than a week, you’ll have them!
Now I know that you’re just as excited about what’s coming as I am, that’s why I’ve prepared the first ever Mack screencast to demostrate these features. The screencast is a little rough around the edges, but it gets the ideas across.
As always I’ll post more about the 0.7.0 as the release date nears. In the meantime enjoy the screencast:
The Mack Distributed Demo Screencast
Here’s the source code.
August 4th, 2008 — General, Releases, Updates
Mack 0.6.1.1 features 38 completed tickets and a whole host of really great features and improvements. Here’s a quick overview of a few of the big features in Mack 0.6.1.1.
There is now a mack-caching gem which gives you easy to use page caching when you require it. To use page caching first you need to add it to your gems.rb file like such:
gem.add "mack-caching", :libs => "mack-caching"
That will require the gem and give your app access to the page caching libraries. Next you to turn on page caching in your application. In the appropriate config/*.yml file add the following:
use_page_caching: true
Now, you just need to tell your controllers which actions they should cache:
class FooController include Mack::Controller cache_pages :only => [:index, :show] end
If you give the cache_pages no optional parameters then it will cache all the actions for that controller. Alternatively, you could give it an :except parameter to list the actions you don’t want cached.
Mack now has a mack-notifier gem that will be the repository for all ‘notification’ systems, the first of which is email. The Mack::Notifier API is simple and easy to use and will allow developers to plugin in different notification systems under the cover without having to change their application code.
A notifier can look as simple as:
class WelcomeEmail include Mack::Notifier end
With that you can then write the following bit of code:
we = WelcomeEmail.new
we.to = "foo@example.com"
we.from = "bar@example.com"
we.subject = "Hello World"
we.body(:text) = "My plain text body"
we.body(:html) = "My html body"
we.attach(Mack::Notifier::Attachment.new("/path/to/my/file"))
we.deliver
Obviously there’s a lot more to the API, including a validations module, but that’s a subject for another post.
The mack-javascript gem now gives you Rails-like RJS support for Mack. The default library to use with mack-javascript is jQuery, but there is prototype support available as well.
Creating faux data for testing can be a real nightmare. Fixtures can be difficult to maintain and trying to create your own faux data can be a chore. That’s where the mack-data_factory gem comes in.
For each model that you want to produce, you will need to define a factory class.
Let’s say that I have 2 models: Item and User, and Item belongs to user. So the factories will look like the following:
class ItemFactory
include Mack::Data::Factory
field :title, "MyItem"
field :owner_id, {:user => 'id'}
end
class UserFactory
include Mack::Data::Factory
field :username, "planters", :length => 25, :content => :alpha
field :password, "roastedPeanuts", :immutable => true
end
So, the 2 classes above defined the factory for item and user. As you can see, each factory will need to explicitly list all the fields that it will populate, and for each field, you can define rules on how the content is generated.
Supported content types:
Changelog: