<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Robby on Rails: Meet the Cheat</title>
    <link>http://www.robbyonrails.com/articles/2007/01/10/meet-the-cheat</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>thoughts.sort_by{|t| t[:topic]}.collect </description>
    <item>
      <title>Meet the Cheat</title>
      <description>&lt;p&gt;Hey!  You&amp;#8217;re a cheater!&lt;/p&gt;


	&lt;p&gt;Well, if you&amp;#8217;re not&amp;#8230; I&amp;#8217;m hoping to make one out of you.&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&lt;em&gt;&amp;#8220;A thing worth having is a thing worth cheating for.&amp;#8221;&lt;/em&gt;&amp;#8212;W. C. Fields&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;I&amp;#8217;m a fan of the &lt;span class="caps"&gt;PDF&lt;/span&gt; cheat sheets as I like the consolidated content contained in them. However, I don&amp;#8217;t like having to read PDFs any more than I have to. Printing them isn&amp;#8217;t always ideal either as I really don&amp;#8217;t like to carry around extra paper in my laptop bag. So, what are we to do?&lt;/p&gt;


	&lt;p&gt;Well, you can cheat the system! &lt;em&gt;...and I&amp;#8217;m going to show you how!&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;Cheat is this really nice command-line tool that outputs a plain text cheat sheet whenever and wherever you want.&lt;/p&gt;


	&lt;h2&gt;Install the Cheat&lt;/h2&gt;


	&lt;p&gt;Like all the happy and good Rubygems, this is quite simple&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ sudo gem install cheat
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Done! Okay&amp;#8230; let&amp;#8217;s try to do some cheating. Don&amp;#8217;t worry, your friends and family will forgive you.&lt;/p&gt;


	&lt;h2&gt;Becoming a Cheat(er)&lt;/h2&gt;


	&lt;p&gt;To view a cheat sheet, just run the cheat command from your favorite terminal window.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ cheat _cheat name_&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;So, for example&amp;#8230; to see the cheat sheet for RSpec, run &lt;code&gt;cheat rspec&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
    $ cheat rspec
    rspec:
      INSTALL
      =======
      $ sudo gem install rspec

      $ ./script/plugin install
      svn://rubyforge.org/var/svn/rspec/tags/REL_X_Y_Z/vendor/rspec_on_rails/vendor/p
      ugins/rspec
      Where X_Y_Z is the version number.

      $ ./script/generate rspec
            create  spec
            create  spec/spec_helper.rb
            create  spec/test2spec.erb
            create  test/test2spec_help.rb
            create  script/rails_spec
            create  script/rails_spec_runner

      HOW TO USE
      ==========
      ./script/generate rspec_model User

####################################################
# truncated to save precious bandwidth
####################################################
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Because this is all printing out in your shell, you can take advantage of your favorite command line tools.&lt;/p&gt;


	&lt;h3&gt;Piping to grep&lt;/h3&gt;


&lt;pre&gt;&lt;code&gt;
$ cheat rspec | grep 'equal' 
      @user.errors.on(:username).should_equal "is required" 
  target.should_equal &amp;lt;value&amp;gt;
  target.should_not_equal &amp;lt;value&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Piping to TextMate&lt;/h3&gt;


&lt;pre&gt;&lt;code&gt;$ cheat rspec | mate&lt;/code&gt;&lt;/pre&gt;

	&lt;h2&gt;Find more Cheats&lt;/h2&gt;


	&lt;p&gt;Head over to this &lt;a href="http://cheat.errtheblog.com/b"&gt;list of cheats&lt;/a&gt; to see what is currently available.&lt;/p&gt;


	&lt;p&gt;Thanks to the &lt;a href="http://errtheblog.com/"&gt;Err team&lt;/a&gt; for putting this together!&lt;/p&gt;
</description>
      <pubDate>Wed, 10 Jan 2007 12:37:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:a95963ff-b359-40ae-8fe6-8d1741bc7614</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/01/10/meet-the-cheat</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>cheat</category>
      <category>gem</category>
      <category>ruby</category>
      <category>documentation</category>
    </item>
  </channel>
</rss>
