<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>casperfabricius.com</title>
	
	<link>http://casperfabricius.com/site</link>
	<description>expert ruby on rails development</description>
	<lastBuildDate>Fri, 06 Nov 2009 17:21:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/FingerprintsOfCasperFabricius" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Get a copy of all outgoing ActionMailer emails</title>
		<link>http://casperfabricius.com/site/2009/11/06/get-a-copy-of-all-outgoing-actionmailer-emails/</link>
		<comments>http://casperfabricius.com/site/2009/11/06/get-a-copy-of-all-outgoing-actionmailer-emails/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 17:21:38 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[rails]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=259</guid>
		<description><![CDATA[People care about emails. They don&#8217;t like to be bothered with emails they find unimportant, especially not if they are sent by mistake, have the wrong content or looks weird.
Many of the applications we build send out a lot of emails, and for some, it is a critical part of the system. Lokalebasen is such [...]]]></description>
			<content:encoded><![CDATA[<p>People care about emails. They don&#8217;t like to be bothered with emails they find unimportant, especially not if they are sent by mistake, have the wrong content or looks weird.</p>
<p>Many of the applications we build send out a lot of emails, and for some, it is a critical part of the system. <a href="http://www.lokalebasen.dk/">Lokalebasen</a> is such an application, and the people behind wanted to monitor all outgoing mail, whether generated by a page request, a cron job, an administrator or anything else.</p>
<p>I built a clever little monkey-patch for the Ruby on Rails ActionMailer that makes sure that all outgoing emails has a certain email address put on BCC. This is not visible to the recipient, but it allows you to keep an archive of all outgoing mail, which is certainly useful &#8211; especially for support and bug-tracking.</p>
<p><span id="more-259"></span></p>
<p>Drop this into your lib-folder (remember to change the email address):</p>
<p><script src="http://gist.github.com/227365.js"></script></p>
<p>- and be sure to enable it by adding this line to environment/production.rb (you probably don&#8217;t want to BCC mails sent in development and test mode):</p>
<p><code>
<pre>ActionMailer::Base.send(:include, BccAllMails)</pre>
<p></code></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=J0pJmI2fW9A:XgVg482_T6Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=J0pJmI2fW9A:XgVg482_T6Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=J0pJmI2fW9A:XgVg482_T6Q:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=J0pJmI2fW9A:XgVg482_T6Q:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=J0pJmI2fW9A:XgVg482_T6Q:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/11/06/get-a-copy-of-all-outgoing-actionmailer-emails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hosting a Spree webshop on Heroku</title>
		<link>http://casperfabricius.com/site/2009/10/18/hosting-a-spree-webshop-on-heroku/</link>
		<comments>http://casperfabricius.com/site/2009/10/18/hosting-a-spree-webshop-on-heroku/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 13:09:46 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[rails]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=246</guid>
		<description><![CDATA[Spree is the webshop solution for Ruby on Rails, and Heroku is the place to host your Rails-applications &#8211; especially if you like free hosting :)
Finding myself in the need of a webshop, I decided to try to deploy Spree to Heroku. It wasn&#8217;t too hard, but it did take a few tricks to get [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://spreecommerce.com/">Spree</a> is <em>the</em> webshop solution for <a href="http://www.rubyonrails.com/">Ruby on Rails</a>, and <a href="http://heroku.com/">Heroku</a> is <em>the</em> place to host your Rails-applications &#8211; especially if you like free hosting :)</p>
<p>Finding myself in the need of a webshop, I decided to try to deploy Spree to Heroku. It wasn&#8217;t too hard, but it did take a few tricks to get Spree running on a server that doesn&#8217;t allow you to write to the file system.</p>
<p>I can&#8217;t say I have too much hands-on experience with Spree yet, but it seems to be have borrowed its extension concept from <a href="http://radiantcms.org/">Radiant CMS</a>, which happens to be one of my areas of expertise. So I put together an <a href="http://github.com/RSpace/spree-heroku/">extension</a> for Spree that will easily allow you to deploy the e-commerce system to Heroku.</p>
<p>Just follow the instructions in the <a href="http://github.com/RSpace/spree-heroku/">README on Github</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=7fySKeNzVWg:r6MC7qz6ScA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=7fySKeNzVWg:r6MC7qz6ScA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=7fySKeNzVWg:r6MC7qz6ScA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=7fySKeNzVWg:r6MC7qz6ScA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=7fySKeNzVWg:r6MC7qz6ScA:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/10/18/hosting-a-spree-webshop-on-heroku/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Manage and rollback Heroku deployments Capistrano-style</title>
		<link>http://casperfabricius.com/site/2009/09/20/manage-and-rollback-heroku-deployments-capistrano-style/</link>
		<comments>http://casperfabricius.com/site/2009/09/20/manage-and-rollback-heroku-deployments-capistrano-style/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 14:36:17 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[rails]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=241</guid>
		<description><![CDATA[If you are a Rails-developer, and you don&#8217;t know about Heroku, now would definitely be a good time. Heroku is a platform for hosting web-based Ruby applications in &#8220;the cloud&#8221;, in this case Amazon EC2, making you able to scale your application in an effortless and cost-effective manner without worrying about the hardware behind. Heroku [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a Rails-developer, and you don&#8217;t know about <a href="http://heroku.com/">Heroku</a>, now would definitely be a good time. Heroku is a platform for hosting web-based Ruby applications in &#8220;the cloud&#8221;, in this case <a href="http://aws.amazon.com/ec2/">Amazon EC2</a>, making you able to scale your application in an effortless and cost-effective manner without worrying about the hardware behind. Heroku differs from competition by offering by far the fastest and easiest way to deploy your Rails-application. You simply create your application from Heroku&#8217;s web interface or using their API, and then push your git-repository to Heroku&#8217;s git-server. Heroku takes care of the rest, and you can get back to coding.</p>
<p>I use Heroku for <i>My Big Secret Project</i>, and I am quite happy with not just the ease of deployment it offers, but in fact also with the choices and the constraints that the platform imposes on me. I like writing <code>git push heroku</code> and see my code live immediately. This is of course not that different from <a href="http://www.capify.org/">Capistrano</a>, once that has been setup with the right recipes and the server has been setup to corporate and serve our web application properly. But that can also take some time, especially on a brand new server.</p>
<p><span id="more-241"></span></p>
<p>I did miss one important feature of Capistrano when I started using Heroku: Rollback. Writing <code>cap deploy:rollback</code> has saved my behind many, many times. Granted, it has often been because of bad server configuration which shouldn&#8217;t happen with Heroku, but there has also been cases of genuine bugs resulting in all pages returning errors. When we do mess up, it is really nice to have the application back up in a matter of seconds, and then being able to take you to fix the error &#8211; perhaps even do the right thing and write a failing test for that particular bug before you fix the error.</p>
<p>With Heroku you don&#8217;t get rollback per se, as the application always displays the <code>HEAD</code> version of the <code>master</code> branch in the git repository on Heroku&#8217;s servers. However, with git we have the ability to roll back to the state of every single commit ever done. It&#8217;s just not very convenient having to figure out which commit was your last one working, especially not in a situation where your application is down. Also, we need this to be automated like everything else.</p>
<p>The solution I came up with was to tag each release with a timestamp &#8211; just like Capistrano names its release directories. This gives me a series of tags that should all point to successful deployments, and when my hour of distress arise, I can simply tell the <code>master</code> branch on Heroku to point to the previous release. If I further delete the tag of my current release, I have effectively rolled back to my previous release, and hopefully my application is now up and running again.</p>
<p><script src="http://gist.github.com/189807.js"></script></p>
<p>If you want this functionality in your Heroku application, just copy the above code into a <code>.rake</code> in your <code>lib</code> directory. You deploy your application with this command <code>rake deploy</code> and roll back with <code>rake rollback</code>.</p>
<p>Please note that the script also runs migrations on each deploy, but feel free to delete that line. Suggestions and improvements are very welcome. Enjoy.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=rNKYSuSiQ2E:kroJ2mWiICM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=rNKYSuSiQ2E:kroJ2mWiICM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=rNKYSuSiQ2E:kroJ2mWiICM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=rNKYSuSiQ2E:kroJ2mWiICM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=rNKYSuSiQ2E:kroJ2mWiICM:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/09/20/manage-and-rollback-heroku-deployments-capistrano-style/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Test-driven Rails development with RSpec, RR, Shoulda, Factory Girl and Stubble</title>
		<link>http://casperfabricius.com/site/2009/07/25/test-driven-rails-development-with-rspec-rr-shoulda-factory-girl-and-stubble/</link>
		<comments>http://casperfabricius.com/site/2009/07/25/test-driven-rails-development-with-rspec-rr-shoulda-factory-girl-and-stubble/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 16:44:45 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[rails]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=236</guid>
		<description><![CDATA[When I recently started development of a new, big Rails project, I spend some time researching and considering the many different testing frameworks that are available in the Ruby community today. I have grown very satisfied with the fail/pass rhythm of test-driven development (TDD) &#8211; write a test that fails, then write just enough code [...]]]></description>
			<content:encoded><![CDATA[<p>When I recently started development of a new, big Rails project, I spend some time researching and considering the many different testing frameworks that are available in the Ruby community today. I have grown very satisfied with the fail/pass rhythm of test-driven development (TDD) &#8211; write a test that fails, then write just enough code to make it pass. I also like <a href="http://rspec.info/">RSpec</a> a lot, so some would say that I am fact doing behaviour-driven development (BDD) &#8211; to me, the only real difference between TDD and BDD is the syntax, and I tend to find RSpec&#8217;s examples slightly more readable TestUnit&#8217;s tests. TDD gives me a small gratification &#8211; a sense of accomplishment, albeit on a small scale &#8211; every time a test passes in my autospec terminal.</p>
<p>Howver, TDD&#8217;s basic rule of always writing a failing test before writing any new code, doesn&#8217;t always leave me feeling very productive. For this reason I have mostly abandoned testing views in isolation (as made possible by RSpec&#8217;s view tests), as well as testing Rails helpers with the exception of complicated helper methods with some business logic in them. I still tests views by, behold, viewing them in the browser, and I haven&#8217;t been swept away by <a href="http://wiki.github.com/aslakhellesoy/cucumber/ruby-on-rails">Cucumber</a>, <a href="http://wiki.github.com/brynary/webrat">Webrat</a>, <a href="http://seleniumhq.org/">Selenium</a> and their fellow high-level test frameworks yet &#8211; but I am open.</p>
<p><span id="more-236"></span></p>
<p>I can skip view-testing without feeling too bad about it (wonder how many potential customers that statement scared away), but although I live and breath by the <a href="http://www.therailsway.com/2007/6/1/railsconf-recap-skinny-controllers">Skinny Controller &#8211; Fat Models</a> notion, I still find functional testing of my controllers to be a must in Rails TDD. Unfortunately, I have never really gotten along with RSpec&#8217;s default way of testing controllers. It feels bloated, and the RSpec mocking framework seems to &#8211; yes &#8211; mock me as I add more and more stubs and expectations to avoid tests from failing. So in my research for testing frameworks, I knew I had to find a better way to feel productive and happy about writing controller code again.</p>
<p>Many people hate test fixtures in a very intense and passionate way. I actually kind of like them, I just think they are a bit too stupid and hard to maintain. I also love all the good stuff coming from the <a href="http://www.thoughtbot.com/projects/">thoughtbot</a> guys, and their alternative to Rails&#8217; fixtures &#8211; <a href="http://www.thoughtbot.com/projects/factory_girl">Factory Girl</a> &#8211; is really, really good. Not just because it has a pretty name and a fancy syntax, but because it is really nothing more than Rails&#8217; fixtures done right.</p>
<p>I am getting ahead of myself here. Testing seems to be something people have very different opinions about, and as such I don&#8217;t the perfect mix of testing frameworks for everyone exists. RSpec has probably come closest, and I am sticking with in my test setup while adding and replacing parts of it with newer and better solutions. The mix has come like this:</p>
<ul>
<li><a href="http://rspec.info/">RSpec</a> as the overall testing framework</li>
<li><a href="http://github.com/btakita/rr/tree/master">RR</a> (DoubleRuby) for mocking and stubbing</li>
<li><a href="http://www.thoughtbot.com/projects/shoulda">Shoulda</a> to get sweet test macros</li>
<li><a href="http://www.thoughtbot.com/projects/factory_girl">Factory Girl</a> to create test data</li>
<li><a href="http://github.com/dchelimsky/stubble/">Stubble</a> for easing my controller spec pains</li
</ul>
<p>Do I really need five testing frameworks to be productive with TDD? Not at all, Rails is bundled with all I need to do TDD. But along the way, I have seen the need to make my tests DRY&#8217;er, more readable and easier to maintain, and these frameworks help me with that in different ways. I have already touched on the RSpec vs. TestUnit issue: It comes down to personal taste, and RR, Shoulda, Factory Girl and Stubble all works with both of these frameworks &#8211; isn&#8217;t that nice?</p>
<p>I initially chose to try RR because it seemed to be what the cool kids are using at the moment (and that often turns out to be good), but now that I am getting into it, I am really starting appreciate its compact syntax and advanced features. You could argue that RR&#8217;s syntax:</p>
<pre>
  mock(User).find { @user }
</pre>
<p>- is much harder to read than, say, RSpec&#8217;s mocking syntax:</p>
<pre>
  User.should_receive(:find).and_return(@user)
</pre>
<p>- but I&#8217;d say that RR&#8217;s syntax is actually more &#8220;Ruby-ish&#8221; than RSpec&#8217;s. If you really understand Ruby, RR will most likely appeal to you.</p>
<p>I use Shoulda mainly to get DRY&#8217;er tests that are easier to read, than when I write macros myself. Shoulda has defined a set macros that are quickly becoming a standard, and as something quite new, they also exists as RSpec matchers. Statements such as:</p>
<pre>
  it { should validate_presence_of(:state) }
</pre>
<p>- simply makes TDD faster and more enjoyable, because it would feel wrong to have to write 3-5 lines of test code to test a single line of Rails code.</p>
<p>I can&#8217;t say if Factory Girl is better than, say, <a href="http://github.com/notahat/machinist/tree/master">Machinist</a> (which is actually heavily inspired by the former, according to the creator), but it is without a about much better than Rails&#8217; fixtures from maintenance point of view, the syntax is pretty and it feels productive to use.</p>
<p>If you already knew about everything else mention in this article, chances are that Stubble will still be news to you. Not even released in a version 0.0.1 yet, this project is a small testing framework aimed at making stubbing and mocking in controller tests much easier. When the author, David Chelimsky &#8211; who is also behind RSpec &#8211; mentioned this in passing at a presentation at RailsConf 2009, my curiosity was immediately piqued.  Could this be solution to functional testing woes? Short answer: I&#8217;m not really sure yet. It&#8217;s still too early to say. Currently, I can only get Stubble to work in very simple cases like this:</p>
<pre>
  describe "on GET to :show" do
    def do_get(params = {})
      stubbing(Teaser) do |teaser|
        get :show, {:id => teaser.id}.merge(params)
        yield(teaser)
      end
    end

    it { do_get { |teaser| should assign_to(:teaser).with(teaser) } }
    it { do_get { |teaser| should render_template('show') } }
  end
</pre>
<p>- where I have even had to wrap the <code>stubbing</code>, which is the core of Stubble, in my own method to get the compact testing style I like. I don&#8217;t think I use Stubble in the way it is intended, but I&#8217;d like to be able to simply wrap do my entire outer describe in the stubbing statement, this having the magical <code>teaser</code> variable available in all my tests, helper methods and before-statements. Also, I have not yet managed to mock or stub anything on the magical <code>teaser</code> variable, so if I for example want to verify that some method is called on <code>teaser</code>, I can&#8217;t use Stubble in that test. Again, to be fair, Stubble is in very early development, and I still need to learn about it, but if these two problems are solved, I think Stubble is going to ease a lot of my controller testing pain.</p>
<p>If you, dear reader, feel that you have a better, or simply different, mix of testing frameworks, I&#8217;d love a comment from you about your choices and reasons for going with one thing over the other.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=1AMTkFYEd-8:UwwycA1qQtE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=1AMTkFYEd-8:UwwycA1qQtE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=1AMTkFYEd-8:UwwycA1qQtE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=1AMTkFYEd-8:UwwycA1qQtE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=1AMTkFYEd-8:UwwycA1qQtE:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/07/25/test-driven-rails-development-with-rspec-rr-shoulda-factory-girl-and-stubble/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Community Day 2009 in Copenhagen</title>
		<link>http://casperfabricius.com/site/2009/05/31/community-day-2009-in-copenhagen/</link>
		<comments>http://casperfabricius.com/site/2009/05/31/community-day-2009-in-copenhagen/#comments</comments>
		<pubDate>Sun, 31 May 2009 13:36:36 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[mac]]></category>
		<category><![CDATA[rails]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=225</guid>
		<description><![CDATA[It has been a while since I had a good technical post on this blog, and this is will not be one either. Instead, just a few brief words on a very successful event for geeks in Copenhagen that took place last Thursday. Sponsored by Microsoft and co-presented by the Danish development community, Community Day [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a while since I had a good technical post on this blog, and this is will not be one either. Instead, just a few brief words on a very successful event for geeks in Copenhagen that took place last Thursday. Sponsored by <a href="http://www.microsoft.com/da/dk/default.aspx">Microsoft</a> and co-presented by the <a href="http://eksperten.dk/">Danish</a> <a href="http://udvikleren.dk/">development</a> <a href="http://activedeveloper.dk/">community</a>, <a href="http://communityday.in/copenhagen/">Community Day 2009 Copenhagen</a> delivered what it had promised: A day with free beer and food, interesting presentations and lots of networking across the usual technical boundaries. While the event, previously exclusively with a focus on Microsoft technology, was dominated by seasoned .NET developers, we, the Ruby crowd, was well represented as was the PHP programmers.</p>
<p>Daniel Mellgaard Frost, Developer Evangelist with Microsoft Denmark, had put together <a href="http://communityday.in/copenhagen/Home/Agenda">a diverse program</a> where only two talks was devoted entirely to Microsoft technologies (<a href="http://www.microsoft.com/silverlight/">Silverlight</a> and <a href="http://msdn.microsoft.com/en-us/netframework/aa904594.aspx">LINQ</a>), but six out of eight talks was about web development in some form. I did a talk on <a href="http://ar.rubyonrails.org/files/README.html">ActiveRecord</a>, the O/RM of <a href="http://rubyonrails.org/">Ruby on Rails</a>, and according to the many happy comment I got afterwards, it went pretty well.</p>
<p><span id="more-225"></span></p>
<p>One really great thing about <a href="http://www.ruby-lang.org/">Ruby</a> is that you can start writing code in front a crowd that have never seen the language before, and they will understand everything you are doing &#8211; provided, of course, that they know another object-oriented programming language. Ruby is such a beautiful language that it instantly appeals to most coders, and that makes it a pure joy to do a presentation mostly based on live code examples such as I did.</p>
<p>It also helps that ActiveRecord has an impressive number of features to show off, and even though I don&#8217;t how much it really mattered, I think I made a good tactical choice in demonstrating the O/RM running against a Microsoft SQL Server instance. <a href="http://toolmantim.com/articles/getting_rails_talking_to_sqlserver_on_osx_via_odbc">This post</a>, by the way, is what helped me to get my Mac to talk to SQL Server, but bear in mind, that if you run an older Ruby version and/or use the installation that comes with Leopard, that tutorial will upgrade you to Ruby 1.8.7 running via Macports.</p>
<p>Here is the <a href="/site/wp-content/uploads/2009/05/activerecord.pdf">presentation slides</a> from the talk (in Danish), and here is the very limited quantity of <a href="/site/wp-content/uploads/2009/05/ar_code.zip">code</a> I wrote.</p>
<p>I also lead an open space meeting on <a href="http://jquery.com/">jQuery</a> &#8211; the presentation on the topic was unfortunately canceled in the last minute &#8211; and although I am still learning the many aspects of this great Javascript framework, I think every web developer owe it to his or hers own productivity to take a look at it. Doing Javascript development with jQuery and <a href="http://getfirebug.com/">Firebug</a> is immensely effective, not least because of the literally <a href="http://plugins.jquery.com/">thousands of open source plugins </a>that have been written for the framework by the community.</p>
<p>Thanks for Daniel, Microsoft and the community sites for sponsoring and organizing this fun and inspiring event &#8211; I look forward to next year.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=_3gJaIJr7kU:9VO7URV2zN0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=_3gJaIJr7kU:9VO7URV2zN0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=_3gJaIJr7kU:9VO7URV2zN0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=_3gJaIJr7kU:9VO7URV2zN0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=_3gJaIJr7kU:9VO7URV2zN0:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/05/31/community-day-2009-in-copenhagen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes and impressions from RailsConf 2009</title>
		<link>http://casperfabricius.com/site/2009/05/08/notes-and-impressions-from-railsconf-2009/</link>
		<comments>http://casperfabricius.com/site/2009/05/08/notes-and-impressions-from-railsconf-2009/#comments</comments>
		<pubDate>Fri, 08 May 2009 19:49:24 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[agile]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=217</guid>
		<description><![CDATA[I&#8217;d never have guessed that the first time I&#8217;d visit Las Vegas, the gambling and the drinking, the shows and the shopping would be a minor thing, something that I&#8217;d squeeze in between what really mattered. But RailsConf 2009 had such a comprehensive and interesting program that this ended up being the case. From the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d never have guessed that the first time I&#8217;d visit Las Vegas, the gambling and the drinking, the shows and the shopping would be a minor thing, something that I&#8217;d squeeze in between what really mattered. But RailsConf 2009 had such a comprehensive and interesting program that this ended up being the case. From the casual networking at breakfast and lunch over packed keynotes and high-quality talks to late-night Birds Of a Feather sessions, RailsConf did give the attendants any reason to step out if the air-conditioned Hilton and into the sun and lights of the Strip.</p>
<p>We did that anyway, obviously, but mostly we were learning, tweeting, chatting, coding, emailing and taking notes at a conference where the wifi actually worked and power strips were easily available. I&#8217;m not going to reference all the talks that I went to here, but I have uploaded my notes <a href="http://casperfabricius.com/site/wp-content/uploads/2009/05/">here</a>. Also, I&#8217;ve written a detailed summery of David Heinemeier Hansson&#8217;s keynote and a few select talks that I attended for <a href="http://railsmagazine.com/issues/2">RailsMagazine</a>, <strike>but the free PDF-edition won&#8217;t be available for another two weeks</strike> now freely available for download &#8230; slides from all the presentations can be found <a href="http://www.scribd.com/group/74983-railsconf-2009">here</a>.</p>
<p><span id="more-217"></span></p>
<p>So what did I take away from RailsConf from the top of my head? The first that springs to mind, is that I got to try <a href="http://www.jetbrains.com/ruby/index.html">RubyMine</a>, a new IDE for Ruby on Rails. At first glance this might look like another Aptana or Netbeans, but the <a href="http://railsenvy.com/">Rails Envy</a> guys gave a stunning demonstration of the power of this new IDE: From TextMate keymapping and navigation, over code completion and refactoring that actually works, to automatic diagramming of models and their relationships, this product looks like a real productivity booster. I&#8217;m going to try it out the minute I get home.</p>
<p><i>Rack</i> kept popping up everywhere. Lots of talks on Rack and Rails Metal (which is really just a wrapper for a &#8220;raw&#8221; Rack handler), and now Rack suddenly doesn&#8217;t feel so scary anymore. It just a way to do cool things on a raw request and/or response without the (full) overhead of the Rails stack. <i>JRuby</i> was another popular topic, as well as <i>clouds</i> &#8211; how to deploy to server environment that will seamlessly scale with your needs.</p>
<p>I have been following IronRuby with great interest since the project was started 2-3 years ago, and I was a bit disappointed to hear that the .NET implementation of Ruby is still nowhere near completed. I asked Jimmy Schementi from the Microsoft IronRuby team what took them so long (to be honest, I was a bit rude, sorry Jimmy), and asked that things simply took time. He said that JRuby had been 6 years underway. The positive news, however, was that the IronRuby team is still very committed to making their implementation fully Ruby 1.8 compliant, and that are using Rails to measure their success against.</p>
<p>I&#8217;d love to tell you more, but my plane is leaving soon, so you will have to make do with <a href="http://casperfabricius.com/site/wp-content/uploads/2009/05/">my notes</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=AsowCDYqWmU:mxVRey0P1Ic:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=AsowCDYqWmU:mxVRey0P1Ic:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=AsowCDYqWmU:mxVRey0P1Ic:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=AsowCDYqWmU:mxVRey0P1Ic:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=AsowCDYqWmU:mxVRey0P1Ic:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/05/08/notes-and-impressions-from-railsconf-2009/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Introductions to Ruby on Rails</title>
		<link>http://casperfabricius.com/site/2009/04/22/introductions-to-ruby-on-rails/</link>
		<comments>http://casperfabricius.com/site/2009/04/22/introductions-to-ruby-on-rails/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 07:45:03 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[agile]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=212</guid>
		<description><![CDATA[You have at least two chances to get introduced to Ruby on Rails by yours truly this year. I do a presentation on Rails with a focus on ActiveRecord, the ORM of Rails, on Commity Day 2009 in Copenhagen. I am also teaching Rails used with agile methods at Copenhagen Business School this fall.
Community Day [...]]]></description>
			<content:encoded><![CDATA[<p>You have at least two chances to get introduced to Ruby on Rails by yours truly this year. I do a presentation on Rails with a focus on ActiveRecord, the <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">ORM</a> of Rails, on <a href="http://communityday.in/copenhagen/">Commity Day 2009</a> in Copenhagen. I am also teaching Rails used with agile methods at <a href="http://cbs.dk/">Copenhagen Business School</a> this fall.</p>
<p>Community Day 2009 is free 1-day event May 28 in Copenhagen sponsored by Danish developer communities. Besides my two cents, it also features presentations on Android, Flex, Air, Silverlight, LINQ, Drupal, jQuery and ASP.NET MVC &#8211; in other words it looking to be a lot of buzzwords and popular technologies explained. As if that wasn&#8217;t enough, the day also include three geek-friendly meals, friendly competitions and lots of free beer.</p>
<p>The course I will be teaching at Copenhagen Business School is called Agile Development in Practice, and builds upon a theoretic platform of agile methods. The course focus is on giving the students practical experience with Scrum and Ruby on Rails through a combination of traditional teaching and working with real-life examples. The course is free to attend for all Danish students, and counts for either 7,5 or 15 ETCS points. Others can also enroll in the course for a fee. The course description is not yet available on the CBS homepage, but I will link to here as soon as it is ready.</p>
<p>But before all that, I myself will hopefully learn many new and useful things about Ruby, Rails and all things geeky at <a href="http://en.oreilly.com/rails2009/">RailsConf</a> in Las Vegas. See you there? :)</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=vuFFAX2-mXQ:nFMpytva6zw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=vuFFAX2-mXQ:nFMpytva6zw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=vuFFAX2-mXQ:nFMpytva6zw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=vuFFAX2-mXQ:nFMpytva6zw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=vuFFAX2-mXQ:nFMpytva6zw:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/04/22/introductions-to-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploading multiple files with progress indicator using jQuery, Flash and Rails</title>
		<link>http://casperfabricius.com/site/2009/03/26/uploading-multiple-files-with-progress-indicator-using-jquery-flash-and-rails/</link>
		<comments>http://casperfabricius.com/site/2009/03/26/uploading-multiple-files-with-progress-indicator-using-jquery-flash-and-rails/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 14:15:37 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[rails]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=197</guid>
		<description><![CDATA[I just implemented a new way of uploading assets such as photos and PDF-files to Lokalebasen.dk. There is nothing revolutionary about it, but I hit a few snags on the way, and I thought I&#8217;d share my choices here.
Lokalebasen (a Danish website for rental and sale of business property) is (of course) based on Ruby [...]]]></description>
			<content:encoded><![CDATA[<p>I just implemented a new way of uploading assets such as photos and PDF-files to <a href="http://www.lokalebasen.dk">Lokalebasen.dk</a>. There is nothing revolutionary about it, but I hit a few snags on the way, and I thought I&#8217;d share my choices here.</p>
<p>Lokalebasen (a Danish website for rental and sale of business property) is (of course) based on <a href="http://www.rubyonrails.com">Ruby on Rails</a> and uses the notoriously brilliant <a href="http://jquery.com/">jQuery</a> as Javascript framework. When the customer asked for a progress bar while uploading assets, I knew there was basically two choices: Polling the server for the progress of the upload, or uploading through Flash. I choose the last option because I believe it is easier to implement, and it gives the added bonus of being able to start the upload in an &#8220;ajaxy&#8221; way without refreshing the page.</p>
<p>Several ready-made solutions exists, and chose one that was built as a jQuery plugin, was updated recently and was easy to use while being highly configurable: <a href="http://www.uploadify.com/">Uploadify</a>. This article is not an Uploadify tutorial &#8211; you&#8217;ll have to work the out from the <a href="http://www.uploadify.com/documentation/">documentation</a> and the <a href="http://www.uploadify.com/download/">examples</a>. Rather, it&#8217;s about the last piece of the puzzle, how to make Rails play nicely with Uploadify.</p>
<p><span id="more-197"></span></p>
<p>Lokalebasen uses <a href="http://github.com/technoweenie/attachment_fu/tree/master">attachment_fu</a> for handling assets. Since traditional file upload was already implemented, I had fallback functionality for users without Javascript or Flash &#8211; and so should you. All I had to add the controller handling the upload was a detection of the correct content type. Browsers will usually provide this, but Flash does not. And so the controller ended up looking something like this:</p>
<p><script src="http://gist.github.com/86020.js"></script></p>
<p>The <a href="http://rubyforge.org/projects/mime-types/">mime-types gem</a> is used to detect the content type &#8211; installation and usage is explained <a href="http://jimneath.org/2008/05/15/swfupload-paperclip-and-ruby-on-rails/">here</a>.</p>
<p>I needed the functionality several places, so I wrote a partial I could reuse:</p>
<p><script src="http://gist.github.com/86027.js"></script></p>
<p>There is a lot going here, so let&#8217;s take it from the top. The <code>content_for :head</code> section is the code that will be placed inside the <code>&lt;head&#038;gt</code> part of the page &#8211; my layout takes care of that with a <code>yield :head</code> call. So first the Uploadify jQuery plugin javascript file is included, followed by some javascript that applies Uploadify to the <code>file_uploader</code> div seen later in the partial. This includes a lot options, some of which uses variables supplied to the partial. Here is an example of how I call the partial:</p>
<p><script src="http://gist.github.com/86090.js"></script></p>
<p> I won&#8217;t walk you through all the options I supply for Uploadify, but let&#8217;s take a look at the important ones: <code>script</code> is where Uploadify will post the uploaded file to. This should be the <code>create</code> action of your asset controller. <code>scriptData</code> is the most tricky one. The option specifies what parameters should be posted to the controller along with the file. <code>'format': 'json'</code> ensures that the <code>wants.json</code> block is invoked in the controller, instead of the default <code>wants.html</code>. This helps the controller to separate Flash uploads from ordinary uploads. The two other parameters in <code>scriptData</code> will be explained later in the article, is they are the key to get the uploading past security and authentication measures taken. <code>fileDataName</code> extracts the name to use for the uploaded file (e.g. <code>asset[:uploaded_data]</code> for attachment_fu) directly from the fallback form. <code>onComplete</code> makes an ajax get request through jQuery to <i>the same</i> url we are currently on. I use this to render some javascript that updates the page in a <code>wants.js</code> in the controller.</p>
<p>There are several gotchas when you upload files through Flash. The most common one, which also apply to ajax, is the infamous <code>ActionController::InvalidAuthenticityToken</code> exception. You will get this exception on any default Rails installation with authenticity checking enabled. Rails expects any post to an action the include the <code>authenticity_token</code> parameter. It is used to verify the post actually came from the same application, and Rails automatically adds to all the forms and ajax requests it generates. In this case, we have to apply it manually, and this what happens with <code>'authenticity_token': encodeURIComponent('<%= form_authenticity_token if protect_against_forgery? %>')</code>. The <code>form_authenticity_token</code> returns a valid token, but first we check if forgery is enabled. If it is disabled (which it usually is in tests), we will get an error if we invoke <code>form_authenticity_token</code>.  <code>encodeURIComponent</code> makes sure that any characters in the token is encoded correctly. With this parameter, we should be able to make an authentic post through Flash &#8211; or maybe not &#8230;</p>
<p>Rails use data in the user session to authenticate requests, and requests directly from Flash does not include the session cookie that Rails use to find the session. Thus we still get the <code>ActionController::InvalidAuthenticityToken</code> exception, even with the <code>authenticity_token</code> parameter added. We have to make a slight hack into how Rails handles sessions to make this work. Place <a href="http://gist.github.com/11753">this code</a> in a file in <code>config/initializers</code> to apply the hack, which tells Rails to try to read the session id from a parameter, if it can&#8217;t find in a cookie. This will only happen, however, if we add the line <code>session :cookie_only => false, :only => :create</code> to the asset controller. Also, we must supply the session in a parameter, which is what <code>'<%= Rails.configuration.action_controller.session[:session_key]%>': '<%= u session.session_id %>' }</code> do. The unique session key of the application is taken from the Rails configuration, and the session id is taken from session.</p>
<p>With these measures in place, Rails can now properly authenticate our Flash upload request as a legal, secure post. As an added bonus, actions protected behind session-based logins now also just works. And I would guess that most applications require their users to register and login before they can upload files.</p>
<p>Finally, here is a trick if you use http basic authentication e.g. for the administration tool like we do on Lokalebasen.dk. Place an <code>is_admin?</code> flag in the session, as shown in the code below. This will allow even Flash uploads to be authenticated, even if they don&#8217;t supply http basic authentication information:</p>
<p><script src="http://gist.github.com/86115.js"></script></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=4X1gANCeG14:m86h3l81qhs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=4X1gANCeG14:m86h3l81qhs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=4X1gANCeG14:m86h3l81qhs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=4X1gANCeG14:m86h3l81qhs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=4X1gANCeG14:m86h3l81qhs:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/03/26/uploading-multiple-files-with-progress-indicator-using-jquery-flash-and-rails/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Playing with Webby</title>
		<link>http://casperfabricius.com/site/2009/03/15/playing-with-webby/</link>
		<comments>http://casperfabricius.com/site/2009/03/15/playing-with-webby/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 15:32:54 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[other]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=192</guid>
		<description><![CDATA[I have been in a relationship with Ruby on Rails for more than 3 years, and I&#8217;ve completely dedicated and faithful to the beautiful web framework for almost 2 years. Until now.
Today I decided to cheat on Rails. And I&#8217;m not talking going back to the ugly ex, ASP.NET, or getting back in touch with [...]]]></description>
			<content:encoded><![CDATA[<p>I have been in a relationship with <a href="http://rubyonrails.org">Ruby on Rails</a> for more than 3 years, and I&#8217;ve completely dedicated and faithful to the beautiful web framework for almost 2 years. Until now.</p>
<p>Today I decided to cheat on Rails. And I&#8217;m not talking going back to the ugly ex, ASP.NET, or getting back in touch with old flirts such as PHP or Java, no &#8230; Once you go Ruby, you don&#8217;t go back.</p>
<p>But there are other Ruby web frameworks than Rails. &#8220;What? I thougth Ruby was invented for Rails, as a kind of unintentional side effect?&#8221; you might say, but it is no so. Until recentl, <a href="http://www.merbivore.com/">Merb</a> has probably been the most well-known &#8220;Ruby-based framework that is not Rails&#8221;, but now <a href="/site/2009/01/01/hello-merb/">the two are getting hitched</a> and as such we have to look elsewhere for alternative Ruby frameworks.</p>
<p><a href="http://webby.rubyforge.org/">Webby</a> is one such framework. Or to be fair, Webby is so much less than both Rails and Merb, and that&#8217;s the whole point. Webby are for simple, static home pages that can be hosted on anywhere. The Ruby framework generates static html files based on layouts and content pieces defined in the project. It doesn&#8217;t use a database, it doesn&#8217;t parse forms and that is exactly the simplicity you sometimes need.</p>
<p><span id="more-192"></span></p>
<p>The two greatest benefits in Webby is:</p>
<ol>
<li>Content is plain text files and can be put in source control painlessly</li>
<li>Output is plain html files and be deployed anywhere with just FTP, RSync or SSH</li>
</ol>
<p>As I see it, this makes Webby the perfect &#8220;un-CMS&#8221; for a web site maintained by developers. We don&#8217;t want to type in long texts in textareas in the browser &#8211; we want to do it <a href="http://macromates.com">Textmate</a> or whatever our favorite text editor is called. We want full control over the HTML, we want speed and we want real versioning for our content.</p>
<p>Some times Rails is just plain overkill.</p>
<p>Resources:</p>
<ul>
<li><a href="http://webby.rubyforge.org/">Webby homepage</a></li>
<li><a href="http://clarkware.com/cgi/blosxom/2008/08/06#Webby">Great Webby tutorial</a> (but a bit outdated, make sure to replace references to <code>webby</code> with <code>webby-gen</code>, and references to <code>rake</code> with <code>webby</code>.)</li>
<li><a href="http://judofyr.net/posts/building-a-website-with-webby.html">Another good tutorial</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=CQXjsdws-RU:qQNtJHkDhJs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=CQXjsdws-RU:qQNtJHkDhJs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=CQXjsdws-RU:qQNtJHkDhJs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=CQXjsdws-RU:qQNtJHkDhJs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=CQXjsdws-RU:qQNtJHkDhJs:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/03/15/playing-with-webby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reflections on Copenhagen Twestival</title>
		<link>http://casperfabricius.com/site/2009/02/15/reflections-on-copenhagen-twestival/</link>
		<comments>http://casperfabricius.com/site/2009/02/15/reflections-on-copenhagen-twestival/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 23:29:59 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[other]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=177</guid>
		<description><![CDATA[

&#169; 2009 Rasmus Luckow

We were all there. The geeks, the journalists, the communication and new media consultants and the Internet entrepreneurs. Copenhagen Twestival was my first experience of meeting the Twitter community, and my guess is it was probably also the largest gathering of Danish Twitter users to date &#8211; we were around 120 people. [...]]]></description>
			<content:encoded><![CDATA[<div class="photo left"><a href="http://flickr.com/photos/rasmusluckow/3275526654/"><img src="http://farm4.static.flickr.com/3455/3275526654_51ebec4806_m_d.jpg" alt="Copenhagen Twestival crowd" /><br />
</a>
<div class="caption">&copy; 2009 <a href="http://www.flickr.com/photos/rasmusluckow/">Rasmus Luckow</a></div>
</div>
<p>We were all there. The geeks, the journalists, the communication and new media consultants and the Internet entrepreneurs. <a href="http://copenhagen.twestival.com/">Copenhagen Twestival</a> was my first experience of meeting the <a href="http://www.twitter.com">Twitter</a> community, and my guess is it was probably also the largest gathering of Danish Twitter users to date &#8211; we were around 120 people. Turns out that the Danish tweet-crowd consists of many well known faces from gatherings such as <a href="http://copenhagenrb.dk/">Copenhagen Ruby Brigade</a>, <a href="http://barcamp.org/BarCampCopenhagen">Barcamp Copenhagen</a> and <a href="http://www.reboot.dk">Reboot</a>.</p>
<p>Copenhagen Twestival was, along with many other similar meetings around the world, a charity event with the purpose of raising money for <a href="http://www.charitywater.org">charity:water</a> &#8211; an organization that argues that clean drinking water is the essential foundation upon which developing countries can evolve into something better. I can&#8217;t claim that I suffer from any great social conscience, but when Maame Agyeben &#8211; a former intern with the organization &#8211; told about charity:water, I was truly impressed. Their administration costs is sponsored separately, which makes them able to say that 100% of the general donations goes to building wells.</p>
<p>Red Cross and other global help organizations are doing a great job, but I like the prospects of charity organizations with a more narrow and dedicated purpose being able to pursue their cause globally by innovative use of Internet services. That night, we generated DKK 5,000 from the sale of 500 lottery tickets to win donated gifts, and probably a similar amount from buying overpriced, donated drinks.</p>
<p><span id="more-177"></span></p>
<div class="photo right"><a href="http://www.flickr.com/photos/rasmusluckow/3274705911/in/set-72157613723071738"><img src="http://farm4.static.flickr.com/3432/3274705911_7e9d73ab57_m_d.jpg" alt="Mikkel Malmberg" /><br />
</a>
<div class="caption">&copy; 2009 <a href="http://www.flickr.com/photos/rasmusluckow/">Rasmus Luckow</a></div>
</div>
<p>The twestival was not just about water and charity. Members of the Danish Twitter community had prepared presentations, and one of them was <a href="http://www.twitter.com/mikker">Mikkel Malmberg a.k.a. mikker</a> with a talk about Twitter &#8211; for people who know Twitter. Mikkel was introduced as &#8220;the craziest guy on Twitter&#8221;, and he showed himself worthy of the title with an entertaining and energetic show. I wouldn&#8217;t do his talk any justice by repeating it in text &#8211; you will have to see him in person some other time.</p>
<p>The culmination of the evening was the Twitter panel, consisting of <a href="http://twitter.com/Funzafunza">Henrik Fohns</a>, journalist from DR, <a href="http://www.twitter.com/mygdal">Thomas Madsen-Mygdal</a>, entrepreneur and organizer of Reboot, and Troels Jørgensen, director of Berlingske Online. The format was a number of predefined questions &#8211; ideally in 140 characters or less &#8211; which each panel member got a chance to reply to. Fohns is a well-known voice from a long-running Danish radio series on technology &#8211; <a href="http://www.dr.dk/P1/harddisken/">Harddisken</a> &#8211; and it was good to see him in the flesh. It was also clear that this was a man with great experience in voicing his opinion on media and technology in comfortable, well-phrased sentences, and I for one felt compelled to believe in everything he said just from the familiarity of the voice.</p>
<div class="photo left"><a href="http://www.flickr.com/photos/rasmusluckow/3274712013/in/set-72157613723071738/"><img src="http://farm4.static.flickr.com/3350/3274712013_aa2937426d_m_d.jpg" alt="Thomas Madsen-Mygdal" /><br />
</a>
<div class="caption">&copy; 2009 <a href="http://www.flickr.com/photos/rasmusluckow/">Rasmus Luckow</a></div>
</div>
<p>Another familiar voice was that of Mygdal. I know him from his Reboot opening speeches and from some of the many technology projects he is involved with, but I didn&#8217;t know how opinionated and loud-mouthed he could be once someone gave him a microphone and asked him to voice his opinions. He reminded me of the hero in the <a href="http://www.rubyonrails.com">Ruby on Rails</a> community &#8211; <a href="http://www.loudthinkning.com">David Heinemeier Hansson</a> &#8211; but where David&#8217;s battle is with &#8220;enterprise&#8221; software development, Thomas&#8217; seems to be with established media and journalism.</p>
<p>The first question was about the future news outlook. Mygdal said that journalists does a poor job, because it is impossible to do what they do. Also that the business model for news papers hasn&#8217;t changed in 250 years, which why they are they are now in so much trouble. &#8220;It&#8217;s pure biology&#8221;, he said, &#8220;nobody tries anything [..] We are really fucked, but we have to try something and fail.&#8221; Fohns compared the volunteer news papers run by all kinds of unemployed people in the 80&#8217;s to today&#8217;s blogging. It is journalism by the unestablished, he said, and he called it &#8220;New Cultural Press&#8221;.</p>
<div class="photo right"><a href="http://www.flickr.com/photos/rasmusluckow/3274712969/in/set-72157613723071738/"><img src="http://farm4.static.flickr.com/3045/3274712969_56b2a3db75_m_d.jpg" alt="Henrik Fohns" /><br />
</a>
<div class="caption">&copy; 2009 <a href="http://www.flickr.com/photos/rasmusluckow/">Rasmus Luckow</a></div>
</div>
<p>Another question was: Do we even need the traditional media? Troels Jørgensen was of the opinion that journalists has far too high wages in Denmark, compared to Sweden, for instance, and that was one reason it is so hard and expensive to run a media house in 2009. Mygdal pointed out that we use the term &#8220;new media&#8221; every time something new comes along that we doesn&#8217;t quite understand. In the mid-90&#8217;s, the Internet was called &#8220;new media&#8221;. He said that we need to reinvent media in a way that really brings the new opportunities together, instead of just trying to coerce &#8220;new media&#8221; into &#8220;old media&#8221;.</p>
<p>One final question worth mentioning was on the issue of media subsidy. As Mygdal put it: &#8220;We spend 6 billion on media subsidy &#8211; the government could finance 2,000 micro medias at 3 million each a year for that money.&#8221; However, as Fohns objected, working in small units, you don&#8217;t always have the required impact. As an example he mentioned the case of IT Factory, where the freelancer Dorte Toft, who spearheaded the whole uncovering process, were under a lot of pressure from the lawyers of Stein Bagger. That kind of pressure is easier too handle when you are part of something bigger, and have lawyers and other support of your own to back you up.</p>
<div class="photo left"><a href="http://flickr.com/photos/kristoffersolberg/3271727360/"><img src="http://farm4.static.flickr.com/3467/3271727360_bcd53fb600_m_d.jpg" alt="Copenhagen Twestival poster" /><br />
</a>
<div class="caption">&copy; 2009 <a href="http://flickr.com/photos/kristoffersolberg/">Kristoffer Solberg</a></div>
</div>
<p>I also remember that Mygdal mentioned at some point that Twitter really isn&#8217;t something new, that it is simply derived from blogging as a format better suited for people like himself, who might not be that good at formulating long articles. What do you think, perhaps I&#8217;d also be better off just keeping to 140 character outbursts? :)</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=R6qswEx1WsA:5y6hmsQ-gJg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=R6qswEx1WsA:5y6hmsQ-gJg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=R6qswEx1WsA:5y6hmsQ-gJg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?a=R6qswEx1WsA:5y6hmsQ-gJg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/FingerprintsOfCasperFabricius?i=R6qswEx1WsA:5y6hmsQ-gJg:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/02/15/reflections-on-copenhagen-twestival/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
