<?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>Ladislav Martincik - Personal website</title>
	<atom:link href="http://martincik.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://martincik.com</link>
	<description>Sharing my thoughts with world</description>
	<lastBuildDate>Sat, 03 Jul 2010 10:45:14 +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>Updates for Retaste.me</title>
		<link>http://martincik.com/?p=239</link>
		<comments>http://martincik.com/?p=239#comments</comments>
		<pubDate>Sat, 03 Jul 2010 10:45:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://martincik.com/?p=239</guid>
		<description><![CDATA[
Retaste.me was a few weeks not delivering any emails. I apologize for it. The site was constantly after 5 requests throttled by delicous. Last week I was finally able talk to delicious developer. He explained me why I got throttled that many times and what to do to prevent it. I applied all their advice [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-241" title="retaste.me - Weekly del.icio.us menu" src="http://martincik.com/wp-content/uploads/2010/07/retaste.me-Weekly-del.icio_.us-menu-300x243.jpg" alt="" width="300" height="243" /></p>
<p>Retaste.me was a few weeks not delivering any emails. I apologize for it. The site was constantly after 5 requests throttled by delicous. Last week I was finally able talk to delicious developer. He explained me why I got throttled that many times and what to do to prevent it. I applied all their advice and deployed new version of retaste.me app. I also added new look and feel for email and implemented delete functionality. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://martincik.com/?feed=rss2&amp;p=239</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StackBuffer.com &#8211; awesome StackOverflow interface</title>
		<link>http://martincik.com/?p=233</link>
		<comments>http://martincik.com/?p=233#comments</comments>
		<pubDate>Fri, 02 Jul 2010 14:56:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://martincik.com/?p=233</guid>
		<description><![CDATA[I have just released my new &#8220;exprimental&#8221; project. Its name is StackBuffer.com. StackBuffer.com is web interface for StackOverflow.com API based only on HTML5, CSS3 and JavaScript. There&#8217;s no backend. Here&#8217;s screenshot how it looks like:
StackBuffer is open source project providing HTML5 and CSS3 interface for StackOverflow API. This project is actually experiment trying to prove [...]]]></description>
			<content:encoded><![CDATA[<p>I have just released my new &#8220;exprimental&#8221; project. Its name is StackBuffer.com. StackBuffer.com is web interface for StackOverflow.com API based only on HTML5, CSS3 and JavaScript. There&#8217;s no backend. Here&#8217;s screenshot how it looks like:</p>
<div id="attachment_234" class="wp-caption alignleft" style="width: 310px"><a href="http://martincik.com/wp-content/uploads/2010/07/StackBuffer-awesome-StackOverflow-interface.jpg"><img class="size-medium wp-image-234" title="StackBuffer | awesome StackOverflow interface" src="http://martincik.com/wp-content/uploads/2010/07/StackBuffer-awesome-StackOverflow-interface-300x208.jpg" alt="stackbuffer.com" width="300" height="208" /></a><p class="wp-caption-text">StackBuffer | awesome StackOverflow interface</p></div>
<p>StackBuffer is open source project providing HTML5 and CSS3 interface for StackOverflow API. This project is actually experiment trying to prove that you can write only HTML5, CSS3 and JavaScript without need to do any backend programming. This app is targeted mostly to developers to see what can be done in short period of time with new HTML5 and CSS3. Consider it example application.</p>
<p>You can also find the description at stackapps.com: http://stackapps.com/questions/972/stackbuffer-awesome-stackoverflow-interface-html5-css3</p>
<p>I would appreciate very much any kind of feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://martincik.com/?feed=rss2&amp;p=233</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiring &#8220;Rock Stars&#8221; with the right life philosophy</title>
		<link>http://martincik.com/?p=207</link>
		<comments>http://martincik.com/?p=207#comments</comments>
		<pubDate>Thu, 26 Nov 2009 18:30:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Motivation]]></category>
		<category><![CDATA[Team]]></category>
		<category><![CDATA[team rockstar philosophy life]]></category>

		<guid isPermaLink="false">http://martincik.com/?p=207</guid>
		<description><![CDATA[ I&#8217;m working in a team of very smart and talented people, but from time to time I feel like it&#8217;s very contra-productive. All the discussion about the way the software should be written or designed. It&#8217;s exhausting and demotivating! The reason I&#8217;m writing about it is not that I need to only get it [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://martincik.com/wp-content/uploads/2009/11/Rocker-159x300.jpg" alt="Rocker" title="Rocker" width="159" height="300" class="alignleft size-medium wp-image-209" /> I&#8217;m working in a team of very smart and talented people, but from time to time I feel like it&#8217;s very contra-productive. All the discussion about the way the software should be written or designed. It&#8217;s exhausting and demotivating! The reason I&#8217;m writing about it is not that I need to only get it out of my head and share, but also the believe that I know why is it happening and how to change it.</p>
<p>All the smart and successful guys like Joel Spolsky will tell you that you should always hire the best you can. One reason is that A players will always want to hire A players. To my experience it feels little a bit wrong. I had an opportunity to work with very smart people (I mean technically and logically smart) and I love the chalenge to work with them, but there&#8217;s something that&#8217;s missing. The missing part is the philosophy of life. </p>
<p>In a past few years I&#8217;ve been thinking about the fact that I&#8217;ve been working with excellent people around the world and also with some other people which wasn&#8217;t actually that skilled or experienced. It turned out that I tend to work better with people with the same philosophy of life. There were people that actually wasn&#8217;t that good at their work skills but the way they connected with me helped the whole team/project to be more productive and successful.</p>
<p>I think Jason Fried also mentioned this fact many times, but I didn&#8217;t see it for some reason and long time it was just about hiring A&#8217;s or &#8220;Rock Stars&#8221;. Now I know that hiring ONLY smart people isn&#8217;t the way to go. Very pity it took me so long to figure this out, but I understand it now.</p>
<p>My advice is: <strong>&#8220;Hire the best you can but make sure they fit to your life and philosophy of life.&#8221;</strong> The same advice goes with joining new team or company.</p>
<p>Note: Photo from <a href="http://www.sxc.hu/photo/894247">stock.xchng</a></p>
]]></content:encoded>
			<wfw:commentRss>http://martincik.com/?feed=rss2&amp;p=207</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bootstraping Chef Server/Client with Sprinkle</title>
		<link>http://martincik.com/?p=213</link>
		<comments>http://martincik.com/?p=213#comments</comments>
		<pubDate>Thu, 26 Nov 2009 14:00:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[ruby chef server client sprinkle bootstrap]]></category>

		<guid isPermaLink="false">http://martincik.com/?p=213</guid>
		<description><![CDATA[I like very much Chef tool for server configuration. I think it&#8217;s very good tool and every company doing web development should use it to bootstrap or configure their servers. But the sad truth is that before you can use Chef you need to prepare the machine with manual typing and configuration. And that&#8217;s what [...]]]></description>
			<content:encoded><![CDATA[<p>I like very much <a href="http://wiki.opscode.com/display/chef/Home">Chef</a> tool for server configuration. I think it&#8217;s very good tool and every company doing web development should use it to bootstrap or configure their servers. But the sad truth is that before you can use Chef you need to prepare the machine with manual typing and configuration. And that&#8217;s what I don&#8217;t want to do. So I decided to change that by automating the Chef bootstrap with <a href="http://github.com/crafterm/sprinkle/">Sprinkle</a>.</p>
<p>1) Download the code:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>lacomartincik<span style="color: #000000; font-weight: bold;">/</span>chef-bootstrap.git</div></td></tr></tbody></table></div>
<p>2) Have ready your server or virtual machine<br />
3) Create config file</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">cp</span> config<span style="color: #000000; font-weight: bold;">/</span>config.yml.example config<span style="color: #000000; font-weight: bold;">/</span>config.yml</div></td></tr></tbody></table></div>
<p>4) Set up the config with IP and user credentials</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server:<br />
&nbsp; host: chef.server.local<br />
&nbsp; ip: 192.168.0.1<br />
&nbsp; user: deploy<br />
&nbsp; password: deploy<br />
<br />
client:<br />
&nbsp; ip: 192.168.0.2<br />
&nbsp; user: deploy<br />
&nbsp; password: deploy</div></td></tr></tbody></table></div>
<p>5) Run server/client bootstrap</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>chef-server</div></td></tr></tbody></table></div>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>chef-client</div></td></tr></tbody></table></div>
<p>Hope you find it useful. Any comments, recommendations always welcomed!</p>
]]></content:encoded>
			<wfw:commentRss>http://martincik.com/?feed=rss2&amp;p=213</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 Mentors I admire and I follow</title>
		<link>http://martincik.com/?p=138</link>
		<comments>http://martincik.com/?p=138#comments</comments>
		<pubDate>Sun, 22 Nov 2009 15:59:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Motivation]]></category>

		<guid isPermaLink="false">http://martincik.com/?p=138</guid>
		<description><![CDATA[I read a lot and I listen to audio books whenever I&#8217;m not able to read. Because I&#8217;m doing this almost 8 years I think it would be nice if I share with you what are the people that influenced me and my life. These mentors are also my day to day food helping me [...]]]></description>
			<content:encoded><![CDATA[<p>I read a lot and I listen to audio books whenever I&#8217;m not able to read. Because I&#8217;m doing this almost 8 years I think it would be nice if I share with you what are the people that influenced me and my life. These mentors are also my day to day food helping me to overcome my challenges (I tend to use word challenge instead of problem) and motivate me whenever I need to. I highly recommend to all of you to have a look at them and if you like them try to follow them.</p>
<p><img src="http://martincik.com/wp-content/uploads/2009/11/brian_in_garden.jpg" alt="Brian Tracy" title="Brian Tracy" width="151"  class="alignleft size-full wp-image-article wp-image-151" /><strong>Brian Tracy</strong> (<a href="http://www.briantracy.com">www.briantracy.com</a>)</p>
<p>You can read a lot about Brian on his own website where he&#8217;s presenting himself  with very professional language but also with a lot of sales-kind-of paragraphs which I really don&#8217;t like much. For me Brian Tracy is one of the best when it comes to motivating people and explaining whatever is happening in your life and how to change it to better. His voice and the way he presents stuff is just awesome.  </p>
<p>Audible.com offers a lot of audio books from Brian Tracy. I like very much the &#8220;Luck Factor&#8221;. For me it was eyes opening. Also I&#8217;m listening to him most of the days I&#8217;m walking to the office to keep me motivated.<br />
<br style="clear: both;" /></p>
<p><img class="size-full wp-image-141 alignleft wp-image-article" title="Anthony Robbins Blog" src="http://martincik.com/wp-content/uploads/2009/11/Anthony-Robbins-Blog.jpg" alt="Anthony Robbins" width="151" /><strong>Tony Robbins</strong> (<a href="http://tonyrobbinstraining.com/">tonyrobbinstraining.com</a>, <a href="http://www.tonyrobbins.com">www.tonyrobbins.com</a>)</p>
<p>Tony Robbins is very popular life coach and he also calls himself &#8220;<a href="http://www.ted.com/talks/lang/eng/tony_robbins_asks_why_we_do_what_we_do.html">the why guy</a>&#8220;. I&#8217;m following his blog at <a href="http://tonyrobbinstraining.com/">tonyrobbinstraining.com</a> where he shares his thoughts mostly in video format. I really like the way he explains WHY the life is the way it is and what we can do about it. Notice how often he use smashing his hands to each other or says &#8220;I&#8221;. <img src='http://martincik.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Full of win! One day I&#8217;m going to attend his seminar(s).</p>
<p><br style="clear: both;" /></p>
<p><img src="http://martincik.com/wp-content/uploads/2009/11/The-Blog-of-Author-Tim-Ferriss.jpg" alt="The Blog of Author Tim Ferriss" title="The Blog of Author Tim Ferriss" width="151" class="alignleft size-full wp-image-article wp-image-175" /><strong>Tim Ferriss</strong> (<a href="http://www.fourhourworkweek.com/blog/">www.fourhourworkweek.com</a>)</p>
<p>Life hacker, author, enterpreneur, dancer, experimenter with life style. If you didn&#8217;t read Tim&#8217;s book &#8220;<a href="http://www.amazon.com/4-Hour-Workweek-Expanded-Updated-Cutting-Edge/dp/0307465357/ref=sr_1_2?ie=UTF8&#038;s=books&#038;qid=1258899944&#038;sr=1-2">The 4-hour Work Week</a>&#8221; go and buy it and read it. Very practical book which helped me to understand how much outsourcing can help you in your life. I&#8217;ve already outsourced many things I would before reading this book maybe never considered. Tim is also very frequent blogger and video author so don&#8217;t hesitate to follow his <a href="http://www.fourhourworkweek.com/blog/">blog</a> and <a href="http://twitter.com/tferriss">twitter</a>.</p>
<p><br style="clear: both;" /></p>
<p><img src="http://martincik.com/wp-content/uploads/2009/11/kevin_rose.jpg" alt="kevin_rose" title="kevin_rose" width="151"  class="alignleft size-full wp-image-article wp-image-189" /><strong>Kevin Rose</strong> (<a href="http://kevinrose.com/">kevinrose.com</a>)</p>
<p>He is the co-founder of <a href="http://revision3.com/">Revision3</a>, <a href="http://en.wikipedia.org/wiki/Pownce">Pownce</a>, WeFollow and the social-bookmarking website <a href="http://digg.com">Digg</a>. I really admire him because he&#8217;s very successful and shares his knowledge and wisdom. I really like video series called &#8220;<a href="http://vimeo.com/6067197">Random</a>&#8221; which he&#8217;s doing altogether with Tim Ferriss. I know that he&#8217;s also doing show called &#8220;<a href="http://revision3.com/diggnation/">Diggnation</a>&#8221; but I&#8217;m not watching it.</p>
<p><br style="clear: both;" /></p>
<p><img src="http://martincik.com/wp-content/uploads/2009/11/andrew-warner-founder-mixergy-cropped.jpg" alt="Andrew Warner" title="Andrew Warner" width="151" class="alignleft size-full wp-image-article wp-image-196" /><strong>Andrew Warner</strong> (<a href="http://mixergy.com">mixergy.com</a>)</p>
<p>I can&#8217;t miss one of the most active mentors on the web Andrew Warner founder of <a href="http://mixergy.com">Mixergy.com</a> collecting interviews of enterpreneurs and other successful people for all of us to learn from them. All the videos are great way how to learn from mistakes of others and find out how others are doing it. You should not miss any of these interviews!</p>
<p><br style="clear: both;" /></p>
<p>Of course there are other mentors and successful people I&#8217;ve been following but these guys have been the most visible and helpful to me on my journey to understand life and it&#8217;s purpose. </p>
<p><strong>Which are yours?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://martincik.com/?feed=rss2&amp;p=138</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing Ruby on Rails fixtures with Factories and Builders</title>
		<link>http://martincik.com/?p=112</link>
		<comments>http://martincik.com/?p=112#comments</comments>
		<pubDate>Sat, 04 Jul 2009 18:23:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[ruby rails fixtures builders design patterns]]></category>

		<guid isPermaLink="false">http://martincik.com/?p=112</guid>
		<description><![CDATA[In my current job we were facing a well known problem called Fixtures. The term Fixtures in context of Ruby On Rails framework is the default way how the testing data are prepared/created before the tests run.
Here&#8217;s the list of important reasons why Fixtures are pain:

Hard to read (YAML format)
Hard to define edge cases
Almost impossible [...]]]></description>
			<content:encoded><![CDATA[<p>In my current job we were facing a well known problem called Fixtures. The term Fixtures in context of Ruby On Rails framework is the default way how the testing data are prepared/created before the tests run.</p>
<p>Here&#8217;s the list of important reasons why Fixtures are pain:</p>
<ol>
<li>Hard to read (YAML format)</li>
<li>Hard to define edge cases</li>
<li>Almost impossible to modify after reaching certain size of fixtures</li>
</ol>
<p>The only real reason for using fixtures which I can find is <strong>speed</strong>. So if you&#8217;re on small project or you really need to have tests running fast then the fixtures are good choice. But if you need to have easy to read tests with test data, possibility to easily modify them and having be able to define a lot of edge cases here&#8217;s one nice possible way to go called <a href="http://en.wikipedia.org/wiki/Design_patterns">Design Patterns</a>.</p>
<p><strong>Factory patterns</strong> (<a href="http://en.wikipedia.org/wiki/Factory_pattern">http://en.wikipedia.org/wiki/Factory_pattern</a>)<br />
In these days people are already using Factory pattern as replacement for Fixtures and you can find plenty libraries to help you simplify the work:</p>
<ul>
<li>FactoryGirl (<a href="http://thoughtbot.com/projects/factory_girl">http://thoughtbot.com/projects/factory_girl</a>)</li>
<li>Foundry (<a href="http://github.com/jeremymcanally/foundry/tree/master">http://github.com/jeremymcanally/foundry/tree/master</a>)</li>
<li>Machinist (<a href="http://github.com/notahat/machinist">http://github.com/notahat/machinist</a>)</li>
<li>ObjectDaddy (<a href="http://tasks.ogtastic.com/projects/show/object-daddy">http://tasks.ogtastic.com/projects/show/object-daddy</a>)</li>
</ul>
<p>At the end we decided to go for FactoryGirl because it&#8217;s <a href="http://ruby-toolbox.com/categories/rails_fixture_replacement.html">widely used</a> which means there&#8217;s a lot of people to help us with answering questions and fixing bugs.</p>
<p>Example of FactoryGirl:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Factory.<span style="color:#9900CC;">define</span> <span style="color:#ff3333; font-weight:bold;">:invoice</span>, :<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> Invoice <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>u<span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; u.<span style="color:#9900CC;">created_at</span> <span style="color:#006666;">2</span>.<span style="color:#9900CC;">days</span>.<span style="color:#9900CC;">ago</span><br />
&nbsp; u.<span style="color:#9900CC;">started_at</span> <span style="color:#006666;">2</span>.<span style="color:#9900CC;">months</span>.<span style="color:#9900CC;">ago</span>.<span style="color:#9900CC;">beginning_of_month</span><br />
&nbsp; u.<span style="color:#9900CC;">ended_at</span> <span style="color:#006666;">2</span>.<span style="color:#9900CC;">months</span>.<span style="color:#9900CC;">ago</span>.<span style="color:#9900CC;">end_of_month</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
Factory.<span style="color:#9900CC;">define</span> <span style="color:#ff3333; font-weight:bold;">:invoice_with_billing_cycle</span>, <span style="color:#ff3333; font-weight:bold;">:parent</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:invoice</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>u<span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; u.<span style="color:#9900CC;">association</span> <span style="color:#ff3333; font-weight:bold;">:billing_cycle</span>, <span style="color:#ff3333; font-weight:bold;">:factory</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:billing_cycle_2_months_ago</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>Personally I also like very much <a href="http://github.com/jeremymcanally/foundry/tree/master">Foundry</a> by <a href="http://github.com/jeremymcanally">Jeremy McAnally</a>. The only disadvantage is that it&#8217;s closely linked with Ruby On Rails named_scopes implementation.</p>
<p><strong>Builder pattern</strong> (<a href="http://en.wikipedia.org/wiki/Builder_pattern">http://en.wikipedia.org/wiki/Builder_pattern</a>)<br />
This pattern isn&#8217;t yet widely used as Factory in Ruby On Rails community. I really don&#8217;t know why, but I didn&#8217;t find any article about using it so here we go.</p>
<p>I like to use this design pattern in situations when:</p>
<ul>
<li>You need to create complex object structures (together with Factory)</li>
<li>You need to be flexible with creating many edge cases</li>
</ul>
<p>The best thing about using Builder pattern is that you don&#8217;t need any library but just pure Ruby objects.</p>
<p>Example of Builder pattern in Ruby combined with Factory girl:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> InvoiceBuilder<br />
&nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>invoice_factory, options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@invoice_factory</span> = invoice_factory<br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@options</span> = options<br />
&nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">self</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> with_line_items<span style="color:#006600; font-weight:bold;">&#40;</span>line_items<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@line_items</span> = line_items<br />
&nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">self</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> create<br />
&nbsp; &nbsp; invoice = Factory<span style="color:#006600; font-weight:bold;">&#40;</span>@invoice_factory.<span style="color:#9900CC;">to_sym</span>, <span style="color:#0066ff; font-weight:bold;">@options</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@line_items</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>li<span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; &nbsp; li_factory, li_options = li<br />
&nbsp; &nbsp; &nbsp; invoice.<span style="color:#9900CC;">line_items</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> Factory<span style="color:#006600; font-weight:bold;">&#40;</span>li_factory.<span style="color:#9900CC;">to_sym</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp;li_options.<span style="color:#9900CC;">merge</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:invoice</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> invoice<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; invoice<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>The code above shows very flexible way of using Builder pattern to chain your criteria as you need them. You can than write something like this:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">InvoiceBuilder.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:invoice_with_billing_cycle</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">with_line_items</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span> item1, item2 <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">create</span></div></td></tr></tbody></table></div>
<p>Interesting articles to read:</p>
<ul>
<li>Use builder pattern to create complex objects with relations (<a href="http://nat.truemesh.com/archives/000714.html">http://nat.truemesh.com/archives/000714.html</a>)</li>
<li>Good points about testing from Jay Fields: <a href="http://blog.jayfields.com/2009/02/thoughts-on-developer-testing.html">http://blog.jayfields.com/2009/02/thoughts-on-developer-testing.html</a></li>
</ul>
<p>Things to consider:</p>
<ul>
<li>Try to keep your tests and Factories simple</li>
<li>Keep your data very close to your tests</li>
<li>Create complex structures with Builder pattern</li>
</ul>
<p>Thanks for reading. Let me know what you think in comments. Any kind of feedback appreciated!</p>
]]></content:encoded>
			<wfw:commentRss>http://martincik.com/?feed=rss2&amp;p=112</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Null Object pattern with Ruby on Rails</title>
		<link>http://martincik.com/?p=22</link>
		<comments>http://martincik.com/?p=22#comments</comments>
		<pubDate>Fri, 23 Jan 2009 20:53:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby rails null object design pattern]]></category>

		<guid isPermaLink="false">http://martincik.com/?p=22</guid>
		<description><![CDATA[While back ago I&#8217;ve released plugin to implement Null Object Pattern. And I&#8217;ve decided to write about it. Mostly because people are not using it or don&#8217;t know it.
What it does?
Instead of using a null reference to convey absence of an object (for instance, a non-existent customer), one uses an object which implements the expected [...]]]></description>
			<content:encoded><![CDATA[<p>While back ago I&#8217;ve released plugin to implement Null Object Pattern. And I&#8217;ve decided to write about it. Mostly because people are not using it or don&#8217;t know it.</p>
<p><strong>What it does?</strong></p>
<p>Instead of using a null reference to convey absence of an object (for instance, a non-existent customer), one uses an object which implements the expected interface, but whose method body is empty. The advantage of this approach over a working default implementation is that a Null Object is very predictable and has no side effects.</p>
<p><strong>Why should I use it?</strong></p>
<ul>
<li>You will not have to prevent your code from having null reference. For example you will not have to do this:
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; <span style="color:#CC0066; font-weight:bold;">print</span> post.<span style="color:#9900CC;">user</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>? ? <span style="color:#996600;">'Null user'</span> : post.<span style="color:#9900CC;">user</span>.<span style="color:#9900CC;">name</span></div></td></tr></tbody></table></div>
<p>With Null Object pattern you write just <strong>print post.user.name</strong> and you&#8217;ll get default value for Null object defined for this attribute.
</li>
<li>It&#8217;s very handy if you&#8217;re doing some kind of reporting that you don&#8217;t have to deal with null reference and you have object (in SQL row reference) instead.</li>
</ul>
<p><strong>To install the plugin</strong></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ruby script<span style="color: #000000; font-weight: bold;">/</span>plugin <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>lacomartincik<span style="color: #000000; font-weight: bold;">/</span>acts_as_nullobject.git</div></td></tr></tbody></table></div>
<p><strong>Let&#8217;s have a look how to use it</strong><br />
First you&#8217;ll need to define model to acts as null object:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> User <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span><br />
&nbsp; acts_as_nullobject <span style="color:#ff3333; font-weight:bold;">:login</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'lacomartincik'</span>, <span style="color:#ff3333; font-weight:bold;">:name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'Ladislav Martincik'</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>Than whenever you call on User class method <strong>null_object</strong> you will get instance of NullUser class with default attributes defined in User:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#006600; font-weight:bold;">&gt;&gt;</span> User.<span style="color:#9900CC;">null_object</span><br />
<span style="color:#006600; font-weight:bold;">=&gt;</span> NullUser...</div></td></tr></tbody></table></div>
<p>Now if you define relationship between say Project and User like this:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> Project <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span><br />
&nbsp; &nbsp;belongs_to_with_nullobject <span style="color:#ff3333; font-weight:bold;">:user</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>Than whenever you create new Project object with null reference to User you will get NullUser instance instead of nil:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#006600; font-weight:bold;">&gt;&gt;</span> <span style="color:#CC0066; font-weight:bold;">p</span> = Project.<span style="color:#9900CC;">new</span><br />
<span style="color:#006600; font-weight:bold;">&gt;&gt;</span> <span style="color:#CC0066; font-weight:bold;">p</span>.<span style="color:#9900CC;">user</span><br />
<span style="color:#006600; font-weight:bold;">=&gt;</span> NullUser</div></td></tr></tbody></table></div>
<p>The project is available as plugin on <a href="http://github.com/lacomartincik/acts-as-nullobject/tree/master">http://github.com/lacomartincik/acts_as_nullobject</a>.</p>
<p>Enjoy! Any suggestions, bug reports and comments welcomed!</p>
<p><strong>Update: I had to rename plugin name from acts-as-nullobject to acts_as_nullobject otherwise it&#8217;s not going to work in Rails!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://martincik.com/?feed=rss2&amp;p=22</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Testing your Flex app with new FunFX</title>
		<link>http://martincik.com/?p=20</link>
		<comments>http://martincik.com/?p=20#comments</comments>
		<pubDate>Wed, 14 Jan 2009 15:36:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[funfx test testing flex ruby rails]]></category>

		<guid isPermaLink="false">http://martincik.com/?p=20</guid>
		<description><![CDATA[A few weeks ago I&#8217;ve started to dig in to new funfx gem to transform our old FunFx code and get benefit of new features that new FunFX is providing. The main reasons for moving to new code are:

Support for Firefox, so now we can run tests even on Linux boxes
Support for AdvancedDatagrid
Much better way [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I&#8217;ve started to dig in to new funfx gem to transform our old FunFx code and get benefit of new features that new FunFX is providing. The main reasons for moving to new code are:</p>
<ol>
<li>Support for Firefox, so now we can run tests even on Linux boxes</li>
<li>Support for AdvancedDatagrid</li>
<li>Much better way to find components with :id and :automationName</li>
<li>Based on Watir so we can test also IE if needed</li>
<li>Visual recorder and component finder</li>
</ol>
<p><strong>Installation</strong></p>
<p>You can install new funfx with just running on console command <strong>gem install funfx</strong> or you can download source code from <a title="FunFx on GitHub" href="http://github.com/peternic/funfx/tree/master">GitHub</a>. The funfx gem is dependent on <a title="Watir Project - Homepage" href="http://wtr.rubyforge.org">Watir</a> specific gem. Based on platform or preferences install either <a title="Watir Windows" href="http://wtr.rubyforge.org/install.html">Watir</a> (Win XP, Vista), <a title="Safari Watir - Mac" href="http://safariwatir.rubyforge.org/">SafariWatir</a> (Mac OS X) or <a title="Firefox Watir - FireWatir" href="http://wiki.openqa.org/display/WTR/FireWatir+Installation">FireWatir</a> (all platforms). <strong>NOTE:</strong> With FireWatir you&#8217;ll need to install Firefox Extension!</p>
<p><strong>Installation Examples</strong></p>
<p><strong>- Using gems on Mac OS X</strong></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem uninstall FunFX<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> funfx<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> safariwatir</div></td></tr></tbody></table></div>
<p><strong>- Using source code (you&#8217;ll need Git installed)</strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo gem uninstall FunFX<br />
git clone git://github.com/peternic/funfx.git<br />
cd flex<br />
./build.sh<br />
cd ..<br />
cd gem/<br />
rake gem<br />
rake install_gem<br />
sudo gem install safariwatir</div></td></tr></tbody></table></div>
<p><strong>FunFX interface changes</strong></p>
<p><strong>Changing speed of your FunFX run</strong><br />
Old version was using class attribute on FunFX object like this:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">FunFX.<span style="color:#9900CC;">speed</span> = <span style="color:#006666;">0.5</span> <span style="color:#008000; font-style:italic;"># half of second</span></div></td></tr></tbody></table></div>
<p>New version has different class attribute name:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">FunFX.<span style="color:#9900CC;">fire_pause</span> = <span style="color:#006666;">0.5</span></div></td></tr></tbody></table></div>
<p><strong>FunFX language/DSL changes</strong><br />
Basic components didn&#8217;t change, but arguments you&#8217;re passing changed from Hash-like style to simple arguments or vice versa.</p>
<p><strong>- Finding component</strong><br />
For example to find component you can now use more than one identificator like :id, :automationName and so on.</p>
<p>Old style to find component:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#0066ff; font-weight:bold;">@browser</span>.<span style="color:#9900CC;">text_area</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'myname'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></td></tr></tbody></table></div>
<p>New style:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#0066ff; font-weight:bold;">@browser</span>.<span style="color:#9900CC;">text_area</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'myname'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></td></tr></tbody></table></div>
<p><strong>- Getting number of rows from DataGrid</strong></p>
<p>Old style (as a result you will get concatenated string by comma):</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#0066ff; font-weight:bold;">@browser</span>.<span style="color:#9900CC;">data_grid</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'myname'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">tabular_data</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:start</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">0</span>, :<span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'1,Timothy Ferris,user'</span></div></td></tr></tbody></table></div>
<p>New style (as a result you will get array of column values for each row):</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#0066ff; font-weight:bold;">@browser</span>.<span style="color:#9900CC;">data_grid</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'myname'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">values</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span>,<span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'1'</span>,<span style="color:#996600;">'Timmothy Ferris'</span>,<span style="color:#996600;">'user'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span></div></td></tr></tbody></table></div>
<p><strong>- How to find all supported methods and their arguments?</strong><br />
To find the right number of arguments and their meaning have a lot at <a href="http://github.com/peternic/funfx/blob/6060855a03c79adbf399a04591cb12f115e07eca/gem/lib/funfx/flex/elements.rb">elements.rb</a> file or generate RDoc.</p>
<p><strong>- Methods returning boolean</strong><br />
All methods returning <strong>boolean</strong> value now requires you to write question mark at the end of the method name.</p>
<p>Old style:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#0066ff; font-weight:bold;">@browser</span>.<span style="color:#9900CC;">check_box</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'myname'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">selected</span></div></td></tr></tbody></table></div>
<p>New style:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#0066ff; font-weight:bold;">@browser</span>.<span style="color:#9900CC;">check_box</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'myname'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">selected</span>?</div></td></tr></tbody></table></div>
<p><strong>- No CamelCase in method names</strong><br />
Old FunFX supported both styles for method calls; CamelCase and classic ruby style with underscore. New FunFX forces you to use only classic ruby style with underscore.</p>
<p>Old style:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#0066ff; font-weight:bold;">@browser</span>.<span style="color:#9900CC;">check_box</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'myname'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">currentState</span></div></td></tr></tbody></table></div>
<p>New style:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#0066ff; font-weight:bold;">@browser</span>.<span style="color:#9900CC;">check_box</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'myname'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">current_state</span></div></td></tr></tbody></table></div>
<p><strong>Observations</strong><br />
<strong>Pros:</strong></p>
<ol>
<li>Code is much cleaner and is promising much stable way for writing FunFX tests.</li>
<li>Multiple browser&#8217;s and platforms support.</li>
<li>Easy way to find components.</li>
</ol>
<p><strong>Cons:</strong></p>
<ol>
<li>Recorder is not always useful in copy/paste scenario</li>
<li>Visual component finder is not able to find itemRenderers inside DataGrid (you have to go through tree manually)</li>
<li>Not much of documentation</li>
</ol>
<p><strong>Links and resources:</strong><br />
Old FunFX site: <a href="http://funfx.rubyforge.org/">http://funfx.rubyforge.org/</a><br />
Author and main contributor to FunFX: <a href="http://peternic.blogspot.com/">http://peternic.blogspot.com/</a><br />
New FunFX GitHub repository: <a href="http://github.com/peternic/funfx/tree/master">http://github.com/peternic/funfx/tree/master</a><br />
RubyForget site: <a href="http://funfx.rubyforge.org/">http://funfx.rubyforge.org/</a><br />
Bug/Issue tracking: <a href="http://bekkopen.lighthouseapp.com/projects/20367-funfx/">http://bekkopen.lighthouseapp.com/projects/20367-funfx/</a><br />
Google Group: <a href="http://groups.google.com/group/funfx?pli=1">http://groups.google.com/group/funfx?pli=1</a></p>
<p><span id="more-20"></span><!--more--><!--more--></p>
]]></content:encoded>
			<wfw:commentRss>http://martincik.com/?feed=rss2&amp;p=20</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Becaming freelancer</title>
		<link>http://martincik.com/?p=1</link>
		<comments>http://martincik.com/?p=1#comments</comments>
		<pubDate>Sun, 14 Dec 2008 17:17:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[freelancing]]></category>

		<guid isPermaLink="false">http://martincik.com/?p=1</guid>
		<description><![CDATA[As of 31 of January, 2009 I&#8217;ll became available as freelancer for 3 days work per week. I&#8217;m interested in doing Ruby and Servers related projects. You can find my online CV at Linkedin.com. My Open source code can be found at Github.com. If you&#8217;re interested, please leave your details in comment and I&#8217;ll contact [...]]]></description>
			<content:encoded><![CDATA[<p>As of 31 of January, 2009 I&#8217;ll became available as freelancer for 3 days work per week. I&#8217;m interested in doing Ruby and Servers related projects. You can find my online CV at <a href="http://www.linkedin.com/in/fukas78">Linkedin.com</a>. My Open source code can be found at <a href="http://github.com/lacomartincik">Github.com</a>. If you&#8217;re interested, please leave your details in comment and I&#8217;ll contact you back. Thank you</p>
]]></content:encoded>
			<wfw:commentRss>http://martincik.com/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
