<?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>#{茶男與藍牌} &#187; Ruby</title>
	<atom:link href="http://www.chentianwen.net/wordpress/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chentianwen.net/wordpress</link>
	<description>Life has to be exciting.</description>
	<lastBuildDate>Wed, 01 Feb 2012 01:34:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>warning: toplevel constant XX referenced by YY::XX (review)</title>
		<link>http://www.chentianwen.net/wordpress/2011/11/01/warning-toplevel-constant-xx-referenced-by-yyxx/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=warning-toplevel-constant-xx-referenced-by-yyxx</link>
		<comments>http://www.chentianwen.net/wordpress/2011/11/01/warning-toplevel-constant-xx-referenced-by-yyxx/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 00:43:33 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=558</guid>
		<description><![CDATA[<p>When I try to move the Devise stuff into a module User::Devise and include it in class User, I got this warning &#8216;warning: toplevel constant Devise referenced by User::Devise&#8217;</p> <p>Please see the code before and after for a solution.</p> <p>Solution is to make User::Devise before you do the include for class User</p> <p>&#160;</p>]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/11/01/warning-toplevel-constant-xx-referenced-by-yyxx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discover ActiveRecord: cast an object to specified class</title>
		<link>http://www.chentianwen.net/wordpress/2011/10/28/discover-activerecord-cast-an-object-to-specified-class/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=discover-activerecord-cast-an-object-to-specified-class</link>
		<comments>http://www.chentianwen.net/wordpress/2011/10/28/discover-activerecord-cast-an-object-to-specified-class/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 05:22:06 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=551</guid>
		<description><![CDATA[<p>Can&#8217;t find anything about casting an instance to specified class? Of cause, in Ruby, there is no such concept that you need to cast an instance in most of the cases. But how about you need to? Here is the answer:</p> <p>By using ActiveRecord::Persistence.becomes, you can easily cast it to specified class.</p> <p>For example:</p> <p>&#160;</p>]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/10/28/discover-activerecord-cast-an-object-to-specified-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>rails postgresql adapter options</title>
		<link>http://www.chentianwen.net/wordpress/2011/10/17/rails-postgresql-adapter-options/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rails-postgresql-adapter-options</link>
		<comments>http://www.chentianwen.net/wordpress/2011/10/17/rails-postgresql-adapter-options/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 05:06:01 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=533</guid>
		<description><![CDATA[from http://ar.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html :host - Defaults to &#8220;localhost&#8221;. :port - Defaults to 5432. :username - Defaults to nothing. :password - Defaults to nothing. :database - The name of the database. No default, must be provided. :<a href="http://ar.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html#M000252">schema_search_path</a> - An optional schema search path for the connection given as a string of comma-separated schema names. This is backward-compatible with the :schema_order option. :encoding - An optional client [...]]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/10/17/rails-postgresql-adapter-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>trick using question mark in rails model</title>
		<link>http://www.chentianwen.net/wordpress/2011/10/17/trick-using-question-mark-in-rails-model/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=trick-using-question-mark-in-rails-model</link>
		<comments>http://www.chentianwen.net/wordpress/2011/10/17/trick-using-question-mark-in-rails-model/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 04:54:25 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=530</guid>
		<description><![CDATA[p = Person.new p.first_name = 'Tian' p.last_name = nil p.first_name? # =&#62; true p.last_name? # =&#62; false]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/10/17/trick-using-question-mark-in-rails-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>alternative usage of question mark in ruby</title>
		<link>http://www.chentianwen.net/wordpress/2011/10/17/alternative-usage-of-question-mark-in-ruby/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=alternative-usage-of-question-mark-in-ruby</link>
		<comments>http://www.chentianwen.net/wordpress/2011/10/17/alternative-usage-of-question-mark-in-ruby/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 02:16:04 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=525</guid>
		<description><![CDATA[&#62;&#62; ?A =&#62; 65]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/10/17/alternative-usage-of-question-mark-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>6 Ways to Run Shell Commands in Ruby</title>
		<link>http://www.chentianwen.net/wordpress/2011/09/22/6-ways-to-run-shell-commands-in-ruby/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=6-ways-to-run-shell-commands-in-ruby</link>
		<comments>http://www.chentianwen.net/wordpress/2011/09/22/6-ways-to-run-shell-commands-in-ruby/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 05:02:22 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=489</guid>
		<description><![CDATA[<p>from http://tech.natemurray.com/2007/03/ruby-shell-commands.html</p> <p>Often times we want to interact with the operating system or run shell commands from within Ruby. Ruby provides a number of ways for us to perform this task.</p> Exec <p>Kernel#exec (or simply exec) replaces the current process by running the given command For example:</p> $ irb &#62;&#62; exec 'echo "hello $HOSTNAME"' hello nate.local $ <p>Notice [...]]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/09/22/6-ways-to-run-shell-commands-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pre-defined Variables</title>
		<link>http://www.chentianwen.net/wordpress/2011/09/14/pre-defined-variables/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pre-defined-variables</link>
		<comments>http://www.chentianwen.net/wordpress/2011/09/14/pre-defined-variables/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 12:17:48 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=477</guid>
		<description><![CDATA[<p>&#160;</p> Name Aliases Description $! $ERROR_INFO The exception information message set by the last &#8216;raise&#8217; (last exception thrown). $@ $ERROR_POSITION Array of the backtrace of the last exception thrown. $&#38; $MATCH The string matched by the last successful pattern match in this scope. $` $PREMATCH The string to the left of the last successful match. [...]]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/09/14/pre-defined-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demystifying Irb&#8217;s Commands</title>
		<link>http://www.chentianwen.net/wordpress/2011/08/30/demystifying-irbs-commands/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=demystifying-irbs-commands</link>
		<comments>http://www.chentianwen.net/wordpress/2011/08/30/demystifying-irbs-commands/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 11:50:52 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[IRB]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=470</guid>
		<description><![CDATA[<p>from http://tagaholic.me/2009/05/11/demystifying-irb-commands.html</p> <p>Irb is one of the most commonly used standard ruby libraries, yet most don’t seem to know much about it. I’ve lost count of the number of blog posts that explain some irb “tricks” or “secret” config options. This is the first in a series that aims to make irb less magical and more [...]]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/08/30/demystifying-irbs-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploring How To Configure Irb</title>
		<link>http://www.chentianwen.net/wordpress/2011/08/30/exploring-how-to-configure-irb/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=exploring-how-to-configure-irb</link>
		<comments>http://www.chentianwen.net/wordpress/2011/08/30/exploring-how-to-configure-irb/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 11:47:26 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[IRB]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=468</guid>
		<description><![CDATA[<p>from http://tagaholic.me/2009/05/29/exploring-how-to-configure-irb.html#eval_history</p> <p>In <a href="http://tagaholic.me/2009/05/11/demystifying-irb-commands.html">my last post</a> we discussed irb’s commands. This post goes further into irb’s innards, exploring all of its configuration options.</p> Gettin Ready <p>For starters, I refer you to the pickaxe which has <a href="http://www.rubycentral.com/book/irb.html">an excellent section on configuring irb</a>. Also, this post assumes ruby 1.8.6 and irb 0.9.5, though it should apply to 1.9ers. Yes, I [...]]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/08/30/exploring-how-to-configure-irb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>error: no such file to load — readline (LoadError)</title>
		<link>http://www.chentianwen.net/wordpress/2011/08/30/error-no-such-file-to-load-%e2%80%94-readline-loaderror/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=error-no-such-file-to-load-%25e2%2580%2594-readline-loaderror</link>
		<comments>http://www.chentianwen.net/wordpress/2011/08/30/error-no-such-file-to-load-%e2%80%94-readline-loaderror/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 00:29:38 +0000</pubDate>
		<dc:creator>茶男</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.chentianwen.net/wordpress/?p=466</guid>
		<description><![CDATA[<p>from http://rails3blog.com/2010/09/error-no-such-file-to-load-readline-loaderror/</p> <p>I was getting this error trying to start the rails console: error: no such file to load — readline (LoadError). I’m using rvm, rails3, ruby 1.9.2, Ubuntu 10.04.</p> <p>I tracked down redline in my ruby source ~/.rvm/src/ruby-1.9.2-p0/ext/readline and ran:</p> <p>ruby extconf.rb<br /> This let me know I was missing these two packages:</p> <p>libncurses5-dev [...]]]></description>
		<wfw:commentRss>http://www.chentianwen.net/wordpress/2011/08/30/error-no-such-file-to-load-%e2%80%94-readline-loaderror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

