<?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>CSCI E-168 &#187; gems</title>
	<atom:link href="http://e168f09.plugh.org/category/gems/feed/" rel="self" type="application/rss+xml" />
	<link>http://e168f09.plugh.org</link>
	<description>Building Web-based Software with Ruby and Ruby on Rails</description>
	<lastBuildDate>Sun, 13 Dec 2009 22:20:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>gem of the week: cheat</title>
		<link>http://e168f09.plugh.org/2009/10/13/gem-of-the-week-cheat/</link>
		<comments>http://e168f09.plugh.org/2009/10/13/gem-of-the-week-cheat/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 20:21:11 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[gems]]></category>

		<guid isPermaLink="false">http://e168f09.plugh.org/?p=433</guid>
		<description><![CDATA[A couple of weeks ago I mentioned the &#8220;cheat&#8221; gem which has a plethora of useful quick docs on various topics such as regular expressions. I breezed through the install &#8212; and fix for Ruby 1.9.1 &#8212; here it is, for the record:

gem install cheat
# NOTE: If you're on Linux or OS/X and have a [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago I mentioned the &#8220;cheat&#8221; gem which has a plethora of useful quick docs on various topics such as regular expressions. I breezed through the install &#8212; and fix for Ruby 1.9.1 &#8212; here it is, for the record:</p>
<pre class="brush: ruby;">
gem install cheat
# NOTE: If you're on Linux or OS/X and have a standard install (rather than using the ruby_switch.sh script, you want to do sudo gem install cheat)
</pre>
<p>If you run it under 1.9.x, you should get an error like so:</p>
<pre class="brush: ruby;">
cheat regexp
/Users/jnorman/.gem/ruby/1.9.1/gems/cheat-1.2.1/lib/cheat.rb:150:in `cache_dir': uninitialized constant Cheat::PLATFORM (NameError)
	from /Users/jnorman/.gem/ruby/1.9.1/gems/cheat-1.2.1/lib/cheat.rb:16:in `sheets'
	from /Users/jnorman/.gem/ruby/1.9.1/gems/cheat-1.2.1/bin/cheat:4:in `&lt;top (required)&gt;'
	from /Users/jnorman/.gem/ruby/1.9.1/bin/cheat:19:in `load'
	from /Users/jnorman/.gem/ruby/1.9.1/bin/cheat:19:in `&lt;main&gt;'
</pre>
<p>What you want to do is edit the file producing the error (in my case, from the exception trace, /Users/jnorman/.gem/ruby/1.9.1/gems/cheat-1.2.1/lib/cheat.rb). Go to the line, and change the constant PLATFORM to RUBY_PLATFORM. Save the file.</p>
<p>And voila!</p>
<pre class="brush: ruby;">
chelsea:~ jnorman$ cheat regexp
regexp:
  A regexp's form is written /pattern/modifiers where &quot;pattern&quot; is the regular
# much deleted
</pre>
<p>For help,</p>
<pre class="brush: ruby;">
cheat cheat
</pre>
]]></content:encoded>
			<wfw:commentRss>http://e168f09.plugh.org/2009/10/13/gem-of-the-week-cheat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
