<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Agile Hacking &#187; Web development</title>
	<atom:link href="http://gabrielfalcao.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://gabrielfalcao.com</link>
	<description>The GNUs of mine, and its green builds</description>
	<lastBuildDate>Tue, 08 Jun 2010 13:22:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>lettuce 0.1 official release</title>
		<link>http://gabrielfalcao.com/2010/06/08/lettuce-0-1-official-release/</link>
		<comments>http://gabrielfalcao.com/2010/06/08/lettuce-0-1-official-release/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 04:40:41 +0000</pubDate>
		<dc:creator>Gabriel Falcão</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[agile]]></category>

		<guid isPermaLink="false">http://gabrielfalcao.com/?p=211</guid>
		<description><![CDATA[27 days after its first release candidate, lettuce is now much mature and also got new features.
Lettuce is a BDD tool written in python, 100% based on cucumber.
There are two reasons for the name:

Lettuce is a green vegetable, just like cucumber the idea is that your tests must be always green.
Letuce is the name of a [...]]]></description>
			<content:encoded><![CDATA[<p>27 days after its <a href="http://gabrielfalcao.com/2010/05/12/apresentando-lettuce-bdd-em-python/">first</a> release candidate, <a href="http://lettuce.it">lettuce</a> is now much mature and also got new features.</p>
<p>Lettuce is a <a href="http://pt.wikipedia.org/wiki/Behavior_Driven_Development">BDD</a> tool written in python, 100% based on <a href="http://lettuce.it">cucumber</a>.</p>
<p>There are two reasons for the name:</p>
<ul>
<li>Lettuce is a green vegetable, just like cucumber the idea is that your tests must be always green.</li>
<li><a href="http://www.myspace.com/letuceletuce">Letuce</a> is the name of a brazillian band that I pretty much like</li>
</ul>
<p style="text-align: center;"><a href="http://gabrielfalcao.com/wp-content/uploads/2010/05/screenshot-lettuce1.png"><img class="size-full wp-image-190  aligncenter" title="Lettuce rodando num Mac" src="http://gabrielfalcao.com/wp-content/uploads/2010/05/screenshot-lettuce1.png" alt="" width="490" height="301" /></a></p>
<h2>Hands on!</h2>
<p>There are links to lettuce&#8217;s official documentation at the end of this post, but there is a sneak peak:</p>
<p><a href="http://lettuce.it/reference/features.html#lettuce-feature">Features</a> are described in files with <em>.feature </em>extension and must be, by defaul within your project, in a folder called &#8220;<em>features</em>&#8220;.</p>
<p><em>Features are described like this:</em></p>
<div class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Feature: Introduce lettuce to my friends<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">In</span> order to show it working<br />
&nbsp; As lettuce author<br />
&nbsp; I want to create a scenario that passes<br />
<br />
&nbsp; Scenario: Concatenate names<br />
&nbsp; &nbsp; Given I have the following names:<br />
&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">|</span> name <span style="color:#006600; font-weight:bold;">|</span> surname <span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">|</span> john <span style="color:#006600; font-weight:bold;">|</span> doe     <span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">|</span> ian  <span style="color:#006600; font-weight:bold;">|</span> murdock <span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">When</span> I join them<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">Then</span> I see the data:<br />
&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">|</span> joined       <span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">|</span> Doe, John    <span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">|</span> Murdock, Ian <span style="color:#006600; font-weight:bold;">|</span></div></div>
<p>In order to define steps all you need to do is write a new python file wihin <em>features</em> folder, Lettuce will import them all, recursively.</p>
<p>Example:</p>
<div class="codecolorer-container python vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># -*- coding: utf-8 -*-</span><br />
<span style="color: #ff7700;font-weight:bold;">from</span> lettuce <span style="color: #ff7700;font-weight:bold;">import</span> step, world, before<br />
<span style="color: #ff7700;font-weight:bold;">from</span> some_module <span style="color: #ff7700;font-weight:bold;">import</span> NameJoiner<br />
<br />
<span style="color: #808080; font-style: italic;"># setup</span><br />
@before.<span style="color: black;">each_scenario</span><br />
<span style="color: #ff7700;font-weight:bold;">def</span> set_joined<span style="color: black;">&#40;</span>scenario<span style="color: black;">&#41;</span>:<br />
&nbsp; world.<span style="color: black;">joined</span> = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
<br />
<span style="color: #808080; font-style: italic;"># steps</span><br />
@step<span style="color: black;">&#40;</span><span style="color: #483d8b;">'I have the following names'</span><span style="color: black;">&#41;</span><br />
<span style="color: #ff7700;font-weight:bold;">def</span> set_names<span style="color: black;">&#40;</span>step<span style="color: black;">&#41;</span>:<br />
&nbsp; world.<span style="color: black;">people</span> = step.<span style="color: black;">hashes</span><br />
<br />
@step<span style="color: black;">&#40;</span><span style="color: #483d8b;">'join them'</span><span style="color: black;">&#41;</span><br />
<span style="color: #ff7700;font-weight:bold;">def</span> join_names<span style="color: black;">&#40;</span>step<span style="color: black;">&#41;</span>:<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> person <span style="color: #ff7700;font-weight:bold;">in</span> world.<span style="color: black;">people</span>:<br />
&nbsp; &nbsp; joiner = NameJoiner<span style="color: black;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; name=person<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;name&quot;</span><span style="color: black;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; surname=person<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;surname&quot;</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: black;">&#41;</span><br />
&nbsp; world.<span style="color: black;">joined</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span>joiner.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
@step<span style="color: black;">&#40;</span><span style="color: #483d8b;">'I see the data'</span><span style="color: black;">&#41;</span><br />
<span style="color: #ff7700;font-weight:bold;">def</span> check_names<span style="color: black;">&#40;</span>step<span style="color: black;">&#41;</span>:<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> name, data <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">zip</span><span style="color: black;">&#40;</span>world.<span style="color: black;">joined</span>, step.<span style="color: black;">hashes</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">assert</span> name == data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'joined'</span><span style="color: black;">&#93;</span></div></div>
<p>(the full example is available here <a href="http://gabrielfalcao.com/wp-content/uploads/2010/05/lettuce-example.zip">aqui</a>)</p>
<h1>Motivation</h1>
<p>Since I started with <a href="http://pt.wikipedia.org/wiki/Test_Driven_Development">TDD</a> in <a href="http://python.org">Python</a> I had many experiences, I&#8217;ve tested many mock <a href="http://pt.wikipedia.org/wiki/Mock_Object">mock</a> libraries and test techniques.<br />
In web projects I&#8217;ve used <a href="http://wiki.github.com/heynemann/pyccuracy/">Pyccuracy</a>, so that I could both describe <a href="http://pt.wikipedia.org/wiki/Behavior_Driven_Development">behaviour</a> of the application and make automated acceptance tests.</p>
<p>Althrough, I had a chance to try <a href="http://cukes.info">Cucumber</a> with <a href="http://djangoproject.com">Django</a> here at <a href="http://globo.com">globo.com</a>, and the result was: I fell in love with it, and had incredibly productive features, such as <a href="http://wiki.github.com/aslakhellesoy/cucumber/multiline-step-arguments"><em>step tables</em></a> which allows drawing a ascii table and map it into a list of hashes, and the <a href="http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines">scenario outlines</a>.</p>
<p>From there I had THE inspiration: to implement a tool that works exactly like <a href="http://cukes.info">Cucumber</a>, but in python.</p>
<p>Why ?</p>
<p>Python programmers it&#8217;s easier and frictionless to use libraries written in Python. I personally avoid mixing programming languages in a single project, some technologies can suit perfectly in the project, no matter in what language, but if there is a Python option, I will give it a go.</p>
<p>Cucumber IMHO one lib to make ruby even more &#8220;sexy&#8221; <img src='http://gabrielfalcao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Build a robust application, well tested required patience, what about turn it into fun ! ?<br />
It&#8217;s easier to package python modules for debian/ubuntu.</p>
<p>Besides, even considering the fact that  <a href="http://wiki.github.com/aslakhellesoy/cucumber/python">Cucumber already supports</a>, would be more interesting to user pure python within step definitions.<br />
Supposing that a web application will be written with Django and Cucumber, would be very useful to manipulate models within step definitions. However turning it possible, would need efforts to run <a href="http://rubyforge.org/projects/rubypython">rubypython</a>, which the latest release dates october 2009.</p>
<h2>Examples of similar libraries between python and ruby</h2>
<p><strong>Web framework:</strong></p>
<pre>ruby: <a href="http://rubyonrails.org/">rails
</a>python: <a href="http://djangoproject.com">django</a></pre>
<h3>Micro web framework:</h3>
<pre>ruby: <a href="http://sinatrarb.com">sinatra
</a>python: <a href="http://cherrypy.org">cherrypy</a></pre>
<h3>Automated deploy:</h3>
<pre>ruby: <a href="http://capify.org">capistrano
</a>python: <a href="http://fabfile.org">fabric</a></pre>
<h3>Behaviour-driven development:</h3>
<pre>ruby: <a href="http://cukes.info">cucumber
</a>python: <a href="http://lettuce.it">lettuce</a> ?! (maybe ?! Who knows ?! <img src='http://gabrielfalcao.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</pre>
<h1>More on lettuce</h1>
<p><strong>Documentation</strong></p>
<p>Available at <a href="http://lettuce.it">http://lettuce.it</a> covers all supported features until now.</p>
<h2>Contribute!</h2>
<p>I&#8217;ll appreciate all kinds of feedback, to do so we have some channels:</p>
<ul>
<li><a href="http://github.com/gabrielfalcao/lettuce">GitHub repository</a></li>
<li>Junte-se à <a href="http://groups.google.com/group/lettuce-users">lettuce users mailing list</a></li>
<li><a href="http://github.com/gabrielfalcao/lettuce/issues">bugtracker !</a></li>
</ul>
<p>Lettuce is under GNU GPL 3+ and have a long way until get robust, and any kind of help is welcome: patches, documentation, language support and so on!</p>
<p><a href="http://lettuce.it/#lettuce-getting-involved">Grab it</a>, and happy hacking <img src='http://gabrielfalcao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://gabrielfalcao.com/2010/06/08/lettuce-0-1-official-release/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Eclipse + Java + UML + RESTful, the real silver bullet</title>
		<link>http://gabrielfalcao.com/2009/04/01/eclipsejava-much-better-aprils-fool/</link>
		<comments>http://gabrielfalcao.com/2009/04/01/eclipsejava-much-better-aprils-fool/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 11:30:23 +0000</pubDate>
		<dc:creator>gabriel</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[not true]]></category>

		<guid isPermaLink="false">http://gabrielfalcao.com/?p=21</guid>
		<description><![CDATA[Some days ago I was just thinking about all these agile bullshit.
I mean, no matter if you do TDD or not, if you do care about continuous integration, this is all a real lose of time.
When thinking about shipping good software, the best combination is, indeed, quite simple:

Use a powerful IDE. You as developer don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago I was just thinking about <a href="http://en.wikipedia.org/wiki/Agile_software_development">all</a> <a href="http://en.wikipedia.org/wiki/Scrum_(development)">these</a> <a href="http://en.wikipedia.org/wiki/You_Ain%27t_Gonna_Need_It">agile</a> <a href="http://en.wikipedia.org/wiki/Continuous_Integration">bullshit</a>.</p>
<p>I mean, no matter if you do TDD or not, if you do care about continuous integration, this is all a real lose of time.</p>
<p>When thinking about <a href="http://en.wikipedia.org/wiki/April_Fools%27_Day">shipping</a> good software, the best combination is, indeed, quite simple:</p>
<ol>
<li>Use a powerful IDE. You as developer don&#8217;t even need to now how the things work, let the IDE do everything for you. <a href="http://en.wikipedia.org/wiki/Eclipse_(software)">Eclipse</a> is <a href="http://en.wikipedia.org/wiki/Disgust">the one you really need</a>.</li>
<li>Use a well known, certified and reliable language. Why using dynamic languages ? You don&#8217;t need to be agile, you need to ship something with trust value, so build it with java.</li>
<li>Don&#8217;t code, use wizards and boilerplate generators. Once again, what is better, easy money or thousands of hours hacking things from scratch ? You can use UML-based code generators, and super-duper eclipse plugins to generate your code. Forget all stress and make your project manager happy.</li>
<li>Prepare yourself for possible future needs. To build a real scallable application you must ALWAYS use a complex <a href="http://en.wikipedia.org/wiki/Service-oriented_architecture">SOA</a> approach, so you can separate business-rules in each module and distribute in many servers. A RESTful approach is even better. <a href="http://en.wikipedia.org/wiki/April_Fools%27_Day">Forget everything</a> about agile software development, your customer doesn&#8217;t need a term, he needs a full-featured project.</li>
</ol>
<p>To but it bluntly, <a href="http://en.wikipedia.org/wiki/Fred_Brooks">Fred Brooks</a> was totally wrong in his book <a href="http://en.wikipedia.org/wiki/The_Mythical_Man-Month">&#8220;The Mythical Man-Month&#8221;</a>, about &#8220;no silver bullet&#8221;, the steps below are, indeed, a silver bullet and you can see proofs of this sentence in the &#8220;Martin Flawler&#8217;s&#8221; <a href="http://en.wikipedia.org/wiki/April_Fools%27_Day">article.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gabrielfalcao.com/2009/04/01/eclipsejava-much-better-aprils-fool/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hosting and deploying django apps on Dreamhost</title>
		<link>http://gabrielfalcao.com/2008/12/02/hosting-and-deploying-django-apps-on-dreamhost/</link>
		<comments>http://gabrielfalcao.com/2008/12/02/hosting-and-deploying-django-apps-on-dreamhost/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 12:12:00 +0000</pubDate>
		<dc:creator>gabriel</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://gabrielfalcao.com/?p=10</guid>
		<description><![CDATA[About two years ago, I&#8217;ve signed up to Dreamhost. My goals were and still being to host my personal projects, websites and so on.
Once I am a Django web developer, one of my first actions were to create a django deployment setup, good and flexible enough. The time passed on and have been got new [...]]]></description>
			<content:encoded><![CDATA[<p>About two years ago, I&#8217;ve signed up to Dreamhost. My goals were and still being to host my personal projects, websites and so on.</p>
<p>Once I am a <a href="http://www.djangoproject.com/">Django</a> web developer, one of my first actions were to create a django deployment setup, good and flexible enough. The time passed on and have been got new experiences, and the best desision, i think, was to create a new python sandbox, i mean, a customized python environment.</p>
<h2>How is it possible ?</h2>
<p>Simple! Just compiling python from scratch, with a fake root path (a prefix)</p>
<p>Anyway, the deployment process involves more variables, like setting both htaccess and dispatch files for each project, installing some basic modules such <a href="http://www.pythonware.com/products/pil/">PIL</a> and <a href="http://sourceforge.net/projects/mysql-python/">MySQL</a> and so on&#8230;</p>
<p>So, i ever wanted to create a super duper script to do all that &#8220;dirty&#8221; work. And i did it last weekend!</p>
<p>I were working ia a freelance job and decided to create a subdomain to host test instance of them.</p>
<p>A new sandbox, ready to make my tests to create the super script.</p>
<p>So folks, i present you the brand new: <strong>django_dreamhost.sh</strong> <img src='http://gabrielfalcao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It&#8217;s composed by 4 files:</p>
<ul>
<li><strong>django_dreamhost.sh</strong> itself</li>
<li><strong>djangify.template</strong> &#8211; a template with will become a script to setup new projects (htaccess and dipatch files, for instance)</li>
<li><strong>htaccess.template</strong> &#8211; a template that will become the .htaccess of each project of yours</li>
<li><strong>dispatch.template</strong> &#8211; will become the dispatch.fcgi for your projects as well</li>
</ul>
<p>&#8220;But do i need to download all them ?&#8221;, of course NO!</p>
<p>You just download the main script, and he will do all do hard work!</p>
<p>&#8220;I wanna contribute, modify or do anything with that script, can I ?&#8221;, of course yes! All parts of the script are GPLv2 +</p>
<p>You can also always get the development version through <a href="http://git.or.cz/">git</a> repository:</p>
<p><strong>git clone http://git.nacaolivre.org/django_dreamhost</strong></p>
<p>Don&#8217;t want to get all code, just the script ?</p>
<p>Download it at: <a href="http://gnu.gabrielfalcao.com/django_dreamhost/django_dreamhost.sh"><strong>http://gnu.gabrielfalcao.com/django_dreamhost/django_dreamhost.sh</strong></a></p>
<h2><strong>What does that script do ?</strong></h2>
<p>He will do the following steps:</p>
<ol>
<li>Download Python, Django, Python-setuptools, Python-fastcgi to a directory called downloads</li>
<li>Extract all</li>
<li>Create a local root at $HOME/.myroot and the subdirs etc and usr</li>
<li>Set the new bin path to you global path through bashrc and bash_profile</li>
<li>Compile and install python to the new prefix: $HOME/.myroot/usr</li>
<li>Install Django, rename django-admin.py to django-admin</li>
<li>Setup your bash-completion to support django scripts</li>
<li>Install the python modules above with the new python</li>
<li>Install PIL and MYSQL modules through easy_install (setuptools)</li>
<li>Download the template scripts to $HOME/projects/script_templates</li>
<li>Replace the custom tags in templates</li>
<li>Move the djangify.template to the new bin PATH: $HOME/usr/bin and give it execution permission</li>
</ol>
<p>I thinks it&#8217;s all.</p>
<p>I currently use <a href="http://www.nongnu.org/fab/">Fabric</a> to help on deployment, and i have a quite smart basic setup for it to work with this dreamhost django environment, but it will be approached in the next blog post <img src='http://gabrielfalcao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>See you, folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrielfalcao.com/2008/12/02/hosting-and-deploying-django-apps-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
