<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8154405164851174558</id><updated>2018-08-28T11:13:44.157-07:00</updated><category term="merb merbful_authentication"/><category term="merb"/><category term="merbunity merb"/><title type='text'>this.blog</title><subtitle type='html'>Assorted Stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hassox.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-7955805853601205288</id><published>2008-05-12T07:33:00.000-07:00</published><updated>2008-05-12T08:00:06.101-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="merbunity merb"/><title type='text'>Great Reception for Merbunity</title><content type='html'>Wow.  I&#39;m feeling really grateful for the response to &lt;a href=&quot;http://merbunity.com&quot;&gt;merbunity&lt;/a&gt; going live yesterday.  A bunch of people have signed up, and hopefully busy writing tutorials to show off their &lt;a href=&quot;http://merbivore.com&quot;&gt;merb&lt;/a&gt; skills.&lt;br /&gt;&lt;br /&gt;It really is humbling to get such a reception for merbunity.com, and it gives me great hope that the site is really going to be great.  Now, lets get some great tutorials and such out into the merbunity ;)  Heh... that&#39;s a lot of great!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/7955805853601205288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/7955805853601205288'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/05/great-reception-for-merbunity.html' title='Great Reception for Merbunity'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-5486784282710554772</id><published>2008-05-11T10:11:00.000-07:00</published><updated>2008-05-11T10:25:18.606-07:00</updated><title type='text'>Merbunity Is Live</title><content type='html'>Lets face it.  Merb, for all it&#39;s goodies lacks good documentation at the moment.  It&#39; lacks a nice easy path to help beginners get into it.  &lt;br /&gt;&lt;br /&gt;I&#39;ve been working on a site for a while to address this, and even though it&#39;s not finished, Merb&#39;s need for documentation is just too great. &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://merbunity.com&quot;&gt;Merbunity&lt;/a&gt; is a Merb commUnity site for all things Merb.  Currently active are News, Tutorials, and Screencasts.&lt;br /&gt;&lt;br /&gt;This is really a community site.  It relies on the community writing the tutorials, screencasts, making the news announcements.  There is other stuff on the cards, but for now I thought I&#39;d get this out. &lt;br /&gt;&lt;br /&gt;To try and keep the site of a high standard, it implements a peer review system.  When you sign up, you can write all the tutorials and screencasts you like.  When you decide that they&#39;re good enough, you can publish them, But...  at that point they&#39;re not really published.  They&#39;re &#39;Pending&#39;.  They need someone who is a &quot;Publisher&quot; to authorize them.  &lt;br /&gt;&lt;br /&gt;So the basic flow is, you write a tutorial or screencast, publish it, it becomes pending.  At that point, you can have discussions with publishers about any tweaks that may be necessary.  Once they&#39;re happy with it, they publish it for real, and it&#39;s live on the site.  Don&#39;t worry though.  You don&#39;t have to worry about that for ever... That would suck.  Once you&#39;ve published 3 &quot;things&quot; you become a publisher yourself, and you can publish others work, as well as your own.&lt;br /&gt;&lt;br /&gt;When your a publisher you can also put up news on the site.  &lt;br /&gt;&lt;br /&gt;Tutorials and screencasts can be about anything you like, provided they are relevant to the Merb community.  They could be about Merb, ORMS&#39;s upcoming tech, specs, whatever.  &lt;br /&gt;&lt;br /&gt;It really is up to us to make Merb great, and I think this will be a good place we can focus on. &lt;br /&gt;&lt;br /&gt;Work is ongoing on the site to make it better all the time.   Kudo&#39;s to &lt;a href=&quot;http://mr-eel.com&quot;&gt;Luke Sutton&lt;/a&gt; for a great site design.  If there&#39;s any glitches in it, I&#39;m sure it&#39;s my fault since I just *had* to play with it ;)&lt;br /&gt;&lt;br /&gt;To get you started, I&#39;ve posted a detailed &lt;a href=&quot;http://merbunity.com/tutorials/1&quot;&gt;tutorial of how to submit tutorials and screencasts&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Well, I&#39;ll step out of the way now.  I hope we can use this to help people make the most of the awesomeness that is Merb :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/5486784282710554772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/5486784282710554772'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/05/merbunity-is-live.html' title='Merbunity Is Live'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-3390462170453542489</id><published>2008-04-18T19:33:00.001-07:00</published><updated>2008-04-18T19:34:31.761-07:00</updated><title type='text'>Looking for Powered by Merb Button Creator</title><content type='html'>A while ago  a very kind soul created a &quot;Powered by Merb&quot; button for my site &lt;a href=&quot;http://postb.ag&quot;&gt;Postb.ag&lt;/a&gt;.  For the life of me I can&#39;t remember who it was though.  If you see this.  Please get a hold of me :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/3390462170453542489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/3390462170453542489'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/04/looking-for-powered-by-merb-button.html' title='Looking for Powered by Merb Button Creator'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-1692364248197991687</id><published>2008-04-06T17:46:00.001-07:00</published><updated>2008-04-06T17:49:23.342-07:00</updated><title type='text'>I&#39;ve Moved!</title><content type='html'>Well it sure has been a long time coming.  I&#39;ve finally moved jobs to Engine Yard :)  It took me a while to finish up at my old job, but it&#39;s finally over.&lt;br /&gt;&lt;br /&gt;I&#39;m moving into Engine Yard as an Application Support Engineer and I&#39;ve gotta say I&#39;m super excited about working with such a great bunch of people.  That and working with Ruby full time :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/1692364248197991687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/1692364248197991687'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/04/ive-moved.html' title='I&#39;ve Moved!'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-8667270246880749432</id><published>2008-03-31T20:28:00.000-07:00</published><updated>2008-03-31T20:35:25.123-07:00</updated><title type='text'>Great To See This Kind of Appreciation</title><content type='html'>I&#39;m a bit of a fan of &lt;a href=&quot;http://datamapper.org&quot;&gt;DataMapper&lt;/a&gt;, and today even more so.  &lt;br /&gt;&lt;br /&gt;The site design for datamapper.org was very kindly donated by &lt;a href=&quot;http://mr-eel.com/&quot;&gt;Luke Sutton&lt;/a&gt; aka unagi-san.  He did the design as a way to contribute to datamapper, and it sure does make it nice.  Not only did he do the original design for it, he continues to work on it, donating his time and talent to a great project.  &lt;br /&gt;&lt;br /&gt;Well.  Today Sam Smoot, the father of DataMapper has setup a &lt;a href=&quot;http://pledgie.com/campaigns/612&quot;&gt;pledgie&lt;/a&gt; as a way to recognize the hard work, and say thanx. I think it&#39;s an awesome way for the community to help out a designer that&#39;s helped out the community.  If you can spare a few dollars and like the project why not get in on it.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/8667270246880749432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/8667270246880749432'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/03/great-to-see-this-kind-of-appreciation.html' title='Great To See This Kind of Appreciation'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-4158303344146418236</id><published>2008-03-26T04:39:00.000-07:00</published><updated>2008-03-26T04:44:11.881-07:00</updated><title type='text'>Introducing Whistler</title><content type='html'>With all the posts about merbful_athentication lately, you&#39;d think that was all I was working on.  It&#39;s not quite the case.  A lot of it isn&#39;t looking like going OS, but I&#39;ve been able extract something from one of my project.&lt;br /&gt;&lt;br /&gt;Whistler is a markup white list filter.  It&#39;s based on the specs of Rick Olson&#39;s WhiteList rails plugin and runs on hpricot.  &lt;br /&gt;&lt;br /&gt;Usage is super simple.  You can either include it into your model, or use it directly.&lt;pre&gt;Whistler.white_list(markup_string)&lt;/pre&gt;That&#39;s it.  There are ways of using different tags and attributes on each call.  Check out the source at http://github.com/hassox/whistler</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4158303344146418236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4158303344146418236'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/03/introducing-whistler.html' title='Introducing Whistler'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-721750947264267444</id><published>2008-03-26T04:35:00.000-07:00</published><updated>2008-03-26T04:38:27.736-07:00</updated><title type='text'>Merbful Authentication 0.9.2</title><content type='html'>I&#39;ve just put up a bugfix for merbful_authentication because there was a method name clash in merb-gen.  This is really a very small fix.  It also includes a couple of other minor fixes.  &lt;br /&gt;&lt;br /&gt;You can get the latest from rubyforge.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/721750947264267444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/721750947264267444'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/03/merbful-authentication-092.html' title='Merbful Authentication 0.9.2'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-3346403872235978092</id><published>2008-03-05T04:40:00.000-08:00</published><updated>2008-03-05T04:56:37.148-08:00</updated><title type='text'>Merbful Authentication 0.9.1</title><content type='html'>After a buggy start, and no Test::Unit support, the new MerbfulAuthentication is here.  &lt;br /&gt;&lt;br /&gt;This release is a little experimental at the moment.  I mean, it&#39;s more robust in the way it handles the dependencies, but there is one area I&#39;d really like some feedback.&lt;br /&gt;&lt;br /&gt;To minimise the setup and configuration required, I&#39;ve taken some liberty with this release.  There was an issue where with the way I had the routes in 0.9.0, when the router was reloaded because of a change, the AuthenticatedSystem routes were wiped out.  Also there was requires and dependencies still fairly well littered throughout the code.&lt;br /&gt;&lt;br /&gt;To accomplish this, I&#39;ve taken the liberty of writing some configuration information into the config/init.rb and config/routes.rb files.  This will add the lines when you generate, if they are not already there.  It won&#39;t be destructive, and you can just remove them if you want. &lt;br /&gt;&lt;br /&gt;I&#39;d really like some feedback to see if ppl don&#39;t like this.  I can&#39;t see it causing trouble.  But that doesn&#39;t mean ppl will like it ;)&lt;br /&gt;&lt;br /&gt;So have a crack and let me know what you think :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/3346403872235978092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/3346403872235978092'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/03/merbful-authentication-091.html' title='Merbful Authentication 0.9.1'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-3435670457953236608</id><published>2008-02-27T03:24:00.001-08:00</published><updated>2008-02-27T03:52:48.753-08:00</updated><title type='text'>Merbful Authentication Initial Merb 0.9 Support</title><content type='html'>It&#39;s ready for a first off flogging.  A huge thanx to Shay Arnett of &lt;a href=&quot;http://merborials.com&quot;&gt;merborials.com&lt;/a&gt; fame for all the great help in getting it going, along with plenty of others how have given support and hacks to get the plugin going.  Merbful Authentication, the authentication generators based on &lt;a href=&quot;http://technoweenie.net&quot;&gt;RickOlsons&lt;/a&gt; cool restful_authentictaion plugin is ready for a first cracking.  Please bear in mind that Merb 0.9 is still in it&#39;s infancy and so is this gem.  It needs to be flogged so it can be solid.  Having said that, it seems to be solid, but... well, you know...&lt;br /&gt;&lt;br /&gt;There are not too many changes from before, mostly spec updates, and internal updates that only really affect the generators to use merb-gen.&lt;br /&gt;&lt;br /&gt;Unfortunately test unit support is...  well  the test unit tests aren&#39;t working atm.  RSpec ones work, and all the specs should function correctly.  The specs are fairly complete tho so I have at least some confidence that the plugin is working :)&lt;h2&gt;Git it&lt;/h2&gt;&lt;br /&gt;The repo has now been fully moved over to git.  I&#39;m not planning on updating the SVN repo.  Of course if there are people that really want to use the SVN repo, I&#39;ll push it over there.&lt;br /&gt;&lt;br /&gt;To get merbful_authentication just&lt;pre&gt;sudo gem install merbful_authentication&lt;/pre&gt;or get it from my git repo.&lt;pre&gt;git clone git://github.com/hassox/restful-authentication.git&lt;br /&gt;cd restful-authentication&lt;br /&gt;git checkout -b merbful_authentication origin/merbful_authentication&lt;br /&gt;rake install&lt;/pre&gt;&lt;h2&gt;How to use it&lt;/h2&gt;&lt;pre&gt;merb-gen authenticated user_model session_controller [--include-activation]&lt;/pre&gt;The only required argument is the &lt;tt&gt;user model&lt;/tt&gt;.  The sessions controller will default to Sessions.  If you use the &lt;tt&gt;--include-activation&lt;/tt&gt; mailers and required code will also be included.&lt;h2&gt;What&#39;s different?&lt;/h2&gt;Well, besides the internals of the gem being simplified, there has been some changes to the generated files themselves.&lt;ul&gt;&lt;br /&gt;&lt;li&gt;There isn&#39;t the mess of dependency and require statements anymore.  There is a require on 1 file &lt;tt&gt;lib/authenticated_system/authenticated_system_dependencies.rb&lt;/tt&gt;  All the dependencies are listed in here.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The required routes are now in the &lt;tt&gt;lib/authenticated_system/authenticated_system_routes.rb&lt;/tt&gt; file.  They are automatically &lt;em&gt;&lt;strong&gt;prepend&lt;/strong&gt;&lt;/em&gt;ed to you routes once the app has started.  So now you can just start using them :)&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;That&#39;s really it.  The other changes are in the structure of the gem itself, and just a couple of small tweaks to get the syntax right for 0.9.&lt;br /&gt;&lt;br /&gt;I hope this release will be relatively bug free, but if you do have any issues, catch me in #merb, or shoot me an email has.sox [at] gmail DOT c o m</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/3435670457953236608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/3435670457953236608'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/02/merbful-authentication-initial-merb-09.html' title='Merbful Authentication Initial Merb 0.9 Support'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-2782830568756795122</id><published>2008-01-27T18:45:00.000-08:00</published><updated>2008-01-27T19:11:51.836-08:00</updated><title type='text'>Merb Supports rSpec Text Stories</title><content type='html'>Today I managed to release a new plugin for merb that provides &lt;em&gt;basic&lt;/em&gt; support for &lt;a href=&quot;http://rspec.info/&quot;&gt;rSpecs text stories&lt;/a&gt;.  It&#39;s a bit experimental at the moment so if you want to pitch in and get it going smooth, come on down ;)&lt;br /&gt;&lt;br /&gt;I have been hanging onto it for a little while, but I keep trying to get into the release early and often philosophy.&lt;h2&gt;Get It&lt;/h2&gt;Like all merb plugins, this one is a gem.  You can get it from gem&lt;pre&gt;sudo gem install merb_stories&lt;/pre&gt;You can get it from source&lt;pre&gt;svn checkout svn://rubyforge.org/var/svn/merb-plugins/merb_stories&lt;br /&gt;cd merb_stories&lt;br /&gt;rake install&lt;/pre&gt;&lt;h2&gt;Usage&lt;/h2&gt;At it&#39;s heart merb_stories is almost just a generator, but you do need to add it as a dependency to get going with it.  You can safely remove it when you deploy, but for now it needs to be there to run the stories.&lt;h3&gt;Generate A Story&lt;/h3&gt;In your Merb.root&lt;pre&gt;ruby script/generate story my_story&lt;/pre&gt;This will generate all the support files, if they&#39;re missing, and also the story, story steps etc.&lt;br /&gt;&lt;br /&gt;If you want to organise your stories a bit more, you can put them into sub-directories.&lt;pre&gt;ruby script/generate story story_group/story&lt;/pre&gt;You can go as deep as you like with the directories.&lt;h3&gt;Running Your Stories&lt;/h3&gt;It&#39;s really simple to run your stories.  merb_stories supplies a rake task to remove any pain you might have.&lt;pre&gt;rake story[my_story]&lt;/pre&gt;or if you used subdirectories&lt;pre&gt;rake story[story_group/my_story]&lt;/pre&gt;You can also just run all of them at once.&lt;pre&gt;rake story[all]&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Thats really about all there is to it.  To check out what to use stories for checkout the &lt;a href=&quot;http://rspec.info/&quot;&gt;rSpec site&lt;/a&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/2782830568756795122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/2782830568756795122'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/01/merb-supports-rspec-text-stories.html' title='Merb Supports rSpec Text Stories'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-101123250123731761</id><published>2008-01-18T06:19:00.001-08:00</published><updated>2008-01-18T06:51:53.172-08:00</updated><title type='text'>Cool Stuff with the Merb Router</title><content type='html'>Today I found out something I didn&#39;t know about the merb router when looking for routing to subdomains.&lt;br /&gt;&lt;br /&gt;I&#39;ve got a route that looks like this:&lt;pre&gt;  r.match(:first_subdomain =&gt; &quot;:account_name&quot;) do |k|&lt;br /&gt;    k.match(&quot;/:controller/:action&quot;) #any old route match really&lt;br /&gt;  end&lt;/pre&gt;That will put the value of the first subdomain into &lt;tt&gt;params[:account_name]&lt;/tt&gt;.  Hang on though... That doesn&#39;t work by default.&lt;h2&gt;How Is It So!!!?!!?&lt;/h2&gt;Well it turns out that when you pass a hash to r.match it uses the hash keys as method calls to the request object.  It then compares the values returned to the ones you specify.  &lt;br /&gt;&lt;br /&gt;So you can have heaps of mini matchers in you matcher and all you have to do is specify a method on the request object and then use that method name as a hash key in the match.  This is probably a bit dangerous so be careful with it.  In this example this does the job at the top of the route file&lt;pre&gt;module Merb&lt;br /&gt;  class Request&lt;br /&gt;    def first_subdomain&lt;br /&gt;      subdomains.first&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/101123250123731761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/101123250123731761'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/01/cool-stuff-with-merb-router.html' title='Cool Stuff with the Merb Router'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-7051738952170628822</id><published>2008-01-18T04:37:00.000-08:00</published><updated>2008-01-18T06:53:03.089-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="merb merbful_authentication"/><title type='text'>Merbful Authentication Update</title><content type='html'>There have been a couple of little teething problems with the &lt;a href=&quot;http://hassox.blogspot.com/2008/01/merbful-authentication-is-born.html&quot;&gt;merbful_authentication&lt;/a&gt; gem, mostly because it&#39;s not automatically available to your app when you run the generators.  There&#39;s  all that you had to do to get going which really bugged me.&lt;h2&gt;The Skinny&lt;/h2&gt;To setup your newly generated Authenticated user, now all you need to do is setup the routes.  (and the mailer if your using activation).  All the including and dependency is taken care of for you.  This is current as of 0.1.2. If you care about why and how... read on.&lt;h2&gt;Why and How&lt;/h2&gt;The main issues were with the controllers not having the mixin by default.  Then when you try and include it you have to make it a dependency.  Not very nice...  I also kept getting tripped up on the merb_helpers dependency too.&lt;br /&gt;&lt;br /&gt;Well you&#39;ll be pleased to know that now, when you generate an authenticated user and you app loads, all the authenticated system is mixed into Application.  The controller that your controllers should all inherit from.  So it&#39;s now available to all your controller automatically :)  &lt;br /&gt;&lt;br /&gt;Also merb_helpers has been made a dependency where it&#39;s needed, and also a dependency on the gem so you don&#39;t have to worry about it.  Ahhh... gem plugins are so nice like that.&lt;br /&gt;&lt;br /&gt;It&#39;s up on rubyforge so sudo gem install merbful_authentication should do the job.&lt;br /&gt;&lt;br /&gt;If you want source with that see &lt;a href=&quot;http://hassox.blogspot.com/2008/01/merbful-authentication-is-born.html&quot;&gt;my other post&lt;/a&gt; for instructions on where to get it.&lt;br /&gt;&lt;br /&gt;Happy Hacking!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/7051738952170628822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/7051738952170628822'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/01/merbful-authentication-update.html' title='Merbful Authentication Update'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-661733249032287003</id><published>2008-01-11T07:57:00.000-08:00</published><updated>2008-01-11T08:02:49.861-08:00</updated><title type='text'>Dynaically Setup Rake Tasks</title><content type='html'>This is probably really old news.  I just setup my first rake task tonight though so I thought I&#39;d put it up here.  This is more for myself really so if it&#39;s not your cup of tea turn away now.&lt;br /&gt;&lt;br /&gt;I&#39;ve been playing with rSpec&#39;s text stories in Merb but I couldn&#39;t find a way to make a rake task that would take an argument for a particular story to run.  e.g.&lt;pre&gt;rake story:run my_story&lt;/pre&gt;So I&#39;ve done the next best thing.  I scan my directory for story files and create the rake tasks dynamically.  Now I can use:&lt;pre&gt;rake story:run:my_story&lt;/pre&gt;  As well as &lt;pre&gt;rake story:run:all&lt;/pre&gt;The code to make this dream a reality is &lt;pre&gt;# Allows all found stories to be run individually by using&lt;br /&gt;# rake story:run:story_name&lt;br /&gt;namespace :story do&lt;br /&gt;  namespace :run do&lt;br /&gt;    all_stories = []&lt;br /&gt;    Dir.glob(&#39;stories/stories/**/*.rb&#39;).each do |path|&lt;br /&gt;      story = path.split(&quot;/&quot;).last[0..-4]&lt;br /&gt;      desc &quot;Run spec story #{story}&quot;&lt;br /&gt;      task &quot;#{story}&quot;.to_sym do&lt;br /&gt;        sh %{ruby stories/stories/#{story}.rb}&lt;br /&gt;      end&lt;br /&gt;      all_stories &lt;&lt; story&lt;br /&gt;    end&lt;br /&gt;    &lt;br /&gt;    desc &#39;Run all stories&#39;&lt;br /&gt;    task :all do&lt;br /&gt;      all_stories.each do |story|&lt;br /&gt;        puts &lt;br /&gt;        sh %{ruby stories/stories/#{story}.rb}&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/661733249032287003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/661733249032287003'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/01/dynaically-setup-rake-tasks.html' title='Dynaically Setup Rake Tasks'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-6643809185392209784</id><published>2008-01-07T04:39:00.000-08:00</published><updated>2008-01-07T04:43:49.009-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="merb merbful_authentication"/><title type='text'>Merbful Authentication Update 0.1.1</title><content type='html'>Well, it&#39;s been out in the wild for a couple of days now, and there is at least one glaring error in the merbful_authentication code.  The generator is called &quot;authentication&quot; instead of &quot;authenticated&quot; not too good for a port.  That&#39;s changed now.  Also there is some changes to give nice error messages when no ORM is selected or sequel is selected.&lt;br /&gt;&lt;br /&gt;If you want to get the update you can get it the &lt;a href=&quot;http://hassox.blogspot.com/2008/01/merbful-authentication-is-born.html&quot;&gt;same as before&lt;/a&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/6643809185392209784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/6643809185392209784'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/01/merbful-authentication-update-011.html' title='Merbful Authentication Update 0.1.1'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-8059421517330807706</id><published>2008-01-04T06:35:00.000-08:00</published><updated>2008-01-04T19:29:38.729-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="merb merbful_authentication"/><title type='text'>Merbful Authentication is Born</title><content type='html'>Hooray... The initial release of &lt;a href=&quot;http://rubyforge.org/projects/merbful-auth/&quot;&gt;merbful_authentication&lt;/a&gt; is cooked.  It took a bit longer than I thought it would, mainly thanx to my unfamiliarity with test_unit.  Well, that and I was away over the christmas holidays.  &lt;br /&gt;&lt;br /&gt;At the moment there is support for Datamapper and Activerecord ORM&#39;s.  Hopefully Sequel will follow soon.&lt;h2&gt;How to get it&lt;/h2&gt;The gem has been released on rubiforge, so the usual should do the trick&lt;pre&gt;sudo gem install merbful_authentication&lt;/pre&gt;If you want source with that.  &lt;br /&gt;&lt;br /&gt;Git:&lt;pre&gt;git clone git://activereload.net/restful_authentication.git merbful_authentication.git&lt;br /&gt;git checkout -b local/merbful_authetication origin/merbful_authentication&lt;/pre&gt;Or SVN&lt;pre&gt;svn co svn://rubyforge.org/var/svn/merbful-auth&lt;/pre&gt;From either of these you can package and install the gem&lt;pre&gt;rake package&lt;br /&gt;sudo gem install pkg/merbful_authentication-0.1.0.gem&lt;/pre&gt;&lt;h2&gt;Usage&lt;/h2&gt;It has the same usage as restful_authentication, without the stateful stuff.  So (from README)&lt;pre&gt;To use:&lt;br /&gt;&lt;br /&gt;  ./script/generate authenticated user sessions \&lt;br /&gt;  --include-activation&lt;br /&gt;&lt;br /&gt;The first parameter specifies the model that gets created in signup&lt;br /&gt;(typically a user or account model).  A model with migration is &lt;br /&gt;created (if migrations are available), as well as a basic controller with the create method.&lt;br /&gt;&lt;br /&gt;The second parameter specifies the sessions controller name.  This is&lt;br /&gt;the controller that handles the actual login/logout function on the &lt;br /&gt;site.&lt;br /&gt;&lt;br /&gt;The third parameter (--include-activation) generates the code for a &lt;br /&gt;Mailer and the required support code.  Don&#39;t forget to setup your mailer for this.&lt;/pre&gt;&lt;h2&gt;Required Setup&lt;/h2&gt;Unfortunately there is some setup required.  At the moment, some named routes are required.  You can set these up in you &lt;tt&gt;config/router.rb&lt;/tt&gt;&lt;pre&gt;      r.resources :users&lt;br /&gt;      r.match(&quot;/login&quot;).to(:controller =&gt; &quot;Sessions&quot;, :action =&gt; &quot;create&quot;).name(:login)&lt;br /&gt;      r.match(&quot;/logout&quot;).to(:controller =&gt; &quot;Sessions&quot;, :action =&gt; &quot;destroy&quot;).name(:logout)&lt;br /&gt;      r.match(&quot;/users/activate/:activation_code&quot;).to(:controller =&gt; &quot;Users&quot;, :action =&gt; &quot;activate&quot;).name(:user_activation)&lt;/pre&gt;That last one is only required if you include activation.  Don&#39;t forget to setup your mailer configs if your using it too.&lt;br /&gt;&lt;br /&gt;Also, you need to have merb_helpers installed.  This is for the form generation stuff.  In &lt;tt&gt;config/dependencies.rb&lt;/tt&gt;&lt;pre&gt;dependency &quot;merb_helpers&quot;&lt;/pre&gt;All crit, comments, bug reports, patches are welcome.  Patches are more welcome of course ;)&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Update: You will need to install merb and merb_helpers from trunk until the official 0.5 gem for merb comes out.&lt;/em&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/8059421517330807706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/8059421517330807706'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2008/01/merbful-authentication-is-born.html' title='Merbful Authentication is Born'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-3085517656758478193</id><published>2007-12-19T00:24:00.000-08:00</published><updated>2007-12-19T01:17:57.005-08:00</updated><title type='text'>Generate Merb Plugins and Generators</title><content type='html'>As part of my effort to port over restful_authentication I&#39;m at the point where I want to start making a &lt;a href=&quot;http://merbivore.com/&quot;&gt;merb&lt;/a&gt; plugin gem out of it.  This will of course include some generators for merb and &lt;a href=&quot;http://datamapper.org&quot;&gt;datamapper&lt;/a&gt;.  Later I&#39;ll add the &lt;a href=&quot;http://rubyonrails.com&quot;&gt;Active Record&lt;/a&gt; generators.  This is super simple thanx to Rubigen&lt;br /&gt;&lt;br /&gt;Just today I went to start and found the merb plugin generator wasn&#39;t able to generate generators.  Now just to move on from that fairly circular sentence, a quick call to &lt;a href=&quot;http://drnicwilliams.com/&quot;&gt;DrNic&lt;/a&gt; and he had it sorted pretty quickly.  The end result is, that as of today, you&#39;ll need to install merb from trunk to follow this.  That or wait until merb 0.5.0 is released officially.&lt;h2&gt;Generate a Merb Plugin&lt;/h2&gt;Merb comes with an option to build the skeleton of a plugin inside the &lt;tt&gt;merb&lt;/tt&gt; command.&lt;pre&gt;$ merb -P merbful_authentication&lt;br /&gt;      create  &lt;br /&gt;      create  lib/merbful_authentication&lt;br /&gt;      create  spec&lt;br /&gt;      create  Rakefile&lt;br /&gt;      create  README&lt;br /&gt;      create  LICENSE&lt;br /&gt;      create  TODO&lt;br /&gt;      create  spec/spec_helper.rb&lt;br /&gt;      create  spec/merbful_authentication_spec.rb&lt;br /&gt;      create  lib/merbful_authentication.rb&lt;br /&gt;      create  lib/merbful_authentication/merbtasks.rb&lt;br /&gt;  dependency  install_rubigen_scripts&lt;br /&gt;      create    script&lt;br /&gt;      create    script/generate&lt;br /&gt;      create    script/destroy&lt;/pre&gt;As you can see it&#39;s very simple to generate a merb plugin.  You could call &lt;tt&gt;rake gem&lt;/tt&gt; in that directory and it will build the gem for you automatically.&lt;br /&gt;&lt;br /&gt;From here it&#39;s just like any other gem.  When you add new files, be sure to add them to the gemspec in the Rakefile.  &lt;br /&gt;&lt;br /&gt;For the specific case of merbful_authentication, I want to have a generator that is available for all merb projects,  and also generators with the relevant code for datamapper, activerecord, and sequel.  This is a pretty important way to help support merb&#39;s ORM agnosticness.&lt;br /&gt;&lt;br /&gt;Merb makes use of rubigen scopes.  All merb projects have the &lt;tt&gt;merb&lt;/tt&gt; scope and  in your app when you select which orm to use via &lt;tt&gt;use_orm&lt;/tt&gt; the ORM scope is selected automatically.  The available scopes in a merb application at the moment are&lt;ul&gt;&lt;br /&gt;&lt;li&gt;merb&lt;/li&gt;&lt;br /&gt;&lt;li&gt;merb_default - (used when no orm is selected)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;datamapper&lt;/li&gt;&lt;br /&gt;&lt;li&gt;sequel&lt;/li&gt;&lt;br /&gt;&lt;li&gt;activerecord&lt;/li&gt;&lt;br /&gt;&lt;li&gt;rspec&lt;/li&gt;&lt;br /&gt;&lt;li&gt;test_unit&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;The merb scope is available in all merb projects, with the others available as selected.  By default the rspec library is the testing scope that is available. &lt;h2&gt;How to Use Scopes?&lt;/h2&gt;When you make your generators, you should apply a scope to them.  What this does is allows your gem to behave itself according to the configuration the user has setup.  The way I&#39;ll setup the generators structure in merbful_authentication will be:&lt;ul&gt;&lt;br /&gt;&lt;li&gt;merb_generators&lt;br /&gt;  &lt;ul&gt;&lt;li&gt;authentication_generator&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;datamapper_generators&lt;br /&gt;  &lt;ul&gt;&lt;li&gt;authentication_model_generator&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;activerecord_generators&lt;br /&gt; &lt;ul&gt;&lt;li&gt;authentication_model_generator&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;rspec_generators&lt;br /&gt;  &lt;ul&gt;&lt;li&gt;authentication_testing_generator&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;test_unit_generators&lt;br /&gt;  &lt;ul&gt;&lt;li&gt;authentication_testing_generator&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;The final names that I end up with might be different, but this is the general structure I will use.  &lt;br /&gt;&lt;br /&gt;Why this is useful, is that the merb generators are always available, so we can always call the &lt;tt&gt;authentication&lt;/tt&gt; generator in a merb app.  This in turn will have a dependency on the &lt;tt&gt;authentication_model&lt;/tt&gt; generator.  This is where the magic happens.  So if the app has:&lt;br /&gt;&lt;br /&gt;Scope : datamapper&lt;br /&gt;  The &lt;tt&gt;authentication_model&lt;/tt&gt; generator defined in datamapper_generators will be active and therefore used.&lt;br /&gt;&lt;br /&gt;Scope : activerecord&lt;br /&gt;  The &lt;tt&gt;authentication_model&lt;/tt&gt; generator defined in activerecord_generators will be active and used instead&lt;br /&gt;&lt;br /&gt;This is the way merb generators support the different syntaxes of models and controllers when you use &lt;tt&gt;script/generate resource&lt;/tt&gt; or similar.  The testing frameworks will work the same way.&lt;h2&gt;How to Generate a Generator with Scope&lt;/h2&gt;To generate your generator with the required scope, it is really simple.  In the root directory of your generated plugin:&lt;pre&gt;$ ruby script/generate component_generator authentication merb&lt;br /&gt;      create  merb_generators/authentication/templates&lt;br /&gt;      create  test&lt;br /&gt;      create  merb_generators/authentication/authentication_generator.rb&lt;br /&gt;      create  test/test_authentication_generator.rb&lt;br /&gt;      create  test/test_generator_helper.rb&lt;br /&gt;      create  merb_generators/authentication/USAGE&lt;/pre&gt;There are also a whole heap of instructions on what to do next that are put up on the screen.  &lt;br /&gt;&lt;br /&gt;This will generate the &lt;tt&gt;authentication&lt;/tt&gt; generator in the &lt;tt&gt;merb&lt;/tt&gt; scope.    See the &lt;a href=&quot;http://rubigen.rubyforge.org/&quot;&gt;documentation for rubigen&lt;/a&gt; to see how to use your shiny new generator.  It&#39;s pretty much the same that you&#39;d do for rails.  &lt;br /&gt;&lt;br /&gt;So then to make the datamapper generator&lt;pre&gt;ruby script/generate component_generator authentication_model datamapper&lt;/pre&gt;I don&#39;t want this to show in the list of available generators when you run &lt;tt&gt;ruby script/generate&lt;/tt&gt; so I will delete the USAGE file to prevent it showing up in that list.&lt;br /&gt;&lt;br /&gt;Inside the merbful_authentication.rb (your_plugin.rb) file is the place to put your hook script.  Similar to the init.rb file in rails plugins.  &lt;br /&gt;&lt;br /&gt;A note about plugins in general for merb.  To mixin behavior to views and controllers you would include into and extend:&lt;br /&gt;&lt;br /&gt;Views:-  &lt;tt&gt;Merb::ViewContext&lt;/tt&gt; (class)&lt;br /&gt;&lt;br /&gt;Controllers:- &lt;ul&gt;&lt;br /&gt;&lt;li&gt;All controllers - Merb::AbstractController&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Just web controllers - Merb::Controller (or Application)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Just Part controllers - Merb::PartController&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Just Mail controllers - Merb::MailController&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;Ok now get out there and make some cool plugins for Merb! :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/3085517656758478193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/3085517656758478193'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/12/generate-merb-plugins-and-generators.html' title='Generate Merb Plugins and Generators'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-4200347676407659076</id><published>2007-12-13T20:30:00.000-08:00</published><updated>2007-12-13T21:33:11.189-08:00</updated><title type='text'>Using Git with SVN</title><content type='html'>I&#39;ve been setting up a git repository to help aid collaboration on the port of &lt;a href=&quot;http://svn.techno-weenie.net/projects/plugins/restful_authentication/&quot;&gt;restful_authentication&lt;/a&gt; to merb as &lt;a href=&quot;http://rubyforge.org/projects/merbful-auth&quot;&gt;merbful_authentication&lt;/a&gt;.  &lt;br /&gt;&lt;br /&gt;This is such a good library and I use it in all my rails sites that need authentication.  It just works and I like that.  All credit to&lt;a href=&quot;http://techno-weenie.net&quot;&gt; Rick Olson&lt;/a&gt; for such a great plugin.  Hopefully we&#39;ll be able to to a good job porting it.&lt;br /&gt;&lt;br /&gt;Initially I setup a git repo with this.  I&#39;m starting to do most of my work in git so this is a good opportunity to keep going learning it.  &lt;br /&gt;&lt;br /&gt;You can get the WIP on this plugin via&lt;pre&gt;git clone http://snatcht.com/git/merbful_authentication.git&lt;br /&gt;# OR&lt;br /&gt;git clone git://snatcht.com/git/merbful_authentication.git&lt;/pre&gt;This is really just a blank Merb app that has the beginnings of a port in it.  There were so many people working on a port of this plugin I figured we might as well work on it together. &lt;br /&gt;&lt;br /&gt;To include everyone in the development I needed to have svn as well.  Rubyforge have been generous in approving a &lt;a href=&quot;http://rubyforge.org/projects/merbful-auth&quot;&gt;project&lt;/a&gt; for me. &lt;br /&gt;&lt;br /&gt;The issue was, how to bring the svn into my local git repo so that I can push changes up to svn.  Heres how I did it.&lt;pre&gt;git clone git://snatcht.com/git/merbful_authentication.git&lt;br /&gt;&lt;br /&gt;cd merbful_authentication.git&lt;br /&gt;&lt;br /&gt;mate .git/config&lt;/pre&gt;In this file I put the following&lt;pre&gt;[svn-remote &quot;rubyforge/trunk&quot;]&lt;br /&gt;  url = svn+ssh://username@rubyforge.org/var/svn/merbful-auth/trunk&lt;br /&gt;  fetch = :refs/remotes/rubyforge/trunk&lt;/pre&gt;Then to get the SVN linked into my local git&lt;pre&gt;git-svn fetch rubyforge/trunk&lt;br /&gt;&lt;br /&gt;git branch -a&lt;br /&gt;* master&lt;br /&gt;  origin/HEAD&lt;br /&gt;  origin/master&lt;br /&gt;  rubyforge/trunk&lt;br /&gt;&lt;/pre&gt;You can see that rubyforge/trunk is now present in my git remote branches.  Next create a branch from rubyforge/trunk&lt;pre&gt;git checkout -b local-svn/trunk rubyforge/trunk&lt;/pre&gt;This will create a local branch that you can use in git like any other branch.  Now once you&#39;ve made changes to your app.  Merge them into the local-svn/trunk then update your svn repo with a lazy&lt;pre&gt;git-svn dcommit&lt;/pre&gt;from within the local-svn/trunk branch.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4200347676407659076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4200347676407659076'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/12/using-git-with-svn.html' title='Using Git with SVN'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-243127259215379265</id><published>2007-11-30T04:58:00.000-08:00</published><updated>2007-11-30T13:50:29.920-08:00</updated><title type='text'>Raising Routeable Errors in Merb Router</title><content type='html'>On the #merb channel today there was an interesting puzzle to solve with routes.  Merb routes have some crazy power, and today took my first crack at trying to give it a bit of a flex.&lt;br /&gt;&lt;br /&gt;There were two distinct pieces of the puzzle that needed to be addressed.  First, requests sent to actions on the application and exceptions controllers.  The application controller will feed back with an error that says&lt;br /&gt;&lt;br /&gt;&quot;The &#39;Application&#39; controller has no public actions&quot;&lt;br /&gt;&lt;br /&gt;The exception controller can be routed to like any other action.  Failing missing actions are handled like any other controller, and actions rendering a known template will render but without the error message.&lt;br /&gt;&lt;br /&gt;This behavior was not good for me and I didn&#39;t want it to occur.  You might want the flexibility of being able to directly call the exceptions controller.  But for this I don&#39;t.&lt;br /&gt;&lt;br /&gt;Second, the error should be short and not give out too much information when either you request application or exceptions controller actions, or non-existent routes.  &lt;br /&gt;&lt;br /&gt;When Merb catches an exception it gives you a small amount of information about what  the problem was.  For this the requirement was that just a non-descript message be displayed.&lt;br /&gt;&lt;br /&gt;This route setup prevents both issues from occuring and just renders an error screen with a simple message.&lt;pre&gt;&lt;br /&gt;class Merb::Router&lt;br /&gt;  DEFAULT_NOT_FOUND_HASH = { :exception =&gt; Merb::ControllerExceptions::NotFound.new(&quot;URL Not Found&quot;),&lt;br /&gt;                             :controller =&gt; &quot;exceptions&quot;,&lt;br /&gt;                             :action =&gt; &quot;not_found&quot;}&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts &quot;Compiling routes..&quot;&lt;br /&gt;Merb::Router.prepare do |r|&lt;br /&gt; &lt;br /&gt;  r.match(%r{^\/(application|exceptions)}).defer_to do |request, params|&lt;br /&gt;    params.merge!(Merb::Router::DEFAULT_NOT_FOUND_HASH)&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;# All the other routes&lt;br /&gt;&lt;br /&gt;  r.match(%r{.+}).defer_to do |request, params|&lt;br /&gt;    params.merge!(Merb::Router::DEFAULT_NOT_FOUND_HASH)&lt;br /&gt;  end &lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;The first part of this route will catch any routes requested for application or exceptions controllers and render the error NotFound with the message &quot;URL Not Found&quot;.  The second part just catches any routes you haven&#39;t defined and renders that same error. &lt;br /&gt;&lt;br /&gt;This setup will not work with default_routes.  If you use default routes in between these to matchers, the bottom matcher will most likely not get called, and if you put the default routes after the last matcher in the example, default_routes will never be called.  Personally, I don&#39;t like the idea of over riding the default behavior for not found errors, so I wouldn&#39;t have the second matcher, but I don&#39;t mind restricting routing from application and exceptions.  At least that way you can use default_routes if you wanted to.&lt;br /&gt;&lt;br /&gt;The defer_to method on a route will wait until the route comes in to assess it.  If it matches the regexp then control is yielded to the block with the request and params objects.  &lt;br /&gt;&lt;br /&gt;Merbs error handling in controllers means that you just raise an error and the error will be caught by the exceptions controller and rendered.  If you directly raise an error in the defer_to block though, your app will crash.  You need to set the &lt;tt&gt;:controller, :action&lt;/tt&gt;, and &lt;tt&gt;:exception&lt;/tt&gt; options manually in the params hash to get error handling.&lt;br /&gt;&lt;br /&gt;It&#39;s interesting to note that if the result of your defer_to block is false, it will not be considered as a match and will move onto the next.  This does not allow for multiple defer_to matches to influence the result of another defer_to.  For example, without default_routes set:&lt;pre&gt;    r.match(%r{.+}).defer_to do |request, params|&lt;br /&gt;      params.merge!(:one =&gt; &quot;one&quot;)&lt;br /&gt;      puts params.inspect&lt;br /&gt;      false&lt;br /&gt;    end &lt;br /&gt;    &lt;br /&gt;    r.match(%r{.+}).defer_to do |request, params|&lt;br /&gt;      params.merge!(:two =&gt; &quot;two&quot;)&lt;br /&gt;      puts params.inspect&lt;br /&gt;      false&lt;br /&gt;    end&lt;/pre&gt;will produce&lt;pre&gt;{&quot;action&quot;=&gt;&quot;index&quot;, &quot;one&quot;=&gt;&quot;one&quot;}&lt;br /&gt;{&quot;two&quot;=&gt;&quot;two&quot;, &quot;action&quot;=&gt;&quot;index&quot;}&lt;br /&gt;&lt;br /&gt;# Instead of&lt;br /&gt;&lt;br /&gt;{&quot;action&quot;=&gt;&quot;index&quot;, &quot;one&quot;=&gt;&quot;one&quot;, &quot;two&quot;=&gt;&quot;two&quot;}&lt;/pre&gt;I&#39;m not sold yet on what any of this means in terms of usefulness.  I think I&#39;ll include the route to prevent requests going to application or exceptions directly, but I&#39;ll leave the normal behavior in for the rest of them.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/243127259215379265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/243127259215379265'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/11/raising-routeable-errors-in-merb-router.html' title='Raising Routeable Errors in Merb Router'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-2817121724861773648</id><published>2007-11-27T15:47:00.001-08:00</published><updated>2007-11-27T15:58:26.912-08:00</updated><title type='text'>New Merb Benchmarks</title><content type='html'>A while ago I started to do &lt;a href=&quot;http://hassox.blogspot.com/2007/11/great-merb-speedup.html&quot;&gt;some really simple benchmarks&lt;/a&gt; on Merb and Rails.  Yehuda Katz, aka wycats on IRC went and wrote two simple benchmark apps that live in Merbs SVN.  To get these:&lt;pre&gt;svn co http://svn.devjavu.com/merb/apps/benchmark &lt;br /&gt;&lt;br /&gt;svn co http://svn.devjavu.com/merb/apps/rails_benchmark&lt;/pre&gt;Both of these will use evented mongrel and swiftiply if they&#39;re installed.  &lt;br /&gt;&lt;br /&gt;To use these benchmark apps change into the root directory.&lt;pre&gt;ruby script/benchmark&lt;/pre&gt;That command will run all the available benchmarks.  &lt;br /&gt;&lt;br /&gt;There are a number of options.  Use the -h flag to help you find your way around.  The options are there to help you setup the benchmark and also to select which benchmarks to run.&lt;pre&gt;ruby script/benchmark -l&lt;/pre&gt;will list all the benchmarks available.&lt;pre&gt;ruby script/benchmark -s erb,haml&lt;/pre&gt;will run the template and partials for erb templates and haml templates only.  &lt;br /&gt;&lt;br /&gt;Be careful though, these can take a while.  Especially on Rails.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/2817121724861773648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/2817121724861773648'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/11/while-ago-i-started-to-do-some-really.html' title='New Merb Benchmarks'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-543396827537359125</id><published>2007-11-27T15:05:00.000-08:00</published><updated>2007-11-27T15:42:12.242-08:00</updated><title type='text'>Organic Inefficiency</title><content type='html'>Merb really floats my boat at the moment.  But I do think of other stuff... Really.&lt;br /&gt;&lt;br /&gt;During my day job as a Mechanical Engineer it&#39;s part of my role to design and implement manufacturing cells in our factory.  This can be pretty cool.  Trying to make the cell as efficient and lean as possible can be quite a task sometimes.  I&#39;ve found that the cells not only need to be designed around the latest available (or is that affordable?) technology, people must be considered in the work flow if it&#39;s going to be successful.  &lt;br /&gt;&lt;br /&gt;When you design the cell with people being people in mind, all goes reasonably well.  You can even make the cell efficient in a stand alone kind of way.  But is that the best that can be done?  I don&#39;t think so.&lt;br /&gt;&lt;br /&gt;When the factory was first put on the floor, hopefully whoever did it did their homework and made an efficient layout so that all the individual work cells could function together reasonably well.  As time goes on, you gain new products and you loose older ones.  Some cells close and some new ones go in,  and some of the bigger machinery which is very expensive to move now has to be planned around when you put in new equipment.  What you end up with is an organically changing factory layout.  &lt;br /&gt;&lt;br /&gt;Picture this organically changing factory going forward for a few projects.  Potentially you could end up with an unsatisfactory performance of the factory as a whole but this is hard to pick since all the individual cells seem to be efficient. &lt;br /&gt;&lt;br /&gt;A work cell itself can have a very efficient theoretical process flow.  In reality, if you can&#39;t translate that onto the floor the way you want, inefficiencies will result.  The fact that when you lay the cell down, you &quot;must put it in this spot&quot; because that&#39;s where there&#39;s some free space can impact dramatically.  Material in and out, and even flow in nice lines may not be optimum because you need to fit into the current factory layout.  This can potentially lead to increased WIP (work in progress), increased handling equipment and all sorts of other nasties that may or may not be easily quantifiable.  &lt;br /&gt;&lt;br /&gt;It&#39;s my opinion that this kind of thing should be avoided.  There is at least &lt;a href=&quot;http://www.plm.automation.siemens.com/en_us/products/tecnomatix/plant_design/factory_flow.shtml&quot;&gt;one software product&lt;/a&gt; I know of that&#39;s designed to assist with this issue.  Tools like this can be very useful both to correct failing factories and also to move forward.  Using a tool like FactoryFlow, is time consuming up front, for larger factories though it&#39;s much more expensive if you have to move equipment two or three times than if you invest up front with the design and do it right just once.&lt;br /&gt;&lt;br /&gt;This is a huge issue that I&#39;m sure could be talked about and theorised about.  But this is a blog post so I won&#39;t do that to you :P&lt;br /&gt;&lt;br /&gt;I think these same kind of organic inefficiencies can affect software development.  I&#39;ve seen plenty of old bloat-ware type products that attest to this.  Automated BDD could go a long way towards alleviating this issue since the behavior is spec&#39;ed and ideally you can change the implementation under the covers removing this organic inefficiency.  Does it though?  Is this kind of inefficiency common in software projects for the web?  &lt;br /&gt;&lt;br /&gt;I&#39;d love to hear feed back on this issue.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/543396827537359125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/543396827537359125'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/11/merb-really-floats-my-boat-at-moment.html' title='Organic Inefficiency'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-4055622700890604803</id><published>2007-11-18T02:06:00.000-08:00</published><updated>2007-11-18T23:08:27.309-08:00</updated><title type='text'>Native Sass Support for Merb</title><content type='html'>&lt;a href=&quot;http://nex-3.com/&quot;&gt;Nathan Weizenbaum&lt;/a&gt; aka nex3, a contributer to the awesome &lt;a href=&quot;http://haml.hamptoncatlin.com/&quot;&gt;haml&lt;/a&gt; template system has just put support for using Sass in merb into the stable branch of Haml.&lt;br /&gt;&lt;br /&gt;Haml has been supported in merb for a long time, longer than I&#39;ve been involved with merb for sure.  Sass was lacking though... Until Now :)&lt;br /&gt;&lt;br /&gt;Before you can use Sass in Merb, you&#39;ll probably need to get the latest Haml.&lt;pre&gt;sudo gem install haml&lt;/pre&gt;To use Sass in your Merb App it works the same way as in Rails.  Put your Sass templates into &lt;tt&gt;public/stylesheets/sass&lt;/tt&gt;&lt;br /&gt;&lt;pre&gt;public/stylesheets/sass/my_style_sheet.sass&lt;/pre&gt;and include the css in the head of your layout application.html.*&lt;pre&gt;css_include_tag :my_style_sheet&lt;/pre&gt;The only thing left to do now is to declare the dependency.  In &lt;pre&gt;config/dependencies.rb&lt;/pre&gt; include the line &lt;pre&gt;dependency &quot;haml&quot;&lt;/pre&gt;Your app will now happily use your Sass templates, updated when you change them in development, but compiled only once during production.  Sweet :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4055622700890604803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4055622700890604803'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/11/native-sass-support-for-merb.html' title='Native Sass Support for Merb'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-4941193604034229979</id><published>2007-11-08T18:10:00.000-08:00</published><updated>2007-11-11T18:35:14.829-08:00</updated><title type='text'>The Great Merb Speedup</title><content type='html'>Well, Merb has been coming along in leaps and bounds, but unfortunately it&#39;s also slowed down a bit in it&#39;s rendering.  With all the changes this method has become heavy and quite slow.&lt;br /&gt;&lt;br /&gt;The merb team did some great work on this yesterday.  Hopefully there&#39;ll be some more in the near future too.  Here&#39;s some numbers for your delectation.  Please take these with a grain of salt.  I&#39;m no expert on benchmarking.  See below for a full setup of how I ran the tests. &lt;br /&gt;&lt;br /&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://pastie.textmate.org/private/xcf15xcsnfezcqfs7m8dcq&quot;&gt;This table is on pastie&lt;/a&gt; for your viewing pleasure&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Rails: ab -n 5000 -c 5 http://127.0.0.1:3000/tester&lt;br /&gt;Merb:  ab -n 5000 -c 5 http://127.0.0.1:4000/tester&lt;br /&gt;&lt;br /&gt;Rails Version 8117&lt;br /&gt;rake rails:freeze:edge&lt;br /&gt;rake rails:update&lt;br /&gt;&lt;br /&gt;Merb Version &lt;br /&gt;&lt;br /&gt;Invocation:&lt;br /&gt;Rails: mongrel_rails start -e production&lt;br /&gt;Merb:  merb -e production &gt; a_log_file&lt;br /&gt;&lt;br /&gt;=======================  RESULTS =========================&lt;br /&gt;0 Partials&lt;br /&gt;&lt;br /&gt;Merb 0.4.0:         Requests per second:    456.86 [#/sec] (mean)&lt;br /&gt;Merb Edge 913:      Requests per second:    723.98 [#/sec] (mean)&lt;br /&gt;Rails Edge 8117:    Requests per second:    375.47 [#/sec] (mean)&lt;br /&gt;&lt;br /&gt;10 Partials&lt;br /&gt;Merb 0.4.0:         Requests per second:    150.57 [#/sec] (mean)&lt;br /&gt;Merb Edge 913:      Requests per second:    424.83 [#/sec] (mean)&lt;br /&gt;Rails 1.2.5:        Requests per second:    214.91 [#/sec] (mean)&lt;br /&gt;Rails Edge 8117:    Requests per second:    213.56 [#/sec] (mean)&lt;br /&gt;&lt;br /&gt;100 Partials:&lt;br /&gt;Merb 0.4.0          Requests per second:    22.42 [#/sec] (mean)&lt;br /&gt;Merb Edge 913:      Requests per second:    100.83 [#/sec] (mean)&lt;br /&gt;Rails 1.2.5:        Requests per second:    45.15 [#/sec] (mean)&lt;br /&gt;Rails Edge 8117:    Requests per second:    44.23 [#/sec] (mean)&lt;br /&gt;&lt;br /&gt;* Merb edge without view context caching on partials&lt;br /&gt;* Experimental ONLY&lt;br /&gt;&lt;br /&gt;0 Partials:         Requests per second:    727.22 [#/sec] (mean)&lt;br /&gt;10 partials:        Requests per second:    573.50 [#/sec] (mean)&lt;br /&gt;100 partials:       Requests per second:    229.13 [#/sec] (mean)&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;The setup - Rails&lt;/h3&gt;&lt;pre&gt;rails partial_speed_test&lt;br /&gt;cd partial_speed_test&lt;br /&gt;ruby script/generate controller tester&lt;br /&gt;&lt;br /&gt;# setup AR to point to an emtpy db&lt;br /&gt;&lt;br /&gt;# setup your controller See Below&lt;br /&gt;# setup routes&lt;br /&gt;&lt;br /&gt;mongrel_rails start -e production&lt;br /&gt;# run the ab tests&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;The Setup - Merb&lt;/h3&gt;&lt;pre&gt;merb -g partial_speed_test_merb&lt;br /&gt;cd partial_speed_test_merb&lt;br /&gt;ruby script/generate controller tester&lt;br /&gt; &lt;br /&gt;#setup your controller See Below&lt;br /&gt;# Setup routes&lt;br /&gt;&lt;br /&gt;merb -e production&lt;/pre&gt;&lt;h3&gt;Controller setup&lt;/h3&gt;&lt;pre&gt;# app/controllers/tester.rb&lt;br /&gt; &lt;br /&gt;def index&lt;br /&gt;  render&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# app/views/tester/index.html.erb (RAILS)&lt;br /&gt;Inside Index&lt;br /&gt;&amp;lt;% 10.times do %&amp;gt;&lt;br /&gt;&amp;lt;%= render :partial =&amp;gt; &quot;blah&quot; %&amp;gt;&lt;br /&gt;&amp;lt;% end %&amp;gt;&lt;br /&gt;&lt;br /&gt;# app/views/tester/index.html.erb (MERB)&lt;br /&gt;Inside Index&lt;br /&gt;&amp;lt;% 10.times do %&amp;gt;&lt;br /&gt;&amp;lt;%= partial :blah %&amp;gt;&lt;br /&gt;&amp;lt;% end %&amp;gt;&lt;br /&gt;&lt;br /&gt;# app/views/tester/_blah.html.erb&lt;br /&gt;BLAH&amp;lt;br/&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Merb Tests&lt;/h3&gt;Procedure&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Uninstall merb gem&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Install merb gem&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start app&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start tests&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;Released 0.4.0 gem&lt;br /&gt;svn co with revision 913 and rake install &lt;br /&gt;change the partial method to use cached_view_context instead of clean_view_context(engine) in render.rb&lt;h3&gt;Rails Tests&lt;/h3&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Generate an app using the 1.2.5 gem and start it up&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Run ab tests&lt;/li&gt;&lt;br /&gt;&lt;li&gt;rake rails:freeze:edge (8117)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;rake rails:update&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start app and run ab tests&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;The number of partials was changed by changing the number in index.html.erb&lt;br /&gt;&lt;br /&gt;Phew.. That was a long post.  &lt;br /&gt;&lt;br /&gt;Just to reiterate, take this with a grain of salt.  This was just a test for my curiosity and I encourage you to run these yourself if you are so inclined.  Hopefully I&#39;ve captured all of the setup.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/em&gt; Again with these numbers take them with a grain of salt.  These numbers are from the activity monitor on OS X&lt;pre&gt;Rails 8117          MEM(MB)         CPU       &lt;br /&gt;10 Partials         24.9            99.7&lt;br /&gt;100 Partials        25.8            100.0&lt;br /&gt;&lt;br /&gt;Merb 0.4.0          MEM(MB)         CPU&lt;br /&gt;10 Partials         15.6            98.8&lt;br /&gt;100 Partials        21.4            100.0&lt;br /&gt;&lt;br /&gt;Merb 913&lt;br /&gt;10 Partials         14.3            98.8&lt;br /&gt;100 Partials        13.8            100.0&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4941193604034229979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4941193604034229979'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/11/great-merb-speedup.html' title='The Great Merb Speedup'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-1144428453766528004</id><published>2007-11-06T05:50:00.000-08:00</published><updated>2007-11-06T15:59:19.651-08:00</updated><title type='text'>Merb Generators Now Read Your Mind</title><content type='html'>Three days ago I blogged about the &lt;a href=&quot;http://hassox.blogspot.com/2007/11/new-merb-generators.html&quot;&gt;new generators in merb&lt;/a&gt;.  Meh, that&#39;s so 3 days ago ;)&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/em&gt; If you&#39;ve installed these gems from trunk since 0.3.7 and before the official release of 0.4.0 you should first uninstall the merb, merb_active_record, merb_data_mapper and merb_sequel gems before you install them again.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Update #2:&lt;/strong&gt;&lt;/em&gt;use_orm :active_record and :data_mapper have been changed to :activerecord and :datamapper respectively.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://gweezlebur.com&quot;&gt;ivey&lt;/a&gt; and &lt;a href=&quot;http://yehudakatz.com/&quot;&gt;wycats&lt;/a&gt;, regulars on #merb and all round good guys today rolled up their sleeves and removed the ugly contstant Merb::GENERATOR_SCOPE that you had to modify to get the generators working.  They also came up with a way to implement default model and resource_controller generators in merb.&lt;h2&gt;How to use it now?&lt;/h2&gt;Now when you setup your brand new merb app, you go into config/dependencies.rb as usual but instead of&lt;pre&gt;dependency &quot;merb_data_mapper&quot;&lt;/pre&gt;you use&lt;pre&gt;use_orm :data_mapper&lt;br /&gt;# and &lt;br /&gt;use_test :rspec&lt;/pre&gt;This will setup the dependency and also sort out what generators your app will use.  You&#39;ve got a good selection of generators now.  &lt;ul&gt;&lt;br /&gt;&lt;li&gt;migration - a migration file&lt;/li&gt;&lt;br /&gt;&lt;li&gt;model -  a model in the correct format + migration + tests / specs&lt;/li&gt;&lt;br /&gt;&lt;li&gt;controller - a blank controller + tests / specs&lt;/li&gt;&lt;br /&gt;&lt;li&gt;resource_controller - a controller setup with basic CRUD actions + tests / specs&lt;/li&gt;&lt;br /&gt;&lt;li&gt;resource - model and resource_controller and all things associated with them&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;So the one you&#39;d normall use is &lt;em&gt;resource&lt;/em&gt;.&lt;pre&gt;ruby script/generate resource my_resource attr:type attr:type&lt;/pre&gt;This will generate a model and resource controller complete with tests / specs and migrations in the syntax of your selected ORM.&lt;br /&gt;&lt;br /&gt;You can also use all of these generators even if you don&#39;t use an ORM at all.  In that case it will just give you plain vanilla ruby classes with attr_accessors&lt;br /&gt;&lt;br /&gt;Neat.  These generators are very new though and I&#39;m sure the content of the generated files can be improved.  If you find something that you think needs to be changed please raise a &lt;a href=&quot;http://merb.devjavu.com/&quot;&gt;ticket&lt;/a&gt; preferably with a patch.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://yehudakatz.com/&quot;&gt;wycats&lt;/a&gt; blog has a &lt;a href=&quot;http://yehudakatz.com/2007/11/06/merb-04-the-one-that-rocks/&quot;&gt;great outline of the major new features&lt;/a&gt; of the imminent version 0.4.0 of merb.  If your interested you should check it out.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/1144428453766528004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/1144428453766528004'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/11/merb-generators-now-read-your-mind.html' title='Merb Generators Now Read Your Mind'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-4390331774839278394</id><published>2007-11-03T04:27:00.000-07:00</published><updated>2007-11-17T01:42:23.523-08:00</updated><title type='text'>The New Merb Generators</title><content type='html'>&lt;strong&gt;&lt;em&gt;Update:&lt;/em&gt;&lt;/strong&gt; The general information in this article is still correct, but the syntax is now nicer.  You can read about the new syntax &lt;a href=&quot;http://hassox.blogspot.com/2007/11/merb-generators-now-read-your-mind.html&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In preparation for the big 0.4 release of Merb, the generators have had a major overhaul.  Merb is ORM agnostic and uses plugins to harness an ORM.  There are currently plugins for &lt;a href=&quot;http://ar.rubyonrails.com/&quot;&gt;ActiveRecord&lt;/a&gt;, &lt;a href=&quot;http://code.google.com/p/ruby-sequel/&quot;&gt;Sequel&lt;/a&gt;, and &lt;a href=&quot;http://datamapper.org/&quot;&gt;DataMapper&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The ORM agnostic goal of &lt;a href=&quot;http://merbivore.com&quot;&gt;Merb&lt;/a&gt;, is a great thing, developers can use what they&#39;re comfortable with, or what suits a particular task at hand.  This does create it&#39;s own issues of how to support it in the framework.  &lt;br /&gt;&lt;br /&gt;There&#39;s been great work done on merb to make this reasonably painless on selecting which ORM to use.  Once the gem for the plugin is installed, a quick trip to config/dependencies.rb, and uncomment the line for your plugin and your away.  But with generators it&#39;s been a bit more difficult up to now.&lt;br /&gt;&lt;br /&gt;You&#39;d think that will the option of ORM, and Rspec vs Test::Unit things could get a bit murky.  Up to now the generators have been named specifically for the ORM you want to use so you can get the right syntax and parent classes etc.  The only controller generator was just a blank stub that you have to fill out each time.  Well now there&#39;s a new way to manage your generation needs.&lt;h3&gt;Rubigen is awsome&lt;/h3&gt;&lt;a href=&quot;http://drnicwilliams.com/&quot;&gt;DrNic&lt;/a&gt; extracted the generators from rails and added some of his magic to them.  The result is a very clever and flexible system for generating files for your app and Merb tries it&#39;s hardest to put all this goodness to work for you.&lt;h3&gt;Ok Already. Example Time&lt;/h3&gt;After you&#39;ve installed the gem for your ORM plugin you need to tell Merb to use it for generators.&lt;pre&gt;# config/merb_init.rb&lt;br /&gt;&lt;br /&gt;# Put your selection for generators in here.  I&#39;ll use DataMapper because I like it :)&lt;br /&gt;Merb::GENERATOR_SCOPE = [:data_mapper, :merb, :rspec]&lt;/pre&gt;This will tell Merb to generate with Datamapper, and Rspec.  This could have been :active_record and :test_unit if you want to go down that road.  The order you put these in will matter in future (hopefully ;))&lt;h3&gt;Generate A Model&lt;/h3&gt;&lt;pre&gt;ruby script/generate model my_model attr:type attr:type&lt;/pre&gt;This will generate the correct model, migration if required, and the correct test or spec stub.  If you change the GENERATOR_SCOPE to use :active_record and generate another model, you&#39;ll see that the correct files are generated.&lt;br /&gt;Note: This currently is not available when you&#39;re not using an ORM plugin.  There are plans to allow this but at the moment it&#39;s not happening.&lt;h3&gt;Generate Controllers&lt;/h3&gt;There are two ways to generate a controller.  &lt;ol&gt;&lt;li&gt;merb_controller&lt;/li&gt;&lt;li&gt;resource_controller&lt;/li&gt;&lt;/ol&gt;The first, merb_controller just generates a blank controller stub, helper and tests or specs.  This is available all the time, even when you&#39;re not using an ORM.  &lt;br /&gt;&lt;br /&gt;The other is available when you use an ORM plugin.&lt;pre&gt;ruby script/generate resource_controller my_model&lt;/pre&gt;This generates a CRUD controller with the correct sytnax for your ORM selection you specified in merb_init.rb along with the helpers and test or spec stubs.&lt;br /&gt;&lt;br /&gt;Currently there is no &quot;resource&quot; generator that takes care of a model and controller and all the associated files.  This is on the drawing board and hopefully it won&#39;t take too long to get it sorted.&lt;br /&gt;&lt;br /&gt;Change the ORM, mix and match your test_unit or rspec selections to see it in action.  I wouldn&#39;t experiment by changing scopes in a real project though since Merb currently only supports using one ORM at a time.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4390331774839278394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/4390331774839278394'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/11/new-merb-generators.html' title='The New Merb Generators'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8154405164851174558.post-7020402429576786477</id><published>2007-11-02T02:55:00.000-07:00</published><updated>2007-11-02T07:07:20.590-07:00</updated><title type='text'>Merb Crud Controller</title><content type='html'>The other day I decided to try a complete CRUD controller using the new provides format and Active Record.  It supports XML, Javascript, YAML formats where appropriate and HTML across all actions.  The built in error handling in &lt;a href=&quot;http://merbivore.com&quot;&gt;Merb&lt;/a&gt; also helps to clean things up.  &lt;br /&gt;&lt;br /&gt;Well. Here it is, for better or worse.  I really like it though ;)&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;textmate-source&quot;&gt;&lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;Posts&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_inheritance punctuation_separator_inheritance_ruby&quot;&gt;&amp;lt;&lt;/span&gt; Application&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  provides &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;xml&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;js&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;yaml&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;index&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;posts&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;all&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    render &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;posts&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;show&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;params&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;id&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    render &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    only_provides &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;html&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;params&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    render&lt;br /&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;create&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;params&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;save&lt;br /&gt;      redirect url&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;else&lt;/span&gt;&lt;br /&gt;      render &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;action&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_key-value&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;new&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;edit&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    only_provides &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;html&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;params&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;id&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    render&lt;br /&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;update&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;params&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;id&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;update_attributes&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;params&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;      redirect url&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;else&lt;/span&gt;&lt;br /&gt;      &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;BadRequest&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;destroy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;params&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;id&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;post&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;destroy&lt;br /&gt;      redirect url&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;posts&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;else&lt;/span&gt;&lt;br /&gt;      &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;BadRequest&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/7020402429576786477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8154405164851174558/posts/default/7020402429576786477'/><link rel='alternate' type='text/html' href='http://hassox.blogspot.com/2007/11/merb-crud-controller.html' title='Merb Crud Controller'/><author><name>Daniel Neighman</name><uri>http://www.blogger.com/profile/04684172518953530260</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>