<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Envy Labs</title>
	
	<link>http://blog.envylabs.com</link>
	<description>Internet Awesome</description>
	<lastBuildDate>Mon, 07 May 2012 18:37:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/EnvyLabs" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="envylabs" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.bloglines.com/sub/http://feeds.feedburner.com/EnvyLabs" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FEnvyLabs" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><item>
		<title>2012 Ruby Hero Awards</title>
		<link>http://blog.envylabs.com/2012/05/2012-ruby-hero-awards/</link>
		<comments>http://blog.envylabs.com/2012/05/2012-ruby-hero-awards/#comments</comments>
		<pubDate>Fri, 04 May 2012 20:25:43 +0000</pubDate>
		<dc:creator>Violette</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/?p=1415</guid>
		<description><![CDATA[Every year we help put on the Ruby Hero Awards at Railsconf. Here&#8217;s a video of Gregg presenting the awards just a few weeks ago in Austin, TX: Ruby Heroes was created to show some gratitude and give recognition to the people in the Ruby/Rails world who contribute to the community and rarely receive any [...]]]></description>
			<content:encoded><![CDATA[<p>Every year we help put on the Ruby Hero Awards at Railsconf.  Here&#8217;s a video of Gregg presenting the awards just a few weeks ago in Austin, TX:</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/tWmh4m2a4FI" frameborder="0" allowfullscreen></iframe></p>
<p>Ruby Heroes was created to show some gratitude and give recognition to the people in the Ruby/Rails world who contribute to the community and rarely receive any recognition or repayment. Thanks for continuing to make our community stronger.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2012/05/2012-ruby-hero-awards/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gregg Pollack Talks with the Florida Technology Journal about Code School</title>
		<link>http://blog.envylabs.com/2012/05/gregg-pollack-talks-with-the-florida-technology-journal-about-code-school/</link>
		<comments>http://blog.envylabs.com/2012/05/gregg-pollack-talks-with-the-florida-technology-journal-about-code-school/#comments</comments>
		<pubDate>Tue, 01 May 2012 23:07:36 +0000</pubDate>
		<dc:creator>Violette</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code School]]></category>
		<category><![CDATA[gregg pollack]]></category>
		<category><![CDATA[interviews]]></category>
		<category><![CDATA[online learning]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/?p=1411</guid>
		<description><![CDATA[Gregg Pollack talks about our online learning platform, Code School. Check out the video interview here.]]></description>
			<content:encoded><![CDATA[<p>Gregg Pollack talks about our online learning platform, <a href="http://www.codeschool.com/" title="Code School - " target="_blank">Code School</a>. Check out the video interview here.</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/rgnO4XeiOwU" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2012/05/gregg-pollack-talks-with-the-florida-technology-journal-about-code-school/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update on Code School</title>
		<link>http://blog.envylabs.com/2012/03/update-on-code-school/</link>
		<comments>http://blog.envylabs.com/2012/03/update-on-code-school/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 16:22:00 +0000</pubDate>
		<dc:creator>Gregg Pollack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/?p=1403</guid>
		<description><![CDATA[Lots has happened since Rails for Zombies 2 was released last October, I can&#8217;t believe that was the last post to the Envy Labs blog!  I definitely want to give you the rundown, but first I wanted to post a video which gives some insight into the course building process at Code School. The Making [...]]]></description>
			<content:encoded><![CDATA[<p>Lots has happened since <a href="http://www.codeschool.com/courses/rails-for-zombies-2">Rails for Zombies 2</a> was released last October, I can&#8217;t believe that was the last post to the Envy Labs blog!  I definitely want to give you the rundown, but first I wanted to post a video which gives some insight into the course building process at Code School.</p>
<p><iframe src="http://player.vimeo.com/video/38635519?title=0&amp;byline=0&amp;portrait=0" frameborder="0" width="550" height="309"></iframe></p>
<p><a href="http://vimeo.com/38635519">The Making of the Anatomy of Backbone.js</a></p>
<p>Here&#8217;s the run down on what&#8217;s happened at Code School in the past few months.</p>
<ul>
<li><a href="http://jquerytwo.codeschool.com/">jQuery Air: Captains Log</a> was released, the sequel to <a href="http://jqueryair.com">jQuery Air: First Flight</a> (which is now free)</li>
<li>We took a <a href="http://www.codeschool.com/courses/coffeescript">A Sip of CoffeeScript</a>, teaching this new language which compiles into JavaScript.</li>
<li>Then there was <a href="http://www.codeschool.com/courses/css-cross-country">CSS Cross-Country</a>, teaching CSS best practices.</li>
<li>Last month we had more Zombies with <a href="http://www.codeschool.com/courses/rails-testing-for-zombies">Rails Testing for Zombies</a>, teaching the basics of testing Rails.</li>
<li>Today we released <a href="http://www.codeschool.com/courses/anatomy-of-backbonejs">the Anatomy of Backbone.js</a>, teaching the client-side MVC framework.</li>
<li>Along the way we&#8217;ve released a TON of <a href="http://www.codeschool.com/code_tv">CodeTV screencasts</a> on topics from beginning Rails to Shell Productivity.</li>
</ul>
<p>Feel free to take a look around the <a href="http://www.codeschool.com">Code School site</a> if you haven&#8217;t in a while.  You&#8217;ll find many of our newer courses allow you to play the first level free.  Also if you want to keep updated we&#8217;ve been blogging more on the <a href="http://blog.codeschool.com">Code School Blog</a> these days.  You can also <a href="http://twitter.com/codeschool">follow code school on twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2012/03/update-on-code-school/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking for an Intern</title>
		<link>http://blog.envylabs.com/2011/12/looking-for-an-intern/</link>
		<comments>http://blog.envylabs.com/2011/12/looking-for-an-intern/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 03:45:55 +0000</pubDate>
		<dc:creator>Gregg Pollack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/?p=1392</guid>
		<description><![CDATA[Envy Labs is officially looking for a (paid) intern.  We looking for someone who: Already knows his/her way around Rails.  We&#8217;re going to want to see that you&#8217;ve built a Rails app or two.  You don&#8217;t need to have written any tests, but you do need to know the basics. Can come work with us [...]]]></description>
			<content:encoded><![CDATA[<p>Envy Labs is officially looking for a (paid) intern.  We looking for someone who:</p>
<ul>
<li>Already knows his/her way around Rails.  We&#8217;re going to want to see that you&#8217;ve built a Rails app or two.  You don&#8217;t need to have written any tests, but you do need to know the basics.</li>
<li>Can come work with us at Envy Labs in Orlando at least 2 days a week (if not more).  In other words,we can be flexible if you&#8217;re currently a student.</li>
<li>Is a good writer and communicator.</li>
<li>has their own laptop.</li>
<li>Knows their way around HTML/CSS/Databases.</li>
<li>Has a passion for creating web apps.</li>
</ul>
<p><img class="alignright size-full wp-image-1395" title="Intern" src="http://blog.envylabs.com/wp-content/uploads/2011/12/intern.jpg" alt="" width="194" height="168" /></p>
<div><strong>What will this person be doing?  </strong></div>
<div>
<ul>
<li>Beginner Rails Apps.  We have some smaller sites that need to be done in Rails / Sinatra that we&#8217;d get your help with.</li>
<li>Pair Programming.  We&#8217;d get you pairing with more experienced developers to advance your knowledge.</li>
<li>Code School Support. We all take turns supporting Code School, and so would you.</li>
</ul>
<div>We&#8217;re pretty passionate about our learning environment at Code School with our book club, do code reviews, pair programming (when needed), and our Friday presentations.  If you&#8217;re interested please email me with your resume and tell me about (or show me) websites you&#8217;ve developed.  Also let me know if you&#8217;ve completed any Code School courses.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2011/12/looking-for-an-intern/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rails for Zombies 2 Released!</title>
		<link>http://blog.envylabs.com/2011/10/rails-for-zombies-2-released/</link>
		<comments>http://blog.envylabs.com/2011/10/rails-for-zombies-2-released/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 15:14:00 +0000</pubDate>
		<dc:creator>Gregg Pollack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/?p=1370</guid>
		<description><![CDATA[Just yesterday Code School released Rails for Zombies 2, the sequel to the first Intro to Rails Zombie course.  This new course picks up right where the last one left off with 5 more vidoes, and 52 more coding challenges.  Topics include: Rails command line and database migrations More ActiveRecord relationships and named scopes Undertstanding [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codeschool.com/courses/rails-for-zombies-2"><img class="size-full wp-image-1373 alignnone" title="Rails For Zombies 2" src="http://blog.envylabs.com/wp-content/uploads/2011/10/rails-for-zombies-2.jpeg" alt="" width="400" height="120" /></a></p>
<p>Just yesterday <a href="http://www.codeschool.com/">Code School</a> released <a href="http://www.codeschool.com/courses/rails-for-zombies-2">Rails for Zombies 2</a>, the sequel to the first Intro to Rails Zombie course.  This new course picks up right where the last one left off with 5 more vidoes, and 52 more coding challenges.  Topics include:</p>
<ul>
<li>Rails command line and database migrations</li>
<li>More ActiveRecord relationships and named scopes</li>
<li>Undertstanding REST, nested resources, forms, and partials.</li>
<li>The Rails 3.1 Asset Pipeline</li>
<li>Sending Email from our Rails app</li>
<li>Custom routes and dynamic pages with AJAX</li>
</ul>
<p>By the end of the course you&#8217;ll be much better prepared to create your own Rails applications.  Here&#8217;s the intro video to learn more:</p>
<p><!--[if IE]><span class="mceItemObject"  width="545" height="429" id="viddlerOuter-c22b858a" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><br />
<span  name="movie" value="//www.viddler.com/simple/c22b858a/" class="mceItemParam"></span> <span  name="allowScriptAccess" value="always" class="mceItemParam"></span> <span  name="allowNetworking" value="all" class="mceItemParam"></span> <span  name="allowFullScreen" value="true" class="mceItemParam"></span> <span  name="flashVars" value="f=1&#038;openURL=32595914&#038;autoplay=f&#038;disablebranding=0&#038;loop=0&#038;hd=0" class="mceItemParam"></span><span class="mceItemObject"  id="viddlerInner-c22b858a"><video id="viddlerVideo-c22b858a" src="//www.viddler.com/file/c22b858a/html5mobile?openURL=32595914" mce_src="//www.viddler.com/file/c22b858a/html5mobile?openURL=32595914" type="video/mp4" width="545" height="409" poster="//www.viddler.com/thumbnail/c22b858a/" controls="controls" x-webkit-airplay="allow"></video></span></span><![endif]--> <!--[if !IE]> <!--> <object id="viddlerOuter-c22b858a" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="545" height="429" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="//www.viddler.com/simple/c22b858a/" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashVars" value="f=1&amp;openURL=32595914&amp;autoplay=f&amp;disablebranding=0&amp;loop=0&amp;hd=0" /><param name="src" value="//www.viddler.com/simple/c22b858a/" /><embed id="viddlerOuter-c22b858a" type="application/x-shockwave-flash" width="545" height="429" src="//www.viddler.com/simple/c22b858a/" flashvars="f=1&amp;openURL=32595914&amp;autoplay=f&amp;disablebranding=0&amp;loop=0&amp;hd=0" allowfullscreen="true" allownetworking="all" allowscriptaccess="always" data="//www.viddler.com/simple/c22b858a/"></embed></object> <!--<![endif]--></p>
<p>With Zombies 2 we also released our <a href="http://www.codeschool.com/enroll">Code School Open Enrollment</a> program, which allows you to get access to all our course for one low monthly price.  Head over to <a href="http://www.codeschool.com/enroll">Code School Enrollment</a> to learn more about that.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2011/10/rails-for-zombies-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading to Rails 3.1.1</title>
		<link>http://blog.envylabs.com/2011/10/upgrading-to-rails-3-1-1/</link>
		<comments>http://blog.envylabs.com/2011/10/upgrading-to-rails-3-1-1/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 20:26:51 +0000</pubDate>
		<dc:creator>Jacob Swanner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/?p=1365</guid>
		<description><![CDATA[Often, here at Envy Labs, when we start a new application, we&#8217;ll use the latest version of Rails available; even if that version happens to be a prerelease. Unfortunately, as new versions are released, it can be difficult to know what steps need to be taken to upgrade your applications. There are many times when [...]]]></description>
			<content:encoded><![CDATA[<p>Often, here at Envy Labs, when we start a new application, we&#8217;ll use the latest version of Rails available; even if that version happens to be a prerelease.  Unfortunately, as new versions are released, it can be difficult to know what steps need to be taken to upgrade your applications.</p>
<p>There are many times when just modifying the Rails gem version in your <code>Gemfile</code> and then running <code>bundle update</code> seems to work: your tests still pass, application runs like normal, etc.  So, you never think twice and go about continuing to develop your application.  But, were there other changes that could/should have been made as well?  Perhaps Rails has changed the default value for some configuration setting; perhaps release candidates did not deal with assets in the same way the final release did.  If you are using prerelease versions, more things tend to change as newer versions come out.</p>
<p><span id="more-1365"></span></p>
<p>What the Rails application generator creates is specific to the version of Rails it was generated for.  So, as new versions are released, what the application generator creates changes; and, comparing the output of different versions can give you some understanding of the changes going on in Rails.</p>
<p>So, to that end, I generated applications for the following versions: 3.1.1, 3.1.1.rc3, 3.1.1.rc2, 3.1.1.rc1, 3.1.0, 3.1.0.rc8, 3.1.0.rc6, 3.1.0.rc5, 3.1.0.rc4, 3.1.0.rc3, 3.1.0.rc2, 3.1.0.rc1, 3.1.0.beta1 (3.1.0.rc7 has been yanked from RubyGems); then compared all of them to version 3.1.1.  I&#8217;ve made a gist for each of the comparisons:</p>
<ul>
<li><a href="https://gist.github.com/1270918">Differences between Rails 3.1.0.beta1 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271131">Differences between Rails 3.1.0.rc1 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271136">Differences between Rails 3.1.0.rc2 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271141">Differences between Rails 3.1.0.rc3 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271145">Differences between Rails 3.1.0.rc4 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271147">Differences between Rails 3.1.0.rc5 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271149">Differences between Rails 3.1.0.rc6 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271160">Differences between Rails 3.1.0.rc8 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271163">Differences between Rails 3.1.0 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271165">Differences between Rails 3.1.1.rc1 &amp; Rails 3.1.1</a></li>
<li><a href="https://gist.github.com/1271168">Differences between Rails 3.1.1.rc2 &amp; Rails 3.1.1</a></li>
<li>There is no difference between 3.1.1.rc3 &amp; 3.1.1</li>
</ul>
<p>Hopefully, this will come in handy for anyone else &#8212; like me &#8212; that needs to update some applications that were generated with a Rails version prior to 3.1.1.  And, as you can see, depending on what version you used to generate your application, the changes needed will vary.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2011/10/upgrading-to-rails-3-1-1/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Try Ruby Rewrite and Redesign</title>
		<link>http://blog.envylabs.com/2011/09/try-ruby-rewrite-and-redesign/</link>
		<comments>http://blog.envylabs.com/2011/09/try-ruby-rewrite-and-redesign/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 17:44:41 +0000</pubDate>
		<dc:creator>Gregg Pollack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/?p=1351</guid>
		<description><![CDATA[There once was a developer named &#8220;why the lucky stiff&#8221; also known as  &#8221;_why&#8221;.  He did many great things in the Ruby world, including the creation of an website called Try Ruby which allowed anybody to try their hand at programming ruby by coding in the browser. Here at Envy Labs we&#8217;ve been inspired by [...]]]></description>
			<content:encoded><![CDATA[<p>There once was a developer named &#8220;why the lucky stiff&#8221; also known as  &#8221;_why&#8221;.  He did many great things in the Ruby world, including the creation of an website called <a href="http://tryruby.org">Try Ruby</a> which allowed anybody to try their hand at programming ruby by coding in the browser.</p>
<p><a href="http://tryruby.org"><img class="aligncenter size-full wp-image-1355" title="tryruby" src="http://blog.envylabs.com/wp-content/uploads/2011/09/tryruby.jpg" alt="" width="288" height="199" /></a>Here at Envy Labs we&#8217;ve been inspired by _why&#8217;s work and you can see his influence with <a href="http://railsforzombies.org">Rails for Zombies</a>, where we teach people Rails by coding in the browser.  Rails for Zombies was such a huge success it led us to build <a href="http://www.codeschool.com">Code School</a>, where we build paid coding courses.</p>
<p>We&#8217;ve learned a great deal about how to do in-browser coding as we&#8217;ve built Code School, and a few months ago <a href="http://twitter.com/#!/eallam">Eric Allam</a> started to wonder if we should take our knowledge and contribute back to TryRuby.  After a call to <a href="https://github.com/Sophrinix">Andrew McElroy</a> who graciously maintained the project with <a href="https://github.com/nanothief">David Miani</a> (after _why disappeared), Eric dove in.</p>
<p>Flash forward two months later and today we&#8217;re happy to announce the release of <a href="http://tryruby.org">TryRuby</a> version 3!</p>
<p><span id="more-1351"></span></p>
<p><a href="http://tryruby.org"><img class="aligncenter size-full wp-image-1362" title="Try Ruby Design" src="http://blog.envylabs.com/wp-content/uploads/2011/09/newdesign.jpg" alt="" width="481" height="186" /></a></p>
<p>This new version contains a bunch of new things we&#8217;re excited about:</p>
<ol>
<li><strong>New &#8220;Code School&#8221; Engine</strong> &#8211; Eric Allam worked many weekends to integrate Code School&#8217;s (Rails &amp; Backbone.js) course engine and our code editor into the Try Ruby course.  With this integration you now have the ability to save your progress using your Code School account, so you can come back later and pickup where you left off.  Don&#8217;t worry, it&#8217;s completely optional.. you can still play through TryRuby without ever having a Code School account.</li>
<li><strong>New Design &#8211; </strong>We enrolled Envy Labs designer <a href="http://twitter.com/#!/nickawalsh">Nick Walsh</a> to do a new design as our own tribute to &#8220;_why&#8221;.  We&#8217;re really happy with the redesign which is not only more beautiful, but also has a better user experience (and it&#8217;s responsive!).</li>
<li><strong>New Sandboxing &#8211; </strong>The big issue with running user written Ruby code server-side is it could be EVIL!  Yes, whatever you type in that Ruby console, we will run it on our precious little web server.. sounds dangerous right?  With the help of Dray Lacy, Eric has created a library we&#8217;ll be releasing shortly called RubyCop.  He&#8217;ll be doing a talk on Sandboxing this Saturday at <a href="http://rubyconf.org">Rubyconf</a> if you happen to be here.</li>
<li><strong>New Host &#8211; </strong>We are hosting TryRuby up on <a href="http://www.heroku.com">Heroku</a>, which (in our minds) makes things even more secure.  Most of Code School is up on Heroku anyways, so it seemed like a great fit.</li>
</ol>
<p><a href="http://tryruby.org"><img class="aligncenter size-full wp-image-1357" title="credits" src="http://blog.envylabs.com/wp-content/uploads/2011/09/credits.jpg" alt="" width="470" height="172" /></a></p>
<p><a href="http://www.codeschool.com/courses/try-ruby"><img class="alignright" title="Try Ruby Badge" src="https://d1ffx7ull4987f.cloudfront.net/images/achievements/large_badge/24/completed-tryruby.png" alt="" width="118" height="117" /></a>So&#8230; even if you&#8217;ve done it before or you&#8217;ve never programmed before in your life.. it may be time to dust off those chops and head over to <a href="http://tryruby.org">TryRuby.org</a>.  If you do choose to login to Code School as you&#8217;re doing the course, we&#8217;ll even give you a badge for completing the course.</p>
<p>If you really dig these in-browser coding courses I highly recommend you signup for the Code School Newsletter.  We have some additional free courses in the works (on top of the paid ones):</p>
<form action="https://madmimi.com/signups/subscribe/30772" method="post">
<div><label for="signup_email">Email</label></p>
<input id="signup_email" name="signup[email]" type="text" />
<input class="button" name="commit" type="submit" value="Sign Up" /></div>
</form>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2011/09/try-ruby-rewrite-and-redesign/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>We Ain’t Got No RSpec</title>
		<link>http://blog.envylabs.com/2011/09/we-aint-got-no-rspec/</link>
		<comments>http://blog.envylabs.com/2011/09/we-aint-got-no-rspec/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 15:40:19 +0000</pubDate>
		<dc:creator>Gregg Pollack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/?p=1328</guid>
		<description><![CDATA[Four years ago I was doing the Rails Envy Podcast when we received a voicemail from a listener known as R. Elliot Mason. The instant I heard the voicemail I knew it was special. I also knew there was only one way I could truly give tribute to such an amazing voicemail. Thus, the &#8220;We [...]]]></description>
			<content:encoded><![CDATA[<p>Four years ago I was doing the Rails Envy Podcast when we received a voicemail from a listener known as R. Elliot Mason.  The instant I heard the voicemail I knew it was special.  I also knew there was only one way I could truly give tribute to such an amazing voicemail.  Thus, the <strong>&#8220;We Ain&#8217;t Got No RSpec&#8221;</strong> Remix was born.  Below you&#8217;ll find the original voicemail recording, followed by my Remix.</p>
<p><span id="more-1328"></span></p>
<p><strong>Warning</strong> &#8211; For those sensitive readers, the voicemail and remix does contain the N word, some racial humor, and a swear word or two, so you might not consider it safe for work (or children).</p>
<h2>The Original Voicemail</h2>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="81" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowscriptaccess" value="always" /><param name="src" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F23988605" /><embed type="application/x-shockwave-flash" width="100%" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F23988605" allowscriptaccess="always"></embed></object> <span><a href="http://blog.envylabs.com/wp-content/uploads/2011/09/RailsEnvy-Original-VoiceMail.mp3">Download &#8211; Original &#8220;We Ain&#8217;t Got No RSpec&#8221; Voicemail Mp3</a> </span></p>
<h2>The &#8220;We Ain&#8217;t Got No RSpec&#8221; Remix</h2>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="81" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowscriptaccess" value="always" /><param name="src" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F23988842" /><embed type="application/x-shockwave-flash" width="100%" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F23988842" allowscriptaccess="always"></embed></object> <span><a href="http://blog.envylabs.com/wp-content/uploads/2011/09/AintGotNoRSpec.mp3">Download &#8211; We Ain&#8217;t Got No RSpec MP3</a></span></p>
<h2>Where are they now?</h2>
<p><img class="size-full wp-image-1329 alignright" title="We Ain't Got No RSpec" src="http://blog.envylabs.com/wp-content/uploads/2011/09/NoRSpec_1.png" alt="" width="120" height="128" /> As you probably know the <a href="http://blog.envylabs.com/2010/04/rails-envy/">Rails Envy</a> blog has been taken down since I initially posted this, and these days I&#8217;m doing the <a href="http://ruby5.envylabs.com">Ruby5 podcast</a>.  <a href="https://www.relishapp.com/rspec">RSpec</a> is still what many of us still use to test our Rails Applications, and last I heard <a href="http://twitter.com/#!/eleopteryx">R. Elliot Mason</a> has made it out of the hood and quickly <a href="http://twitter.com/#!/eleopteryx/status/110756789410205696">ran out of things</a> to rap about.</p>
<h2>On the plate?</h2>
<p>What&#8217;s next?  Well <a href="http://twitter.com/#!/eallam">Eric Allam</a> has been working hard something we&#8217;ll be releasing next week (at Rubyconf) which has a LOT to do with Cartoon Foxes.  No, not rapping ghetto cartoon foxes (although I&#8217;d like to see that).  Anyways, you may want to subscribe to our RSS or follow <a href="http://twitter.com/codeschool">Code School</a> on twitter to be notified about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2011/09/we-aint-got-no-rspec/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://blog.envylabs.com/wp-content/uploads/2011/09/RailsEnvy-Original-VoiceMail.mp3" length="148480" type="audio/mpeg" />
<enclosure url="http://blog.envylabs.com/wp-content/uploads/2011/09/AintGotNoRSpec.mp3" length="1556438" type="audio/mpeg" />
		</item>
		<item>
		<title>Running jQuery code from Ruby using ExecJS-Async</title>
		<link>http://blog.envylabs.com/2011/09/running-jquery-code-from-ruby-using-execjs-async/</link>
		<comments>http://blog.envylabs.com/2011/09/running-jquery-code-from-ruby-using-execjs-async/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 16:24:03 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asset pipeline]]></category>
		<category><![CDATA[execjs]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jsdom]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 3.1]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/?p=1310</guid>
		<description><![CDATA[Last week I wrote a post about using the Asset Pipeline outside of Rails because we needed to test answers for Code School&#8217;s upcoming Zombies 2 course. But we also need a way to test javascript (that uses jQuery) that manipulates a DOM, and all from inside of Ruby. ExecJS to the rescue ExecJS is [...]]]></description>
			<content:encoded><![CDATA[<p><a title="pipes by uberculture, on Flickr" href="http://www.flickr.com/photos/uberculture/106597452/"><img src="http://farm1.static.flickr.com/37/106597452_a739bff58b_m.jpg" alt="pipes" width="180" height="240" align="right" /></a></p>
<p>Last week I wrote a post about <a href="http://blog.envylabs.com/2011/08/using-the-asset-pipeline-outside-of-rails-serving-and-running-coffeescript-2/">using the Asset Pipeline outside of Rails</a> because we needed to test answers for <a href="http://www.codeschool.com/">Code School&#8217;s</a> upcoming <a href="http://www.codeschool.com/courses/rails-for-zombies-2">Zombies 2</a> course.  But we also need a way to test javascript (that uses jQuery) that manipulates a DOM, and all from inside of Ruby.</p>
<h2>ExecJS to the rescue</h2>
<p><a href="https://github.com/sstephenson/execjs">ExecJS</a> is a ruby gem that lets you run JavaScript code from Ruby.  It does this by using the best javascript runtime available to evaluate Javascript and returning the result in Ruby!  For example:</p>
<pre class="brush: ruby">
ExecJS.eval &quot;&#039;red yellow blue&#039;.split(&#039; &#039;)&quot;
# =&gt; [&quot;red&quot;, &quot;yellow&quot;, &quot;blue&quot;]
</pre>
<p>Rad! Or you can use it to <code>compile</code> a block of javascript and then <code>call</code> it later, like this:</p>
<pre class="brush: ruby">
context = ExecJS.compile &quot;var run = function(foo) { return foo + foo }&quot;
context.call &#039;run&#039;, &#039;bar&#039;
# =&gt; &#039;barbar&#039;
</pre>
<p><span id="more-1310"></span></p>
<p>The Asset Pipeline uses ExecJS for it&#8217;s CoffeeScript compilation and Javascript minification.  But we still needed to somehow programmatically setup a DOM, load the jQuery javascript library, and inject our student&#8217;s javascript.<br />
Luckily, we&#8217;d already solved this problem for our <a href="http://www.codeschool.com/courses/jquery-air-first-flight">jQuery Air</a> and <a href="http://www.codeschool.com/courses/functional-html5-css3">HTML5 &amp; CSS3 Functional Design</a> courses, using the <a href="https://github.com/tmpvar/jsdom">JSDOM</a> Javascript library. JSDOM makes it super easy to create a DOM and require external javascript libraries (like jQuery).  You can supply your own HTML and then manipulate it in Javascript using the <code>jsdom.env</code>, method, like this:</p>
<pre class="brush: javascript">
html = &#039;&lt;h1&gt;JSDOMs Homepage&lt;/h1&gt;&#039;
jquery = &#039;http://code.jquery.com/jquery-1.5.min.js&#039;

jsdom.env(html, [jquery], function(errors, window) {
console.log(&quot;contents of a.the-link:&quot;, window.$(&quot;h1&quot;).text());
// logs: JSDOMs Homepage
});
</pre>
<p>So we went to work hooking all these pieces up together, but we hit a snag early on.  We wanted to setup JSDOM with some fixture HTML data, require jQuery, then run the student&#8217;s Javascript and finally return the modified DOM, like this:</p>
<pre class="brush: javascript">
jsdom.env(html, [jquery], function(errors, window) {
var jQuery = window.jQuery;
var $ = jQuery;
var document = window.document;
eval(students_code);
return $(&#039;body&#039;).html();
});
</pre>
<p>But <code>jsdom.env</code> works asynchronously, returning before the <code>function</code> callback is run.  And ExecJS does not work with asynchronous javascript:</p>
<pre class="brush: ruby">
context = ExecJS.compile &lt;&lt;-JAVASCRIPT
var run = function(html, code){
jsdom.env(html, [jquery], function(errors, window) {
var jQuery = window.jQuery;
var $ = jQuery;
var document = window.document;
eval(students_code);
return window.jQuery(&#039;body&#039;).html();
});
}
JAVASCRIPT

html = &quot;&lt;h1&gt;Foo&lt;/h1&gt;&quot;
student_code = &quot;$(&#039;h1&#039;).text(&#039;Bar&#039;)&quot;
context.call &#039;run&#039;, html, student_code
# =&gt; &quot;&quot;
</pre>
<p>Digging into the ExecJS code (and then talking to the maintainers) it was clear that ExecJS would only ever work with synchronous javascript code because ExecJS&#8217;s goal is to provide a common interface against a number of different javascript runtimes, and the runtimes all have different ways (or none at all) of doing async callbacks.  But since we&#8217;d always be running the <a href="http://nodejs.org/">Node.js</a> runtime (since we use <a href="http://www.heroku.com/">Heroku</a>), we wrote a gem that adds async support to ExecJS for the Node runtime only, called <a href="https://github.com/rubymaverick/execjs-async">execjs-async</a>.  Now this works:</p>
<pre class="brush: ruby">
context = ExecJS.compile_async &lt;&lt;-JAVASCRIPT
var run = function(html, code){
jsdom.env(html, [jquery], function(errors, window) {
var jQuery = window.jQuery;
var $ = jQuery;
var document = window.document;
eval(students_code);
callback(window.jQuery(&#039;body&#039;).html());
});
}
JAVASCRIPT

html = &quot;&lt;h1&gt;Foo&lt;/h1&gt;&quot;
student_code = &quot;$(&#039;h1&#039;).text(&#039;Bar&#039;)&quot;
context.call &#039;run&#039;, html, student_code
# =&gt; &quot;&lt;h1&gt;Bar&lt;/h1&gt;&quot;
</pre>
<p>Notice instead of <code>return</code>ing, we are calling a function named <code>callback</code> and whatever we pass to that will be the result of calling <code>context.call</code>.  ExecJS-Async provides this <code>callback</code> function to any javascript code compiled with <code>ExecJS.compile_async</code>.</p>
<p>This is a stripped down version of the code we are using for <a href="http://www.codeschool.com/courses/rails-for-zombies-2">Zombies 2</a>, but it&#8217;s pretty close.  Zombies 2 is almost ready to go, you can signup <a href="http://www.codeschool.com/courses/rails-for-zombies-2">here</a> to be notified when it becomes available.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2011/09/running-jquery-code-from-ruby-using-execjs-async/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using the Asset Pipeline outside of Rails – Serving CoffeeScript and SASS</title>
		<link>http://blog.envylabs.com/2011/08/using-the-asset-pipeline-outside-of-rails-serving-and-running-coffeescript-2/</link>
		<comments>http://blog.envylabs.com/2011/08/using-the-asset-pipeline-outside-of-rails-serving-and-running-coffeescript-2/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 15:03:55 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asset pipeline]]></category>
		<category><![CDATA[rack]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sinatra]]></category>
		<category><![CDATA[sprockets]]></category>

		<guid isPermaLink="false">http://blog.envylabs.com/2011/08/using-the-asset-pipeline-outside-of-rails-serving-and-running-coffeescript-2/</guid>
		<description><![CDATA[In our upcoming Rails for Zombies 2 Code School course, we have a couple of challenges that make use of Rails 3.1 new Asset Pipeline. The Asset Pipeline is the thing in Rails that serves up your javascript, images, and stylesheets. But it can also compile CoffeeScript into Javascript, or SASS into CSS. And so [...]]]></description>
			<content:encoded><![CDATA[<p>In our upcoming <a href="http://www.codeschool.com/courses/rails-for-zombies-2 ">Rails for Zombies 2</a> Code School course, we have a couple of challenges that make use of Rails 3.1 new <a href="http://ryanbigg.com/guides/asset_pipeline.html">Asset Pipeline.</a> The Asset Pipeline is the thing in Rails that serves up your javascript, images, and stylesheets.  But it can also compile <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a> into Javascript, or SASS into CSS.</p>
<p>And so we wanted to teach people a little bit of CoffeeScript/SASS in Rails for Zombies 2.  But that means we have to have a way to test CoffeeScript/SASS.  We accomplished this by extracting the bits in Rails 3.1 that implement the pipeline and used them to serve and compile CoffeeScript into Javascript and SASS into CSS.</p>
<p><span id="more-1285"></span></p>
<h2>Serving CoffeeScript or SASS using a custom Sprockets Environment</h2>
<p>The Asset Pipeline is powered by the <a href="https://github.com/sstephenson/sprockets">sprockets</a> gem by Sam Stephenson.  It hooks into the Rails stack by inserting a Rack App at the very top of your routes collection.  When a request for an asset hits your app it will be &#8216;routed&#8217; to the sprockets environment. The relevant setup code in Rails is located <a href="https://github.com/rails/rails/blob/3-1-stable/actionpack/lib/sprockets/railtie.rb">here</a>.</p>
<h3>Creating a custom Sprockets Environment</h3>
<p>First you need to require sprockets and supporting gems, just add this to your Gemfile:</p>
<pre class="brush: ruby">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
gem &#039;sprockets&#039;, :git =&gt;&#039;git://github.com/sstephenson/sprockets.git&#039;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
gem &#039;coffee-script&#039;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
gem &#039;sass&#039;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>After running <code>bundle install</code>, we can create a new Sprockets::Environment, setting the path to the root of your project and a logger:</p>
<pre class="brush: ruby">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
require &#039;bundler/setup&#039;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
Bundler.require # this will require all the gems in your Gemfile&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;  assets = Sprockets::Environment.new(project_root) do |env|&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
env.logger = Logger.new(STDOUT)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>Next we need to tell the environment about the paths it should use to lookup assets from the filesystem.  The simplest configuration would just be a single path to all your assets:</p>
<pre class="brush: ruby">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
assets.append_path(&#039;/Full/Path/To/assets&#039;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>We need a way to <code>call</code> the sprockets rack app we just created.  One easy way is to use rack/test.</p>
<pre class="brush: ruby">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
# in Gemfile&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
gem &#039;rack-test&#039;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;  # in project&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
session = Rack::Test::Session.new(Rack::MockSession.new(assets))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
session.get(&#039;application.js&#039;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
# Served asset /application.js - 404 Not Found&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>As you can see sprockets returned a 404 Not Found, because we haven&#8217;t actually created our file yet.</p>
<p>To fix this, create a <code>application.js.coffee</code> file in your assets directory, something like this:</p>
<pre class="brush: javascript">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(document).ready -&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(&#039;#foo&#039;).html(&quot;&lt;p&gt;bar&lt;/p&gt;&quot;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>And use <code>session</code> to request it again:</p>
<pre class="brush: ruby">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
session.get(&#039;application.js&#039;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
session.last_response.body&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>That should return this beautifully transpiled javascript:</p>
<pre class="brush: javascript">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
(function() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(document).ready(function() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
return $(&#039;#foo&#039;).html(&quot;&lt;p&gt;bar&lt;/p&gt;&quot;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}).call(this);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>It get&#8217;s cooler!  You can stick a .erb on the end of the application.js.coffee and sprockets will run it through ERB before converting it to javascript.  Try this:</p>
<pre class="brush: javascript">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
# in application.js.coffee.erb&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(document).ready -&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(&#039;img&#039;).attr(&#039;src&#039;, &quot;&lt;%= asset_path(&#039;lolwut.png&#039;) %&gt;&quot;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>And request it again:</p>
<pre class="brush: ruby">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
session.get(&#039;application.js&#039;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
# NoMethodError: undefined method `asset_path&#039;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>Unfortunately that <code>asset_path</code> method isn&#8217;t defined like it is in Rails.  But we can easily define our own helpers that can be used in our assets served with erb preprocessing, like this:</p>
<pre class="brush: ruby">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
module AssetHelpers&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
def asset_path(name)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&quot;/assets/#{name}&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
end&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;  assets.context_class.instance_eval do&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
include AssetHelpers&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>Now if you try the request again, you should get this result:</p>
<pre class="brush: javascript">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
(function() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
$(document).ready(function() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
return $(&#039;img&#039;).attr(&#039;src&#039;, &quot;/assets/lolwut.png&quot;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}).call(this);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>We actually don&#8217;t have to change anything to serve SASS.  Add a application.css.scss file to your assets directory and request it like before:</p>
<pre class="brush: css">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
# application.css.scss&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
h2 {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
font-size: 10em;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
a {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
height: 64px;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
width: 50px;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
display: block;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<pre class="brush: ruby">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
session.get(&#039;application.css&#039;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
session.last_response.body&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
# h2 {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
#   font-size: 10em; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
#   h2 a {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
#     height: 64px;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
#     width: 50px;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
#     display: block; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<h3>Sinatra</h3>
<p>You can use this as a quick way to add the asset pipeline to <a href="http://www.sinatrarb.com/intro.html">Sinatra</a>.<br />
Add <code>gem 'sinatra'</code> to your Gemfile and then add this sinatra route:</p>
<pre class="brush: ruby">&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
get &#039;/assets/*&#039; do&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
new_env = env.clone&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
new_env[&quot;PATH_INFO&quot;].gsub!(&quot;/assets&quot;, &quot;&quot;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
assets.call(new_env)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</pre>
<p>This will invoke the asset pipeline for all GET requests under <code>/assets</code>, so <code>http://localhost/assets/application.css</code> will serve the <code>application.css.scss</code> asset. (We had to modify the <code>PATH_INFO</code> otherwise sprockets would look for assets under <code>/assets/assets/</code>, which isn&#8217;t what we want.)</p>
<p>That&#8217;s it!  For all the code in this blog post check out <a href="https://gist.github.com/1176760">this gist.</a></p>
<p>In a future blog post, I&#8217;m going to show how to run that compiled javascript against a DOM using <a href="https://github.com/rubymaverick/execjs-async">execjs-async</a> and <a href="https://github.com/tmpvar/jsdom">jsdom</a>, all from the comfort of Ruby.</p>
<p><strong>UPDATE: </strong> Sprockets <a href="https://github.com/sstephenson/sprockets/tree/v2.0.0">2.0.0</a> was just released and it&#8217;s got some great new documentation in the README, make sure to check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.envylabs.com/2011/08/using-the-asset-pipeline-outside-of-rails-serving-and-running-coffeescript-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.557 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-08 16:20:41 -->

