<?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>MyFunnyDev &#187; Ruby</title>
	<atom:link href="http://michalkuklis.com/blog/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://michalkuklis.com/blog</link>
	<description>web, coding and beyond</description>
	<lastBuildDate>Fri, 25 Jun 2010 05:51:49 +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>class variables, class instance variables and instance variables in ruby</title>
		<link>http://michalkuklis.com/blog/2010/01/13/class-variable-class-instance-variables-and-instance-variables-in-ruby/</link>
		<comments>http://michalkuklis.com/blog/2010/01/13/class-variable-class-instance-variables-and-instance-variables-in-ruby/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 06:03:22 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=270</guid>
		<description><![CDATA[This was covered multiple times already. I&#8217;ve created this little snippet to remember the difference between different types of variables in ruby:

class A
  @@foo = &#34;class variable of the class A&#34;
  @foo = &#34;class instance variable of the class A&#34;
&#160;
  def instance_method
   @foo = &#34;instance variable of the class A&#34;
 [...]]]></description>
			<content:encoded><![CDATA[<p>This was covered multiple times already. I&#8217;ve created this little snippet to remember the difference between different types of variables in ruby:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> A
  @@foo = <span style="color:#996600;">&quot;class variable of the class A&quot;</span>
  <span style="color:#0066ff; font-weight:bold;">@foo</span> = <span style="color:#996600;">&quot;class instance variable of the class A&quot;</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> instance_method
   <span style="color:#0066ff; font-weight:bold;">@foo</span> = <span style="color:#996600;">&quot;instance variable of the class A&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">class_method1</span>
    <span style="color:#008000; font-style:italic;"># class variables are visible to and shared by the instance and class methods</span>
    @@foo
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">class_method2</span>
    <span style="color:#008000; font-style:italic;"># class instance variables are visible to and shared by the class methods</span>
    <span style="color:#0066ff; font-weight:bold;">@foo</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>	
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">p</span> A.<span style="color:#9900CC;">new</span>.<span style="color:#9900CC;">instance_method</span> <span style="color:#008000; font-style:italic;"># instance variable of the class A</span>
<span style="color:#CC0066; font-weight:bold;">p</span> A.<span style="color:#9900CC;">class_method1</span> <span style="color:#008000; font-style:italic;"># class variable of the class A</span>
<span style="color:#CC0066; font-weight:bold;">p</span> A.<span style="color:#9900CC;">class_method2</span> <span style="color:#008000; font-style:italic;"># class instance variable of the class A</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> B <span style="color:#006600; font-weight:bold;">&lt;</span> A
  @@foo = <span style="color:#996600;">&quot;class variable of the class B&quot;</span>
  <span style="color:#0066ff; font-weight:bold;">@foo</span> = <span style="color:#996600;">&quot;class instance variable of the class B&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">p</span> B.<span style="color:#9900CC;">class_method1</span> <span style="color:#008000; font-style:italic;"># class variable in B</span>
<span style="color:#008000; font-style:italic;"># class variable in A is overwritten by one in B !!!</span>
<span style="color:#CC0066; font-weight:bold;">p</span> A.<span style="color:#9900CC;">class_method1</span> <span style="color:#008000; font-style:italic;"># class variable in B</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">p</span> B.<span style="color:#9900CC;">class_method2</span> <span style="color:#008000; font-style:italic;"># class instance variable of the class B</span>
<span style="color:#008000; font-style:italic;"># class instance variable in A is NOT overwritten by one in B !!!</span>
<span style="color:#CC0066; font-weight:bold;">p</span> A.<span style="color:#9900CC;">class_method2</span> <span style="color:#008000; font-style:italic;"># class instance variable of the class A</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2010/01/13/class-variable-class-instance-variables-and-instance-variables-in-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>anemone with hpricot</title>
		<link>http://michalkuklis.com/blog/2010/01/11/anemone-with-hpricot/</link>
		<comments>http://michalkuklis.com/blog/2010/01/11/anemone-with-hpricot/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 05:06:32 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=265</guid>
		<description><![CDATA[Anemone is a pretty cool DSL used for web crawling. I used it with Hpricot to get a feeling for what&#8217;s possible. Below is a simple example which crawls and scrappes data from a popular polish real estate website otodom:

require 'rubygems'
require 'sanitize'
require 'anemone'
require 'open-uri'
require 'hpricot'
&#160;
#otodom.pl
Anemone.crawl&#40;&#34;http://otodom.pl/index.php?mod=search&#38;act=searchResults&#38;qid=46911208&#34;, 
&#123;:storage =&#62; Anemone::Storage.PStore&#40;&#34;crawl1.pstore&#34;&#41;&#125;&#41; do &#124; anemone &#124;
&#160;
  # filter [...]]]></description>
			<content:encoded><![CDATA[<p><a title="anemone" href="http://anemone.rubyforge.org/">Anemone</a> is a pretty cool DSL used for web crawling. I used it with <a title="hpricot" href="http://github.com/whymirror/hpricot">Hpricot</a> to get a feeling for what&#8217;s possible. Below is a simple example which crawls and scrappes data from a popular polish real estate website <a title="otodom" href="http://otodom.pl/">otodom</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'sanitize'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'anemone'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'open-uri'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'hpricot'</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#otodom.pl</span>
Anemone.<span style="color:#9900CC;">crawl</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;http://otodom.pl/index.php?mod=search&amp;act=searchResults&amp;qid=46911208&quot;</span>, 
<span style="color:#006600; font-weight:bold;">&#123;</span>:storage <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#6666ff; font-weight:bold;">Anemone::Storage</span>.<span style="color:#CC00FF; font-weight:bold;">PStore</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;crawl1.pstore&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span> anemone <span style="color:#006600; font-weight:bold;">|</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># filter out useless pages</span>
  anemone.<span style="color:#9900CC;">focus_crawl</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>page<span style="color:#006600; font-weight:bold;">|</span>
   page.<span style="color:#9900CC;">links</span>.<span style="color:#9900CC;">delete_if</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#006600; font-weight:bold;">&#40;</span>x.<span style="color:#9900CC;">to_s</span> =~ <span style="color:#006600; font-weight:bold;">/</span>mod=search<span style="color:#006600; font-weight:bold;">&amp;</span>act=searchResults<span style="color:#006600; font-weight:bold;">&amp;</span>qid=<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>? <span style="color:#9966CC; font-weight:bold;">and</span>
    <span style="color:#006600; font-weight:bold;">&#40;</span>x.<span style="color:#9900CC;">to_s</span> =~ <span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#91;</span>a<span style="color:#006600; font-weight:bold;">-</span>zA<span style="color:#006600; font-weight:bold;">-</span>Z<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">+-</span>id<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">9</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">*</span>\.<span style="color:#9900CC;">html</span>$<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>?
   <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># process details pages</span>
  anemone.<span style="color:#9900CC;">on_pages_like</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#91;</span>a<span style="color:#006600; font-weight:bold;">-</span>zA<span style="color:#006600; font-weight:bold;">-</span>Z<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">+-</span>id<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">9</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">*</span>\.<span style="color:#9900CC;">html</span>$<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span> page <span style="color:#006600; font-weight:bold;">|</span>
     doc = Hpricot<span style="color:#006600; font-weight:bold;">&#40;</span>page.<span style="color:#9900CC;">doc</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     price =  doc.<span style="color:#9900CC;">at</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;//strong[@id='offerPrice']&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     location = doc.<span style="color:#9900CC;">at</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;//dl[@class='stripeMe'] &gt; dd&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     desc = doc.<span style="color:#9900CC;">at</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;//div[@id='offerDesc'] &gt; p&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     offer_no = doc.<span style="color:#9900CC;">at</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;//div[@id='offerFoot'] p[@class='toLeft']/span/strong&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     created_at = doc.<span style="color:#9900CC;">at</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;//div[@id='offerFoot'] p[@class='toRight']/span/strong&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     photos = doc.<span style="color:#9900CC;">search</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;//div[@id='imageList']/p/a&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2010/01/11/anemone-with-hpricot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>blocks, procs and lambdas in ruby</title>
		<link>http://michalkuklis.com/blog/2009/11/17/blocks-procs-and-lambdas-in-ruby/</link>
		<comments>http://michalkuklis.com/blog/2009/11/17/blocks-procs-and-lambdas-in-ruby/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 04:12:20 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=252</guid>
		<description><![CDATA[Nice post about block, procs and lambdas in ruby by Robert Sosinski.
]]></description>
			<content:encoded><![CDATA[<p>Nice post <a href="http://www.robertsosinski.com/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/">about block, procs and lambdas in ruby</a> by Robert Sosinski.</p>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2009/11/17/blocks-procs-and-lambdas-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby maxins in rails plugins</title>
		<link>http://michalkuklis.com/blog/2009/07/20/ruby-maxins-in-rails-plugins/</link>
		<comments>http://michalkuklis.com/blog/2009/07/20/ruby-maxins-in-rails-plugins/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 01:16:46 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=175</guid>
		<description><![CDATA[Very often when looking at the code in rails plugins you can run into this:

module Taggable 
  def self.included&#40;base&#41;
    base.extend&#40;ClassMethods&#41;
  end
  module module ClassMethods
    #methods here
  end
end

This is a part of a bigger pattern which is shown below:

module ModuleA
  def self.included&#40;base&#41;
    [...]]]></description>
			<content:encoded><![CDATA[<p>Very often when looking at the code in rails plugins you can run into this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> Taggable 
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">included</span><span style="color:#006600; font-weight:bold;">&#40;</span>base<span style="color:#006600; font-weight:bold;">&#41;</span>
    base.<span style="color:#9900CC;">extend</span><span style="color:#006600; font-weight:bold;">&#40;</span>ClassMethods<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">module</span> <span style="color:#9966CC; font-weight:bold;">module</span> ClassMethods
    <span style="color:#008000; font-style:italic;">#methods here</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>This is a part of a bigger pattern which is shown below:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> ModuleA
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">included</span><span style="color:#006600; font-weight:bold;">&#40;</span>base<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#008000; font-style:italic;"># add class methods from ModuleB</span>
    base.<span style="color:#9900CC;">extend</span><span style="color:#006600; font-weight:bold;">&#40;</span>ModuleB<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> ModuleB
  <span style="color:#9966CC; font-weight:bold;">def</span> act_as_hello
    <span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#996600;">&quot;hello from module B&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> ClassC
 <span style="color:#008000; font-style:italic;">#class body here</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># include moduleA in classC</span>
ClassC.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:include</span>, ModuleA<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> ClassD <span style="color:#006600; font-weight:bold;">&lt;</span> ClassC
  act_as_hello
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
classD = ClassD.<span style="color:#9900CC;">new</span></pre></div></div>

<p>The pattern is used often when developing plugins with ActiveRecord. What we gain by inheriting from ClassC  (<b>class ClassD < ClassC</b>) are instance methods from ModuleA. This is done by:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">ClassC.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:include</span>, ModuleA<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Moreover since ModuleA is included in ClassC, ModuleA&#8217;s initializer <strong>def self.included(base)</strong> will be invoked at the time  ModuleA is mixed with ClassC. The invocation will call <b>base.extend(ModuleB)</b>. In this case <b>base</b> represents ClassC which will be extended by adding class methods from ModuleB. The ModuleA&#8217;s init method is shown again below:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">included</span><span style="color:#006600; font-weight:bold;">&#40;</span>base<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#008000; font-style:italic;"># add class methods from ModuleB to ClassC</span>
  base.<span style="color:#9900CC;">extend</span><span style="color:#006600; font-weight:bold;">&#40;</span>ModuleB<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>At the end our ClassD has now access to all class methods defined in ModuleB.  <strong>act_as_hello</strong> will be called during ClassD initialization:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> ClassD <span style="color:#006600; font-weight:bold;">&lt;</span> ClassC
  act_as_hello
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2009/07/20/ruby-maxins-in-rails-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class and Instance Variables In Ruby</title>
		<link>http://michalkuklis.com/blog/2009/06/13/class-and-instance-variables-in-ruby/</link>
		<comments>http://michalkuklis.com/blog/2009/06/13/class-and-instance-variables-in-ruby/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 04:27:11 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=163</guid>
		<description><![CDATA[nice post about class and instance vars in ruby.
]]></description>
			<content:encoded><![CDATA[<p>nice post about <a href="http://railstips.org/2006/11/18/class-and-instance-variables-in-ruby">class and instance vars in ruby</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2009/06/13/class-and-instance-variables-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>few more ruby links</title>
		<link>http://michalkuklis.com/blog/2009/05/18/few-more-ruby-links/</link>
		<comments>http://michalkuklis.com/blog/2009/05/18/few-more-ruby-links/#comments</comments>
		<pubDate>Mon, 18 May 2009 23:24:42 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=160</guid>
		<description><![CDATA[
class and instance methods
include vs extend again 

]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://railstips.org/2009/5/11/class-and-instance-methods-in-ruby">class and instance methods</a></li>
<li><a href="http://railstips.org/2009/5/15/include-verse-extend-in-ruby">include vs extend again </a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2009/05/18/few-more-ruby-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>going back to ruby again&#8230;</title>
		<link>http://michalkuklis.com/blog/2009/04/04/go-back-to-ruby-again/</link>
		<comments>http://michalkuklis.com/blog/2009/04/04/go-back-to-ruby-again/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 18:05:00 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=148</guid>
		<description><![CDATA[Here are few links which helped me understand few ruby concepts:

include vs extend
include,extend,module_eval,class_eval
anonymous classes (aka singleton classes)
ruby-metaprogramming-techniques

]]></description>
			<content:encoded><![CDATA[<p>Here are few links which helped me understand few ruby concepts:</p>
<ul>
<li><a href="http://www.fromjavatoruby.com/2008/10/include-vs-extend.html">include vs extend</a></li>
<li><a href="http://neeraj.name/blog/articles/503-include-extend-module_eval-class_eval">include,extend,module_eval,class_eval</a></li>
<li><a href="http://pmade.com/articles/2008/ruby-singleton">anonymous classes (aka singleton classes)</a></li>
<li><a href="http://ola-bini.blogspot.com/2006/09/ruby-metaprogramming-techniques.html">ruby-metaprogramming-techniques</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2009/04/04/go-back-to-ruby-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>stage deployment with capistrano and passenger</title>
		<link>http://michalkuklis.com/blog/2009/03/14/stage-deployment-with-capistrano/</link>
		<comments>http://michalkuklis.com/blog/2009/03/14/stage-deployment-with-capistrano/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 22:20:36 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[capistrano]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=124</guid>
		<description><![CDATA[I&#8217;m still looking around for a stage deployment setup with Capistrano.
Here are few ideas/links I found useful.

multi_staging_environment_for_rails_using_capistrano_and_mod_rails
deploying-to-staging-and-production-with-capistrano
using-capistrano-with-passenger-mod_rails/

Update:
It turned out this is pretty simple with the capistrano-ext gem:
http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage

set :default_stage, &#34;development&#34;
set :stages, %w&#40;production testing development&#41;
require 'capistrano/ext/multistage'

]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: line-through;">I&#8217;m still looking around for a stage deployment setup with Capistrano.<br />
Here are few ideas/links I found useful.</span></p>
<ul>
<li><a href="http://www.cjohansen.no/en/rails/multi_staging_environment_for_rails_using_capistrano_and_mod_rails">multi_staging_environment_for_rails_using_capistrano_and_mod_rails</a></li>
<li><a href="http://devblog.famundo.com/articles/2006/09/28/deploying-to-staging-and-production-with-capistrano">deploying-to-staging-and-production-with-capistrano</a></li>
<li><a href="http://jimneath.org/2008/05/10/using-capistrano-with-passenger-mod_rails/">using-capistrano-with-passenger-mod_rails/</a></li>
</ul>
<p><strong>Update:<br />
</strong>It turned out this is pretty simple with the capistrano-ext gem:<a href="http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage"></p>
<p>http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage</a></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">set <span style="color:#ff3333; font-weight:bold;">:default_stage</span>, <span style="color:#996600;">&quot;development&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:stages</span>, <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>production testing development<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'capistrano/ext/multistage'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2009/03/14/stage-deployment-with-capistrano/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>heroku</title>
		<link>http://michalkuklis.com/blog/2008/02/19/heroku/</link>
		<comments>http://michalkuklis.com/blog/2008/02/19/heroku/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 04:25:18 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=31</guid>
		<description><![CDATA[http://heroku.com/ &#8211; awesome work&#8230;
]]></description>
			<content:encoded><![CDATA[<p><a href="http://heroku.com/">http://heroku.com/</a> &#8211; awesome work&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2008/02/19/heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails 1.1.2 + Apache2 + FCGI on Windows XP</title>
		<link>http://michalkuklis.com/blog/2006/04/11/rails-112-apache2-fcgi-on-windows-xp/</link>
		<comments>http://michalkuklis.com/blog/2006/04/11/rails-112-apache2-fcgi-on-windows-xp/#comments</comments>
		<pubDate>Wed, 12 Apr 2006 04:49:27 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/archives/13</guid>
		<description><![CDATA[Setting up Rails on Windows can be pain in the butt. I spent couple hours reading posts and changing Apache and Rails configuration and finally I found WARR.
Just follow directions from this post and don&#8217;t forget to add:
LoadModule rewrite_module modules/mod_rewrite.so
to your httpd.conf file. I had some problems after all but I created new project and [...]]]></description>
			<content:encoded><![CDATA[<p>Setting up Rails on Windows can be pain in the butt. I spent couple hours reading posts and changing Apache and Rails configuration and finally I found <a href="http://rawlinson.us/blog/?page_id=309">WARR</a>.</p>
<p>Just follow directions from this post and don&#8217;t forget to add:</p>
<p style="border: 1px solid #00ff00; background: #000000 none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: #ffffff">LoadModule rewrite_module modules/mod_rewrite.so</p>
<p>to your httpd.conf file.<br /> I had some problems after all but I created new project and everything works great!</p>
<p><img alt="ROR" src="http://michalkuklis.com/images/ror.JPG" /></p>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2006/04/11/rails-112-apache2-fcgi-on-windows-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
