<?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>Web Development Advice and Tips &#187; Ruby</title>
	<atom:link href="http://blog.smartlogicsolutions.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartlogicsolutions.com</link>
	<description>SmartLogic Solutions Blog</description>
	<lastBuildDate>Thu, 09 May 2013 14:52:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>RubyConf 2012: Links to Follow Up On</title>
		<link>http://blog.smartlogicsolutions.com/2012/11/03/rubyconf-2012-links-to-follow-up-on/</link>
		<comments>http://blog.smartlogicsolutions.com/2012/11/03/rubyconf-2012-links-to-follow-up-on/#comments</comments>
		<pubDate>Sat, 03 Nov 2012 15:10:31 +0000</pubDate>
		<dc:creator>Eric Oestrich</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[rubyconf]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=1484</guid>
		<description><![CDATA[<p>At RubyConf, there&#8217;s so much more to dig into after every session. From apps, to people, to blog posts, I started to keep tracks of links I&#8217;d like to follow up on after the conference. I thought I&#8217;d share them here, for everyone&#8217;s reference. I&#8217;m updating from the conference, as quickly as I can manage. [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2013/05/03/4-links-from-railsconf-2013-day-4/"     class="crp_title">4 Links from RailsConf 2013 Day 4</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/10/29/rubyconf-2012-3-things-im-looking-forward-to/"     class="crp_title">RubyConf 2012: 3 Things I’m Looking Forward To</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/30/22-links-from-railsconf-2013-day-1/"     class="crp_title">22 Links From RailsConf 2013 Day 1</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/05/01/22-links-from-railsconf-2013-day2/"     class="crp_title">9 Links From RailsConf 2013 Day 2</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/05/02/31-links-from-railsconf-day-3/"     class="crp_title">31 Links from RailsConf Day 3</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2012/11/03/rubyconf-2012-links-to-follow-up-on/">RubyConf 2012: Links to Follow Up On</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2012/11/The.Legend.of_.Zelda_.full_.217192.jpg"><img class="alignright size-full wp-image-1493" title="RubyConf 2012....so many Links!" src="http://blog.smartlogicsolutions.com/wp-content/uploads/2012/11/The.Legend.of_.Zelda_.full_.217192.jpg" alt="RubyConf 2012....so many Links!" width="300" height="313" /></a>At RubyConf, there&#8217;s so much more to dig into after every session. From apps, to people, to blog posts, I started to keep tracks of links I&#8217;d like to follow up on after the conference. I thought I&#8217;d share them here, for everyone&#8217;s reference. I&#8217;m updating from the conference, as quickly as I can manage.</p>
<p>Please feel free to comment if you&#8217;d like to add a link to the list.</p>
<p><span id="more-1484"></span></p>
<p><strong>From Day 1:</strong></p>
<p><a href="http://rubini.us/" target="_blank">Rubinius : Use Ruby™</a><br />
<a href="https://github.com/asakusarb/odrk-http-client/blob/master/perf/bm.rb" target="_blank">odrk-http-client/perf/bm.rb at master · asakusarb/odrk-http-client</a><br />
<a href="https://docs.google.com/a/oestrich.org/spreadsheet/pub?key=0AiZsKd8d4hSJdF9WRHVoRElnaV9paThuZ1FBSU1Ob3c&amp;single=true&amp;gid=4&amp;output=html" target="_blank">Ruby HTTP clients features 2012</a><a href="https://github.com/nahi/httpclient" target="_blank">nahi/httpclient</a><br />
<a href="http://maglev.github.com/" target="_blank">MagLev</a><br />
<a href="http://timelessrepo.com/refinements-in-ruby" target="_blank">Refinements in Ruby — Timeless</a><br />
<a href="https://metrics.librato.com/" target="_blank">Librato Metrics</a><br />
<a href="http://metrics.codahale.com/" target="_blank">Home | Metrics</a><br />
<a href="http://www.splunk.com/?r=header" target="_blank">Operational Intelligence, Log Management, Application Management, Enterprise Security and Compliance | Splunk</a><br />
<a href="https://github.com/amatsuda/rspec-refinements" target="_blank">amatsuda/rspec-refinements · GitHub</a><br />
<a href="https://github.com/eric/metriks" target="_blank">eric/metriks</a><br />
<a href="https://codeclimate.com/" target="_blank">Code Climate. Hosted static analysis for Ruby source code.</a><br />
<a href="http://rubyspec.org/" target="_blank">RubySpec: The Standard You Trust™</a><br />
<a href="http://jstorimer.com/" target="_blank">Jesse Storimer</a></p>
<p>&nbsp;</p>
<p><strong>From Day 2</strong>:</p>
<p><a href="http://pragprog.com/book/sidruby/the-druby-book" target="_blank">The Pragmatic Bookshelf | The dRuby Book</a><br />
<a href="https://github.com/tenderlove/tusk" target="_blank">tenderlove/tusk</a><br />
<a href="https://codeclimate.com/rubyconf" target="_blank">Improve your Code Quality at RubyConf 2012</a><br />
<a href="http://celluloid.io/" target="_blank">Celluloid: Actor-based Concurrent Objects for Ruby</a><br />
<a href="http://clean-ruby.com/" target="_blank">Ruby, Rails, DCI and OOP. Don&#8217;t just make abstractions, write clean, intention-revealing Ruby. Clean Ruby by Jim Gay teaches about OOP, DCI, and more!</a><br />
<a href="http://patshaughnessy.net/ruby-under-a-microscope" target="_blank">Ruby Under a Microscope &#8211; Pat Shaughnessy</a><br />
<a href="http://www.unlimitednovelty.com/" target="_blank">Unlimited Novelty</a><br />
<a href="https://github.com/37signals/sub" target="_blank">37signals/sub</a><br />
<a href="https://github.com/tdiary" target="_blank">tdiary (tDiary)</a><br />
<a href="http://sferik.github.com/t/" target="_blank">T by sferik</a><br />
<a href="http://schneems.com/ut-rails" target="_blank">Schneems • UT on Rails</a><br />
<a href="http://issuetriage.herokuapp.com/" target="_blank">Resque Triage</a><br />
<a href="https://github.com/josephwilk/creative-machine" target="_blank">josephwilk/creative-machine</a><br />
<a href="https://github.com/burtlo/metro" target="_blank">burtlo/metro</a></p>
<p>&nbsp;</p>
<p><strong>From Day 3:</strong></p>
<p><a href="http://windycityrails.org/videos2012/#1" target="_blank">Videos &#8211; WindyCityRails</a><br />
<a href="http://www.libgosu.org/" target="_blank">Gosu, 2D game development library</a><br />
<a href="http://www.sikuli.org/" target="_blank">Sikuli Script &#8211; Home</a><br />
<a href="https://github.com/tenderlove/racc" target="_blank">tenderlove/racc</a></p>
<p>&nbsp;</p>
<p>Reach out on Twitter <a href="http://twitter.com/ericoestrich" target="_blank">@ericoestrich</a> if you&#8217;d like to catch up at RubyConf, or ask a question about any of these links.</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2013/05/03/4-links-from-railsconf-2013-day-4/"     class="crp_title">4 Links from RailsConf 2013 Day 4</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/10/29/rubyconf-2012-3-things-im-looking-forward-to/"     class="crp_title">RubyConf 2012: 3 Things I’m Looking Forward To</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/30/22-links-from-railsconf-2013-day-1/"     class="crp_title">22 Links From RailsConf 2013 Day 1</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/05/01/22-links-from-railsconf-2013-day2/"     class="crp_title">9 Links From RailsConf 2013 Day 2</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/05/02/31-links-from-railsconf-day-3/"     class="crp_title">31 Links from RailsConf Day 3</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2012/11/03/rubyconf-2012-links-to-follow-up-on/">RubyConf 2012: Links to Follow Up On</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2012/11/03/rubyconf-2012-links-to-follow-up-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RubyConf 2012: 3 Things I’m Looking Forward To</title>
		<link>http://blog.smartlogicsolutions.com/2012/10/29/rubyconf-2012-3-things-im-looking-forward-to/</link>
		<comments>http://blog.smartlogicsolutions.com/2012/10/29/rubyconf-2012-3-things-im-looking-forward-to/#comments</comments>
		<pubDate>Mon, 29 Oct 2012 20:10:21 +0000</pubDate>
		<dc:creator>Eric Oestrich</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[api documentation]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[rubyconf]]></category>
		<category><![CDATA[service oriented architecture]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=1474</guid>
		<description><![CDATA[<p>As Hurricane Sandy pummels the East Coast, I’m crossing my fingers that I’ll still be able to get out of Baltimore to head to RubyConf in Denver. This is the first big conference I’ve been to that’s not RailsConf,and I’m looking forward to the new perspectives and knowledge I’ll gain—weather willing. Here’s three things I’m [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2012/09/11/rest-fest-3-things-im-looking-forward-to/"     class="crp_title">REST Fest: 3 Things I&#8217;m Looking Forward To</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/11/03/rubyconf-2012-links-to-follow-up-on/"     class="crp_title">RubyConf 2012: Links to Follow Up On</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/25/4-railsconf-2013-topics-to-get-excited-about/"     class="crp_title">4 RailsConf 2013 Topics to Get Excited About</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/23/railsconf-2013-2-must-see-talks-a-day/"     class="crp_title">RailsConf 2013: 2 Must-See Talks a Day</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/03/20/10-cocoaconf-dc-2013-sessions/"     class="crp_title">10 CocoaConf DC 2013 Sessions to Be Excited About</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2012/10/29/rubyconf-2012-3-things-im-looking-forward-to/">RubyConf 2012: 3 Things I’m Looking Forward To</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>As Hurricane Sandy pummels the East Coast, I’m crossing my fingers that I’ll still be able to get out of Baltimore to head to <a href="http://rubyconf.org/" target="_blank">RubyConf </a>in Denver. This is the first big conference I’ve been to that’s not <a href="http://www.railsconf.com/" target="_blank">RailsConf,</a>and I’m looking forward to the new perspectives and knowledge I’ll gain—weather willing.</p>
<p><a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2012/10/logo.png"><img class=" wp-image-1475 alignright" title="RubyConf 2012" src="http://blog.smartlogicsolutions.com/wp-content/uploads/2012/10/logo.png" alt="3 reasons why I'm looking forward to RubyConf 2012" width="320" height="263" /></a></p>
<p>Here’s three things I’m particularly excited about, besides being dry:</p>
<ol>
<li><strong>Learning About the Wonderful World of Ruby from Matz:</strong> This one’s a no-brainer. I’m pumped to hear from the creator of Ruby, and maybe get a sneak peek of what’s coming with Ruby 2.0.</li>
<li><strong>Focusing on Ruby in Sessions:</strong> When I went to RailsConf, it was all Rails sessions, with nothing focusing just on Ruby. I’m excited to focus exclusively on Ruby, with, of course, some Rails and other web stuff sprinkled in. There’s one about dRuby (distributed Ruby) that I’m particularly interested in.</li>
<li><strong>Hearing about Scalable Web Architectures:</strong> There’s two sessions related to scalable web architectures that I’m looking forward to, because I’m working with apps using scalable web architectures every day. First, I hope <a href="https://twitter.com/chrishunt" target="_blank">Chris Hunt</a> from Square, who’s covering Service Oriented Architecture (SOA) at Square, mentions rspec_api_documentation when he covers <a href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/" target="_blank">API documentation</a>! But really, I’m also interested to hear his perspective on Square’s approach to SOA. Second, I am interested in learning more about Cross Origin Resource Sharing (CORS) from <a href="http://www.mbleigh.com/" target="_blank">Michael Bleigh</a>, co-founder of <a href="http://divshot.com/" target="_blank">Divshot</a>. This isn’t directly related to what I’m doing at work right now, but I’m looking forward to bringing takeaways home to our team.</li>
</ol>
<p>Are you headed to RubyConf? What are you looking forward to? Comment below, or tweet me <a href="http://twitter.com/ericoestrich" target="_blank">@ericoestrich</a>.</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2012/09/11/rest-fest-3-things-im-looking-forward-to/"     class="crp_title">REST Fest: 3 Things I&#8217;m Looking Forward To</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/11/03/rubyconf-2012-links-to-follow-up-on/"     class="crp_title">RubyConf 2012: Links to Follow Up On</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/25/4-railsconf-2013-topics-to-get-excited-about/"     class="crp_title">4 RailsConf 2013 Topics to Get Excited About</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/23/railsconf-2013-2-must-see-talks-a-day/"     class="crp_title">RailsConf 2013: 2 Must-See Talks a Day</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/03/20/10-cocoaconf-dc-2013-sessions/"     class="crp_title">10 CocoaConf DC 2013 Sessions to Be Excited About</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2012/10/29/rubyconf-2012-3-things-im-looking-forward-to/">RubyConf 2012: 3 Things I’m Looking Forward To</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2012/10/29/rubyconf-2012-3-things-im-looking-forward-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>API Planning and Proceeding: Tell Me What You’re Working With</title>
		<link>http://blog.smartlogicsolutions.com/2012/08/28/api-planning-and-proceeding-tell-me-what-youre-working-with/</link>
		<comments>http://blog.smartlogicsolutions.com/2012/08/28/api-planning-and-proceeding-tell-me-what-youre-working-with/#comments</comments>
		<pubDate>Tue, 28 Aug 2012 13:45:58 +0000</pubDate>
		<dc:creator>Yair Flicker</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[smartlogic]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=1254</guid>
		<description><![CDATA[<p>Ok, you need to build an API. API’s, like snowflakes and people, come in all different shapes and sizes. They do different things, communicate in different ways, and are designed with a variety of approaches and objectives. We have to figure out what your API end game is before we get into the nitty-gritty of [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2012/07/31/what-makes-a-good-api/"     class="crp_title">What Makes a Good API?</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/12/api-versioning-3-ways-to-architect-your-api-to-handle-versioned-requests/"     class="crp_title">API Versioning: 3 Ways to Architect Your API to Handle&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/09/11/rest-fest-3-things-im-looking-forward-to/"     class="crp_title">REST Fest: 3 Things I&#8217;m Looking Forward To</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/01/23/sinatra-oauth-workflow-use-this-to-speed-up-your-app-development/"     class="crp_title">Sinatra OAuth Workflow: Use This to Speed Up Your App&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/"     class="crp_title">cURLin’ for Docs</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2012/08/28/api-planning-and-proceeding-tell-me-what-youre-working-with/">API Planning and Proceeding: Tell Me What You’re Working With</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Ok, you need to build an API. API’s, like snowflakes and people, come in all different shapes and sizes. They do different things, communicate in different ways, and are designed with a variety of approaches and objectives. We have to figure out what your API end game is before we get into the nitty-gritty of building it. To do that, it’s time to answer some questions and consider some preliminary thoughts. Hopefully these are issues you’re already thinking about. If not, no time like the present.</p>
<h2 dir="ltr">Pick your poison: public, private, or SOA</h2>
<p>Each one has its own considerations and needs.</p>
<p>Several issues come into play when deciding what type of API you need. How much control do you want over your brand? How many people are going to be using the API? What’s your current plan for authentication? Are you helping services interact with each other, or connecting a back-end to a front-end? There are lots of different approaches, and they all yield different products.</p>
<p>Public APIs are generally used as platforms, opening up your data and software to outside use. For example, Facebook, Twitter, and WordPress all have public APIs open to developers. Private APIs, on the other hand, are never seen by the consumer. For example, most mobile applications are built using APIs.</p>
<p>Then there’s SOAs (service oriented architecture)—which some include in the API category and some keep separate. Unlike a basic API, SOAs help backend services work together. Most SOAs are kept private.</p>
<h2 dir="ltr">Document or die<a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2012/08/Doc_or_die1.jpg"><img class="alignright size-full wp-image-1281" title="What P. Diddy said " src="http://blog.smartlogicsolutions.com/wp-content/uploads/2012/08/Doc_or_die1.jpg" alt="" width="256" height="300" /></a></h2>
<p>Documentation is extremely important for APIs because you could have a team of developers who weren’t involved in building the API taking it and running with it. We handle this through a tool we built to combine testing with automatic documentation generation. We’ve published it so you can use it too: check it out in our post <a title="&quot;cURLin’ for Docs.&quot;" href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/" target="_blank">“Curlin’ for Docs.” </a></p>
<h2 dir="ltr">REST, don’t nap</h2>
<p>No matter what type of API you’re building, your design should be RESTful (REpresentational State Transfer). Ruby on Rails makes RESTful APIs simple to create. In turn, RESTful design makes APIs simpler to design, version, and use.</p>
<h2 dir="ltr"><span id="more-1254"></span>Who is the audience?</h2>
<p>Is your API for internal use, or will it be publicly available? Will it be a platform that people outside your organization will rely on?</p>
<p>With an API the public uses, you can’t just wander off the map; you have to design with your users in mind. A private API, on the other hand, is essentially like making sure that your handwriting is legible on your kitchen’s whiteboard: it can look like Sanskrit as long as everyone in the house can read it. If the objective is only a communication tool for your team, you have more leeway in designing for you and the team, not developers all over the world.</p>
<p>Thus, your API’s budget and construction will be totally different depending on your ideal use cases.</p>
<h2 dir="ltr">How’s your budget looking?</h2>
<p>If the goal is a private API for internal use, your pockets don’t need to be as deep as a public API project. As explained above, a private API has a focused set of uses and doesn’t need to interface as widely, so building one isn’t as cost intensive.</p>
<h2 dir="ltr">What’s the lifespan of your API?</h2>
<p>In almost all API cases, it makes sense to plan ahead as much as possible, which means designing it right the first time. Especially if your API is used as a platform. When you version your API, it’s extremely important to make each upgrade consistent, reliable, and basically adherent to best practices standards. People who use your API will expect as much, and it makes your life easier down the road.</p>
<h2 dir="ltr">How will you handle authentication?</h2>
<p>In a world of spam and hacking, it’s extremely important to keep your users’ trust. Use OAuth authentication for your API so that external developers don’t have direct access to information like usernames and passwords.</p>
<p>That’s a quick flyby of some things to consider before you get your API on.</p>
<p>Check out<a title="@smartlogic on Twitter" href="http://twitter.com/smartlogic" target="_blank"> @smartlogic on Twitter</a> or<a title="like us on Facebook" href="http://www.facebook.com/smartlogic" target="_blank"> like us on Facebook</a> for more like this!</p>
<p>&nbsp;</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2012/07/31/what-makes-a-good-api/"     class="crp_title">What Makes a Good API?</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/12/api-versioning-3-ways-to-architect-your-api-to-handle-versioned-requests/"     class="crp_title">API Versioning: 3 Ways to Architect Your API to Handle&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/09/11/rest-fest-3-things-im-looking-forward-to/"     class="crp_title">REST Fest: 3 Things I&#8217;m Looking Forward To</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/01/23/sinatra-oauth-workflow-use-this-to-speed-up-your-app-development/"     class="crp_title">Sinatra OAuth Workflow: Use This to Speed Up Your App&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/"     class="crp_title">cURLin’ for Docs</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2012/08/28/api-planning-and-proceeding-tell-me-what-youre-working-with/">API Planning and Proceeding: Tell Me What You’re Working With</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2012/08/28/api-planning-and-proceeding-tell-me-what-youre-working-with/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using RSpec Macros and Metadata</title>
		<link>http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/</link>
		<comments>http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 16:00:12 +0000</pubDate>
		<dc:creator>Sam Goldman</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=1070</guid>
		<description><![CDATA[<p>I have to hand it to you: you&#8217;re a great Rails developer! I just read through the code you&#8217;ve been writing for that new project and you&#8217;re doing it right. You&#8217;ve got fast, isolated tests with RSpec, integration tests in well-written Cucumber scenarios, and have you lost weight or are your controllers skinnier? Just one nit-pick, though—where [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/10/26/testpilot-rails-integration-testing-pattern/"     class="crp_title">TestPilot &#8211; Rails Integration Testing Pattern</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/10/25/api-development/"     class="crp_title">API Development: Turning Controller Actions into Services</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/"     class="crp_title">cURLin’ for Docs</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/"     class="crp_title">Testing AJAX with Test::Unit</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/12/api-versioning-3-ways-to-architect-your-api-to-handle-versioned-requests/"     class="crp_title">API Versioning: 3 Ways to Architect Your API to Handle&hellip;</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/">Using RSpec Macros and Metadata</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I have to hand it to you: you&#8217;re a great Rails developer! I just read through the code you&#8217;ve been writing for that new project and you&#8217;re doing it right. You&#8217;ve got fast, isolated tests with RSpec, integration tests in well-written Cucumber scenarios, and have you lost weight or are your controllers skinnier? Just one nit-pick, though—where are your controller specs?<br />
<span id="more-1070"></span><br />
If you follow best practices, I understand that it can seem unnecessary to test your controllers: they&#8217;re so small, they are all the same, and it&#8217;s pretty hard to get it wrong. Indeed, it would probably take longer to write the tests than it would to write the controller itself and in any event you already have integration tests that are covering most of the controller code.</p>
<p>Let me tell you why I still think you should write controller tests:</p>
<ul>
<li>They are very easy to write</li>
<li>They are mostly the same</li>
<li>Because they are mostly the same, we can refactor and make them even easier to write</li>
</ul>
<p>We all refactor our code, but it&#8217;s just as important to refactor our tests. The goal of refactoring is to facilitate reuse and increase clarity. Refactoring let&#8217;s us develop new abstractions upon which we can build complex logic. Our controllers are so lean and mean because they are benefitting from a very convenient abstraction: RESTful web services.</p>
<p>Chances are most of the controllers in your app have a lot of shared behaviors. They find, create, and update your models, set flash messages, redirect or render templates, and set status codes. Let&#8217;s take advantage of the shared behaviors to refactor our tests.</p>
<p>Put the following file into spec/support/controller_helpers.rb</p>
<pre class="wp-code-highlight prettyprint">module ControllerHelpers
  extend ActiveSupport::Concern

  module ClassMethods
    def self.define_action(action)
      define_method action do |*args, &amp;block|
        options = args.extract_options!
        options[:http_method] = action
        options[:controller_method] = args[0]
        args[0] = [action.to_s.upcase, &quot;#&quot; + options[:controller_method].to_s].join(&quot; &quot;)
        args &lt;&lt; options
        context(*args, &amp;block)
      end
    end

    define_action :get
    define_action :post
    define_action :put
    define_action :delete
    define_action :head
    define_action :options

    def it_should_flash(type, message)
      it &quot;should set the flash&quot; do
        do_request
        flash[type].should eq(message)
      end
    end

    def it_should_redirect_to(&amp;block)
      it &quot;should redirect&quot; do
        url = instance_eval(&amp;block)
        do_request
        response.should redirect_to(url)
      end
    end

    def it_should_render_template(template)
      it &quot;should render the #{template} template&quot; do
        do_request
        response.should render_template(template)
      end
    end
  end

  def do_request
    params = if respond_to?(:params) then send(:params) else nil end # of story
    send(example.metadata[:http_method], example.metadata[:controller_method], params)
  end
end

RSpec.configure do |config|
  config.include ControllerHelpers, :type =&gt; :controller
end</pre>
<p>Now we can write our controller specs easily. For example:</p>
<pre class="wp-code-highlight prettyprint">require &quot;spec_helper&quot;

describe FoosController do
  get :new do
    it_should_render_template :new
  end

  post :create do
    let(:params) { &quot;foo&quot; =&gt; { &quot;bar&quot; =&gt; &quot;baz&quot; } }
    let(:foo) { stub }

    before { Foo.stub!(:new).with(&quot;bar&quot; =&gt; &quot;baz&quot;).and_return(foo) }

    context &quot;successful create&quot; do
      before { foo.stub!(:save).and_return(true) }

      it_should_set_flash :success, &quot;Created foo.&quot;
      it_should_redirect_to { foos_url }
    end

    context &quot;failed create&quot; do
      before { foo.stub!(:save).and_return(false) }

      it_should_render_template :new
    end
  end
end</pre>
<p>Enjoy!</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/10/26/testpilot-rails-integration-testing-pattern/"     class="crp_title">TestPilot &#8211; Rails Integration Testing Pattern</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/10/25/api-development/"     class="crp_title">API Development: Turning Controller Actions into Services</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/"     class="crp_title">cURLin’ for Docs</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/"     class="crp_title">Testing AJAX with Test::Unit</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/12/api-versioning-3-ways-to-architect-your-api-to-handle-versioned-requests/"     class="crp_title">API Versioning: 3 Ways to Architect Your API to Handle&hellip;</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/">Using RSpec Macros and Metadata</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Announcing Winners of Free Tickets for Intro to Ruby Course</title>
		<link>http://blog.smartlogicsolutions.com/2010/11/30/announcing-winners-of-free-tickets-for-intro-to-ruby-course/</link>
		<comments>http://blog.smartlogicsolutions.com/2010/11/30/announcing-winners-of-free-tickets-for-intro-to-ruby-course/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 21:39:14 +0000</pubDate>
		<dc:creator>Yair Flicker</dc:creator>
				<category><![CDATA[Baltimore]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[leanstartup]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=1046</guid>
		<description><![CDATA[<p>Almost a month ago we made two exciting announcements &#8211; the first was that SmartLogic will be hosting an Intro to Ruby1 course on December 10-11, 2010. The second announcement was that we would be giving away one free ticket to a local college/university student and another free ticket away to the co/founder of a [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/11/03/intro-to-ruby-on-rails-course-coming-to-baltimore/"     class="crp_title">Intro to Ruby on Rails Course Coming to Baltimore</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/02/07/rails-development-naming-conflicts-on-a-polymorphic-has_many/"     class="crp_title">Rails Development: Naming Conflicts on a Polymorphic&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/18/hang-with-smartlogic-at-the-baltimore-lean-startup-meetup/"     class="crp_title">Hang with SmartLogic at the Baltimore Lean Startup Meetup</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/26/charities-post/"     class="crp_title">8 Awesome Charities SmartLogic Employees Supported in 2012</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/20/3288-slices-the-baltimore-tech-communitys-2012-growth-measured-in-pizza/"     class="crp_title">3288 Slices: The Baltimore Tech Community’s 2012 Growth&hellip;</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2010/11/30/announcing-winners-of-free-tickets-for-intro-to-ruby-course/">Announcing Winners of Free Tickets for Intro to Ruby Course</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Almost a month ago we made two exciting announcements &#8211; the first was that <a href="http://www.smartlogicsolutions.com/">SmartLogic</a> will be <a href="http://blog.smartlogicsolutions.com/2010/11/03/intro-to-ruby-on-rails-course-coming-to-baltimore/">hosting an Intro to Ruby<span style="vertical-align: super; font-size: 60%;">1</span> course</a> on December 10-11, 2010.  The second announcement was that we would be giving away one free ticket to a local college/university student and another free ticket away to the co/founder of a local startup company.</p>
<p>Well, we upped the ante and have decided to give away a total of FOUR free tickets.  We received a total of 40 submissions and were really encouraged by all of the enthusiastic responses.  Without further ado:</p>
<p><span id="more-1046"></span></p>
<ol>
<li>Brian Sierakowski &#8211; <a href="http://twitter.com/bsierakowski">@bsierakowski</a> &#8211; Managing Editor of Baltimore&#8217;s <a href="http://twitter.com/startupdigestmd" style="text-decoration: none;"><span style="color: black;">[</span><span style="color: rgb(0, 153, 0);">Startup</span><span style="color: black;">Digest]</span></a><span style="vertical-align: super; font-size: 60%;">2</span>, founder of CahootsApp and eCommunications &#038; Office Manager at <a href="http://www.gbtechcouncil.org/">Greater Baltimore Tech Council</a>.</li>
<li>Paul Kauders &#8211; <a href="http://twitter.com/pkauders">@pkauders</a> &#8211; founder of <a href="http://splitgear.com/">SplitGear</a>, a Baltimore-based company hoping &#8220;to make community based sharing of equipment the norm.&#8221;</li>
<li>Leela S. &#8211; a student at Towson University.  Leela has &#8220;never won anything before, so this would be a real treat.&#8221;  Well, there you go.</li>
<li>Eric Oestrich &#8211; <a href="http://twitter.com/EricOestrich">@EricOestrich</a> and <a href="https://github.com/oestrich/">oestrich on github</a> &#8211; a student at Towson University that participated in the debut of the <a href="http://baltimorehackathon.com">Baltimore Hackathon</a>.</li>
</ol>
<p>We&#8217;ll contact the winners shortly.</p>
<p>If you didn&#8217;t win: <a href="http://jumpstartlab.com/trainings/5-ruby-baltimore">buy a ticket</a> &#8211; or &#8211; stay tuned!  More announcements to follow.</p>
<p>Thanks to everyone that helped us spread the word.  If you&#8217;re interested in hearing what else we&#8217;re up to then please <a href="http://twitter.com/smartlogic">follow us on twitter</a>.</p>
<div style="font-size:smaller;"><span style="vertical-align: super; font-size: 60%;">1</span>&nbsp;In the original blog post I mistakenly called it an &#8220;Intro to Ruby on Rails course&#8221; &#8211; it&#8217;s actually just &#8220;Intro to Ruby&#8221; &#8211; the Rails course is a follow on.  I regret the error; my bad.<br/><span style="vertical-align: super; font-size: 60%;">2</span>&nbsp;I really, really hope I got the formatting of that correct.</div>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/11/03/intro-to-ruby-on-rails-course-coming-to-baltimore/"     class="crp_title">Intro to Ruby on Rails Course Coming to Baltimore</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/02/07/rails-development-naming-conflicts-on-a-polymorphic-has_many/"     class="crp_title">Rails Development: Naming Conflicts on a Polymorphic&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/18/hang-with-smartlogic-at-the-baltimore-lean-startup-meetup/"     class="crp_title">Hang with SmartLogic at the Baltimore Lean Startup Meetup</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/26/charities-post/"     class="crp_title">8 Awesome Charities SmartLogic Employees Supported in 2012</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/20/3288-slices-the-baltimore-tech-communitys-2012-growth-measured-in-pizza/"     class="crp_title">3288 Slices: The Baltimore Tech Community’s 2012 Growth&hellip;</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2010/11/30/announcing-winners-of-free-tickets-for-intro-to-ruby-course/">Announcing Winners of Free Tickets for Intro to Ruby Course</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2010/11/30/announcing-winners-of-free-tickets-for-intro-to-ruby-course/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Testing AJAX with Test::Unit</title>
		<link>http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/</link>
		<comments>http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 19:58:17 +0000</pubDate>
		<dc:creator>Nick Gauthier</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=979</guid>
		<description><![CDATA[<p>If you want real end-to-end testing of a page with functioning AJAX, use Selenium. But I was interested in doing just a bit of JS speccing to make sure that the AJAX routes I called worked and that the data that came back fit the JS that I had written. So, I figured with a [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/10/26/testpilot-rails-integration-testing-pattern/"     class="crp_title">TestPilot &#8211; Rails Integration Testing Pattern</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/08/20/testing-pdf-content-with-capybara/"     class="crp_title">Testing PDF Content with Capybara</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/"     class="crp_title">Using RSpec Macros and Metadata</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/12/api-versioning-3-ways-to-architect-your-api-to-handle-versioned-requests/"     class="crp_title">API Versioning: 3 Ways to Architect Your API to Handle&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/"     class="crp_title">cURLin’ for Docs</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/">Testing AJAX with Test::Unit</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>If you want real end-to-end testing of a page with functioning AJAX, use Selenium. But I was interested in doing just a bit of JS speccing to make sure that the AJAX routes I called worked and that the data that came back fit the JS that I had written.</p>
<p>So, I figured with a little <a href="http://github.com/jnicklas/capybara">capybara</a> and a little <a href="http://github.com/cowboyd/therubyracer">therubyracer</a>, I could test my javascript with real route calls. Let&#8217;s check it out.<br />
<span id="more-979"></span></p>
<p>The Javascript I want to test:</p>
<pre class="wp-code-highlight prettyprint">var dataObject = {};
var getRemoteData = function() {
  $.getJSON(&#039;/remote_path.json&#039;, function(data) {
    dataObject = $.parseJSON(data);
  });
}
</pre>
<p>We will pretend that hitting /remote_path.json returns the following response in JSON:</p>
<pre class="wp-code-highlight prettyprint">
{ &quot;my_information&quot;: &quot;my response data&quot; }
</pre>
<p>I want to test:</p>
<ol>
<li>That /remote_path.json is accessible and returns information</li>
<li>That dataObject is populated with a Javascript Object containing the params I pass down</li>
</ol>
<p>Here is my commented testing code:</p>
<pre class="wp-code-highlight prettyprint">
  test &#039;get some information via ajax&#039; do
    # Create a new JS Context. :with =&gt; self means that
    # the global namespace is the current context
    js = V8::Context.new(:with =&gt; self)

    # Load up our JS file
    js.load(File.join(Rails.root, &#039;public&#039;, &#039;javascripts&#039;, &#039;application.js&#039;))

    # Define a mock method for getting JSON data
    def getJSON(url, callback)
      # When the JS wants some data, get it for real w/ capybara
      visit url
      # And call the JS function passed in (ruby =&gt; js)
      callback.call(page.body)
    end

    js.eval %{
      /* Mock out jQuery */
      var $ = {};

      /* Setup the mock in the right place (JS =&gt; ruby) */
      $.getJSON = getJSON; 

      /* Mock out jquery parseJSON to call ruby JSON.parse
         Since the args are the same, it is plug and play!
         (JS =&gt; ruby) */
      $.parseJSON = JSON.parse;

      /* Trigger our JS */
      getRemoteData();

      /* Assert what we expect (JS =&gt; ruby) */
      assert_equal(&quot; &quot;, dataObject.access_key);
    }
  end
</pre>
<p>This is not an example of an incredibly useful test, but I found the ability to bind back and forth easily between ruby and javascript to be <strong>mind-blowingly incredible</strong>. I mean, look at that last line, where I call assert and pass a javascript object to it!</p>
<p>Huge thanks to <strong><a href="http://github.com/cowboyd">Charles Lowell (cowboyd)</a></strong> for his hard work on <a href="http://github.com/cowboyd/therubyracer">therubyracer</a>.</p>
<p>Enjoy the weekend! </p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/10/26/testpilot-rails-integration-testing-pattern/"     class="crp_title">TestPilot &#8211; Rails Integration Testing Pattern</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/08/20/testing-pdf-content-with-capybara/"     class="crp_title">Testing PDF Content with Capybara</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/"     class="crp_title">Using RSpec Macros and Metadata</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/12/api-versioning-3-ways-to-architect-your-api-to-handle-versioned-requests/"     class="crp_title">API Versioning: 3 Ways to Architect Your API to Handle&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/"     class="crp_title">cURLin’ for Docs</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/">Testing AJAX with Test::Unit</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nick&#8217;s Highlights from Windy City Rails</title>
		<link>http://blog.smartlogicsolutions.com/2010/09/11/nicks-highlights-from-windy-city-rails/</link>
		<comments>http://blog.smartlogicsolutions.com/2010/09/11/nicks-highlights-from-windy-city-rails/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 23:07:21 +0000</pubDate>
		<dc:creator>Nick Gauthier</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=972</guid>
		<description><![CDATA[<p>I attended and spoke at Windy City Rails. I tried to take more notes this time. Out of 6 talks an lightning talks, I have ~500 lines of notes. Enjoy!. Jake Scrugges &#8211; Metrics Based Refactoring: What To Do With Your Code Metrics Metric-Fu is a ruby metric bundle rake metrics:all => generates a master [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/09/07/nicks-highlights-from-ruby-hoedown/"     class="crp_title">Nick&#8217;s Highlights from Ruby Hoedown</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/"     class="crp_title">Using RSpec Macros and Metadata</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/12/how-user-stories-help-software-developers-know-what-the-___-to-do/"     class="crp_title">How User Stories Help Software Developers Know What The ___&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/11/28/using-pull-requests-to-improve-code-quality-process-and-skills/"     class="crp_title">Using Pull Requests to Improve Code Quality, Process, and&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/12/api-versioning-3-ways-to-architect-your-api-to-handle-versioned-requests/"     class="crp_title">API Versioning: 3 Ways to Architect Your API to Handle&hellip;</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2010/09/11/nicks-highlights-from-windy-city-rails/">Nick&#8217;s Highlights from Windy City Rails</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I attended and spoke at Windy City Rails. I tried to take more notes this time. Out of 6 talks an lightning talks, I have ~500 lines of notes. Enjoy!.<br />
<span id="more-972"></span></p>
<h2>Jake Scrugges &#8211; Metrics Based Refactoring: What To Do With Your Code Metrics</h2>
<ul>
<li>Metric-Fu is a ruby metric bundle</li>
<li>rake metrics:all<br />
=> generates a master report of a bunch of metrics</li>
<li>There are a lot of metrics, where do you start?</li>
<li>Everyone wants to refactor, but where do you start?</li>
<li>Flay
<ul>
<li>Analyzes code duplication</li>
<li>Finds violations of DRY</li>
<li>Solutions: Extract Method, Modules, etc.</li>
<li>Single Responsibility Principle</li>
</ul>
</li>
<li>Churn
<ul>
<li>Looks through your commits to see what stuff changes the most</li>
<li>Files that change the most are &#8220;God Objects&#8221; &#8211; stuff that does everything</li>
<li>Any time anything changes, the God Object has to change</li>
<li>Bad smell, should be smaller objects with greater focus</li>
<li>Tells you where your most volatile code is</li>
</ul>
</li>
<li>Rcov
<ul>
<li>Main reason metric-fu blows up</li>
<li>Problem is, metric-fu is mostly static analysis, but rcov is running the code</li>
<li>Rcov runs the test suite, which is sometimes hard to get working</li>
<li>Rcov makes sure your coverage is good where it needs to be (most complicated and volatile code)</li>
<li>Writing tests for the sake of coverage is harmful</li>
<li>Write tests when you are in the code and you understand it (not a week later, &#8220;let&#8217;s write some tests!&#8221;)</li>
</ul>
</li>
<li>Flog and Saikuro
<ul>
<li>Both are complexity management</li>
<li>Saikuro (pronounced cyclo as in cyclomatic complexity) measures cyclomatic complexity</li>
<li>Saikuro = number of paths through the code, and cyclomatic complexity is exponential in growth</li>
<li>Flow looks at branching, but uses ABC</li>
<li>Assignments</li>
<li>Branches</li>
<li>Calls</li>
<li>Flog generates a score based on ABC</li>
<li>&lt; 20 is good, 20-40 is a grey area, 40-60 is a warning, 60+ is FIX IT!</li>
<li>How do you fix it?</li>
<li>Extract method</li>
<li>Missing object (need a new class to handle this behavior)</li>
<li>If that doesn&#8217;t work, re-architect</li>
<li>Seriously, you don&#8217;t need complicated methods in <em>any</em> app</li>
<li>Director method: calls a couple of sub methods, doesn&#8217;t do much actual work</li>
<li>Take care not to over-factor. If you are a guest in the code, just clean it<br />
as necessary. You don&#8217;t need to fully re-organize.</li>
</ul>
</li>
<li>Reek, Roodi, and RailsBestPractices
<ul>
<li>Reek: if it could possibly be a problem, I&#8217;ll tell you</li>
<li>Roodi: only if I&#8217;m really sure, I&#8217;ll tell you</li>
<li>RailsBestPractices: just rails stuff</li>
<li>All parse the code and look for design problems</li>
<li>Very ambitious! Code trying to understand what you&#8217;re trying to do</li>
<li>Awesome because you can look up the definition of the problem and see how to fix it.</li>
<li>Trouble because it&#8217;s a machine trying to identify human problems, which is difficult</li>
</ul>
</li>
<li>Continuous Integration
<ul>
<li>Metric-fu on your code</li>
<li>Most CI&#8217;s allow you to have artifacts for a build</li>
<li>J.S. runs his nightly at midnight</li>
</ul>
</li>
<li>Pay attention to trends over time
<ul>
<li>Is your refactoring making things better?</li>
<li>Did the last feature skyrocket flay scores?</li>
<li>How is the influx of new developers affecting the code quality</li>
<li>Did the highly paid consultants produce good work?</li>
</ul>
</li>
<li>Take metrics as advice (not law)
<ul>
<li>It is a tool, use it intelligently (like a GPS system)</li>
<li>Don&#8217;t let a manager get in charge of this</li>
<li>Up to you and your team to establish conventions and stick to them</li>
</ul>
</li>
<li>Coming soon
<ul>
<li>Fail the build on bad metrics</li>
<li>Resisted for a while because there may be false negatives</li>
<li>Failing a build is a serious incident, needs to mean something</li>
<li>Metrics are not as definitive as tests</li>
</ul>
</li>
<li>Coming later (and/or soonish)
<ul>
<li>Meta metrics</li>
<li>Imagine a report that flagged a method as having high churn, poor coverage, and high complexity</li>
<li>This method is trouble waiting to happen</li>
<li>No so easy to write this feature</li>
<li>J.S. needs help!</li>
<li>Need to re-architect the system to understand classes and methods, not just lines of code</li>
</ul>
</li>
<li>Questions
<ul>
<li>Can you use other source control?</li>
<li>I think so, check out the churn gem</li>
<li>How is the performance?</li>
<li>Not great, but you only have to run it once a day</li>
<li>If you don&#8217;t have test coverage, now what?</li>
<li>start w/ rehacktoring (refactoring w/o tests)</li>
<li>do that until you understand it enough to write tests</li>
<li>write tests!</li>
<li>What about front-end heavy stuff? Javascript?</li>
<li>No idea! These are all ruby tools. Maybe there are JS tools out there?</li>
<li>You should test your javascript. Sapphire is the &#8220;new hot thing&#8221;.</li>
</ul>
</li>
</ul>
<h2>John McCaffrey &#8211; Analyzing and Improving the Performance of your Rails Application</h2>
<ul>
<li><a href="http://railsperformance.blogspot.com">http://railsperformance.blogspot.com</a></li>
<li>O(n) queries is bad</li>
<li>Code he refactored went from 2811 to 17 queries per action</li>
<li>Leverage: small amounts of work for large amounts of value</li>
<li>Delay directly correlates w/ loss of revenue
<ul>
<li>Bing: 1s = 2.8% decrease, 2s = 4.3%</li>
<li>Google: users that had a delay for a short period of time, actually searched less even after the delay was removed.</li>
<li>Yahoo: added a 400ms delay and users bailed before the pages even loaded</li>
<li>Shopzilla: reduced delay from 6s to 1.2s.</li>
<li>Conversion rate rate up 7-12%</li>
<li>Saved infrastructure costs by 50%</li>
<li>Release cost decreased</li>
</ul>
</li>
<li>Fred Wilson (VC): Speed is #1 of the 10 golden principles of successful web apps</li>
<li>So where to begin?</li>
<li>Anti-patterns:
<ul>
<li>&#8220;Scalability can be sprinkled on later&#8221;</li>
<li>Guessing, not testing</li>
<li>Ad-hoc, unstructured</li>
</ul>
</li>
<li>&#8220;Premature optimization is the root of all evil&#8221; &#8211; Donald Knuth</li>
<li>&#8220;If you can not measure it, you can not improve it&#8221; &#8211; Lord Kelvin</li>
<li>Measure</li>
<li>Repeatable tests</li>
<li>Isolate your changes</li>
<li>(Scientific method!)</li>
<li>Visibility is important for working on a team</li>
<li>Response time = latency</li>
<li>Requests per second = throughput</li>
<li>Load, utilization, scalability, throughput, concurrency, capacity</li>
<li>Performance != Scalability
<ul>
<li>Performance = response time</li>
<li>Scalability = ability to grow to more requests</li>
<li>Adding more workers will not improve latency</li>
</ul>
</li>
<li>Twitter: dynamic html = 250ms, but 3369ms is static assets
<ul>
<li>Don&#8217;t waste your time on the 250ms, go for the big slow chunks</li>
</ul>
</li>
<li>Walmart: 3 redirects, 388ms dynamic, 4580ms static content</li>
<li>Use YSlow
<ul>
<li>Do less work</li>
<li>Distribute content</li>
<li>Cache</li>
<li>Compress</li>
<li>Fight queued work</li>
</ul>
</li>
<li>Google page speed
<ul>
<li>similar to yslow</li>
<li>includes paint events</li>
<li>separates out ads and trackers from your site</li>
<li>&#8220;how fast it feels&#8221;</li>
<li>If the web is faster, they make more money</li>
</ul>
</li>
<li><a href="http://www.showslow.com/">http://www.showslow.com/</a> tracks your site (or competitors, will check every 24h)</li>
<li><a href="http://webpagetest.com/">http://webpagetest.com/</a> runs page speed and yslow for you, and show progressive rendering</li>
<li><a href="http://gtmetrix.org">http://gtmetrix.org</a></li>
<li><a href="http://zoompf.com">http://zoompf.com</a> </li>
<li><a href="http://loadimpact.com">http://loadimpact.com</a> </li>
<li><a href="http://gomez.com">http://gomez.com</a> </li>
<li>See Greg Pollack&#8217;s Scaling Rails series</li>
<li>Majority of the Alexa top 1,000 sites don&#8217;t do even the easiest things
<ul>
<li>42% don&#8217;t gzip</li>
<li>44% >2 css files</li>
<li>56% serve css from a cookied domain</li>
<li>62% don&#8217;t minify</li>
</ul>
</li>
<li>Gzip is the simplest and smartest thing you can do</li>
<li>Minify js
<ul>
<li>jsmin, yuicompressor, sprockets</li>
<li>Asset packager</li>
<li>javascript_include_tag :cache => &#8220;cache/all&#8221;</li>
</ul>
</li>
<li>Sprited images</li>
<li>Spriteme.org</li>
<li>JqueryUI gives you sprited images</li>
<li>Image optimization
<ul>
<li>Smush.it</li>
</ul>
</li>
<li>Expires and browser caching</li>
<li>Set a far-future expire to tell the browser it can cache it</li>
<li>Combined with a query string lets you version a file</li>
<li>Rails Caching: make the static parts of your dynamic content cached</li>
<li>railslab.newrelic.com</li>
<li>request-log-analyzer</li>
<li>Rack::Bug</li>
<li>NewRelic</li>
<li>Scout</li>
<li>Get on the heroku mailing list / blog to learn about scaling issues</li>
<li>Apache bench</li>
<li>httperf</li>
<li>jmeter</li>
<li>Database issues
<ul>
<li>Bad queries</li>
<li>Not utilizing explain</li>
<li>Inadequate indexes</li>
<li>N+1 queries</li>
<li>Selecting more data than needed</li>
<li>Inconsistent queries for the same data</li>
<li><a href="http://github.com/dsboulder/query_reviewer/">http://github.com/dsboulder/query_reviewer/</a> </li>
</ul>
</li>
<li><a href="http://github.com/eladmeidar/rails_indexes">http://github.com/eladmeidar/rails_indexes</a>
<ul>
<li>rake tasks to find missing indexes</li>
<li>columns that need to be sorted</li>
<li>lookup fields</li>
<li>columns used in a group-by</li>
</ul>
</li>
<li><a href="http://github.com/samdanavia/ambitions_query_indexer">http://github.com/samdanavia/ambitions_query_indexer</a> haven&#8217;t tried it yet, check it out</li>
<li><a href="http://github.com/sdsykes/slim_scrooge">http://github.com/sdsykes/slim_scrooge</a> Instruments your code and looks for bad &#8220;select *&#8221;</li>
<li>Aman Gupta</li>
<li>Joe Damato</li>
<li><a href="http://timetobleed.com/">http://timetobleed.com/</a></li>
<li><a href="http://memprof.com/">http://memprof.com/</a> </li>
<li>yajl-ruby for C++ extension json parsing</li>
<li>Ruby 1.9 for massive performance</li>
</ul>
<h2>Kevin Gisi &#8211; It&#8217;s time to repay your debt</h2>
<ul>
<li>We&#8217;re leveraging an awesome framework and language, and it&#8217;s time to give back</li>
<li>Releasing gems is easy</li>
<li>(Showing some code to refactor out into a gem)</li>
<li>Ruby community has an incredible (and overwhelming) amount of choice</li>
<li>Choice is good and important</li>
<li>There exist incomplete and unstable solutions</li>
<li>You should release a &#8220;product&#8221;, not an incomplete solution
<ul>
<li>Aesthetics</li>
<li>Utility</li>
</ul>
</li>
<li>Agile: Do the bare minimum to get something delivered
<ul>
<li>(Nick: isn&#8217;t it to embrace change?)</li>
</ul>
</li>
<li>Delivered: coded, deployed, supported, tested, extensible, usable by the client</li>
<li>Treat open source libraries and client deliverables</li>
<li>The Lazy programmer&#8217;s manifesto
<ul>
<li>I want to write code once</li>
<li>I want to be able to read code w/o docs</li>
<li>I want to be able to rely on libraries</li>
<li>I wants to use adaptable solutions for numerous problems</li>
<li>I want to always be working on something new</li>
</ul>
</li>
<li>Idea filtering
<ul>
<li>To share</li>
<li>business value</li>
<li>practical use</li>
<li>To learn</li>
<li>no requirements</li>
<li>don&#8217;t post it publicly (community does not value your stupid web framework)</li>
</ul>
</li>
<li>Testing
<ul>
<li>We all say we do it (it&#8217;s time to start)</li>
<li>RSpec and Cucumber are easy to set up</li>
<li>Design verification tool</li>
</ul>
</li>
<li>(really turning into a rant at this point)</li>
<li>Extensible
<ul>
<li>Write clean code (don&#8217;t post spikes)</li>
<li>Peer review</li>
<li>Follow the Unix philosophy: do one thing really well</li>
<li>Leverage other gems</li>
</ul>
</li>
<li>Documentation
<ul>
<li>Who&#8217;s looking at your code?</li>
<li>RDoc, YARD, etc</li>
<li>Getting Started</li>
<li>Blog post!</li>
</ul>
</li>
<li>Supported
<ul>
<li>If you can&#8217;t maintain your app, don&#8217;t post it</li>
</ul>
</li>
<li>Be Honest
<ul>
<li>Hand over the reigns if you can&#8217;t support it</li>
<li>Be a net positive</li>
<li>Don&#8217;t announce things that aren&#8217;t done</li>
</ul>
</li>
<li>If you have to
<ul>
<li>Put it in a limited venue</li>
<li>Add a disclaimer</li>
</ul>
</li>
<li>The internet doesn&#8217;t filter bad ideas very well
<ul>
<li>It does make things hard to do if they don&#8217;t work well</li>
<li>Having enough eyes</li>
</ul>
</li>
<li>&#8220;Ruby treats you like a grown up programmer&#8221; &#8211; Matz</li>
<li>What happens when grown-ups have too much fun?</li>
<li>How to be a good parent
<ul>
<li>Avoid sensory overload</li>
<li>Sometimes spoon feed</li>
<li>Remember you&#8217;re used to the status quo</li>
<li>Be a mentor <a href="http://railsmentors.org">http://railsmentors.org</a> </li>
<li>Provide solutions to problems, not blocks of code</li>
</ul>
</li>
<li>(I wish this was a &#8220;how to do a good job&#8221; and not &#8220;you suck, stop sucking&#8221;. I think he wants to be the king of the rubygems app store)</li>
</ul>
<h2>Lightning Talks</h2>
<h3>Micah Martin &#8211; Limelight</h3>
<ul>
<li>Tool to build GUIs in ruby</li>
<li>Built a gui calculator in 5 minutes</li>
</ul>
<h3>Sean Scofield &#8211; The Awesome Power of Rails Engines</h3>
<ul>
<li>Engines make it easy for frameworks to be built on top of rails</li>
<li>Engine is a complete application that can provide the stuff rails apps provide</li>
<li>app directory is auto loaded</li>
<li>You can supply models, views, controllers in your engine</li>
<li>You can override locale by dropping it in app</li>
<li>Engines extending engines, for example Spree</li>
<li>Bundler ties it all together</li>
</ul>
<h3>Mike Buselli &#8211; Brush::Pipeline</h3>
<ul>
<li>Running external OS commands</li>
<li>sys
<ul>
<li>lower level, more convenient for specific takss</li>
<li>chaining commands</li>
</ul>
</li>
<li>pipeline
<ul>
<li>better at chaining commands</li>
<li>pipeline ['head', 'README'], ['tail', '-n2']</li>
<li>Each part of the pipeline can run in different directories</li>
<li>stderr and stdout redirection</li>
<li>argv[0] renaming</li>
<li>restrict access to open files</li>
<li>Works great on POSIX including cygwin</li>
</ul>
</li>
</ul>
<h3>Chris Hallendy and Nick Lewis &#8211; Realtime Apps</h3>
<ul>
<li>Demo of node.js &lt;-> Redis &lt;-> Rails</li>
</ul>
<h3>Joe Fiorini (sp?) &#8211; Web Katas</h3>
<ul>
<li>Problem: web developers don&#8217;t know http</li>
<li>Rails is big and awesome, but it&#8217;s hard to troubleshoot</li>
<li>It allows us to ignore how http works.</li>
<li>Code Katas <a href="http://bit.ly/codekatas">http://bit.ly/codekatas</a> </li>
<li>No-framework webapp development (Rack) to learn how http cookies work</li>
<li>More Katas
<ul>
<li>Auth token</li>
<li>See Other response status</li>
<li>Move permanently</li>
<li>Session state handling</li>
<li><a href="http://bit.ly/webkatas">http://bit.ly/webkatas</a></li>
</ul>
</li>
</ul>
<h3>Jim Remsik &#8211; Improv: Comedy to Coding</h3>
<ul>
<li>Programming is a people problem</li>
<li>You write code for other people</li>
<li>We use ruby because it is expressive and easy for others to read and maintain</li>
<li>Improv after-hours at hashrock</li>
<li>Yes-and, drop your preconcieved notions at the door</li>
<li>Support your team</li>
</ul>
<h3>Malcolm Arnold &#8211; Ruby Nuby</h3>
<ul>
<li>Brand new social movement dedicated to teaching ruby on rails to disadvantaged youths</li>
<li>Maximize social good by spreading ruby</li>
</ul>
<h3>Praveen Alavilli &#8211; Monetizing your apps</h3>
<ul>
<li>&#8220;chase your dream, money will follow&#8221;</li>
<li>Still a mystery to a lot of people how the money follows</li>
<li>Indirect
<ul>
<li>advertising</li>
<li>offers</li>
<li>referalls</li>
</ul>
</li>
<li>Direct
<ul>
<li>e/m-commerce</li>
<li>freemium</li>
<li>causium (donate money to a cause)</li>
<li>pay as you use</li>
<li>free to use pay for service</li>
<li>premium content</li>
<li>digital goods</li>
<li>virtual currency</li>
<li>subscriptions</li>
</ul>
</li>
<li>Challenge: apply these models to your use cases</li>
<li>Gateway (i.e. Payflow, Authorize.net)</li>
<li>Checkout (Google, PayPal, Amazon)</li>
<li>Platform (PayPal, Amazon)</li>
<li>Also services on top (Chargify, Spreedly, Freshbooks)</li>
<li>Choose one that works the best</li>
<li>Your users need to be able to pay somehow, should not be hard to pay</li>
<li>PCI compliance for charging directly</li>
<li>secure and privacy enabling</li>
<li>Adaptive Payments API</li>
</ul>
<h2>Ryan Singer &#8211; Weaving Design and Development</h2>
<ul>
<li>UI Design and Programming, working together</li>
<li>(telling a story about working with a startup and doing design for them)</li>
<li>Designer says &#8220;let&#8217;s change this button&#8221; while pairing with dev, dev makes the change instantly</li>
<li>XP is focused on delivery</li>
<li>In XP, feedback loops are not as important</li>
<li>Feedback can be difficult if you are purely focused on delivery</li>
<li>Shared code base, code runs on designers computers</li>
<li>Avoid the designer w/ folders full of PSDs and static content
<ul>
<li>Becomes a spec, then the dev has to implement it</li>
</ul>
</li>
<li>Static files are like spikes, for exploration and experimentation</li>
<li>Actual changes need to keep up with the codebase</li>
<li>At 37Signals, no sync problem, because the designers are working in the code base</li>
<li>HAML and Mustache are out, because designers can&#8217;t deal with them</li>
<li>Templates with logic</li>
<li>Avoid helpers writing HTML and presenters writing html</li>
<li>Start together, don&#8217;t bring the designers in late, or the developers in late</li>
<li>Architecture before design leaves UX to too late in the process</li>
<li>Designers starting everything before programmers start, it may be impossible or impractical to code</li>
<li>P&amp;D decide on domain language and basic model</li>
<li>P stub models, controllers, routes, and templates</li>
<li>D few days lead on designing and building templates</li>
<li>Simultaneous
<ul>
<li>P design and build models, controllers, routes, helpers, dynamic templates</li>
<li>D design and build templates and helpers</li>
<li>Repeat this process continuously</li>
</ul>
</li>
<li>Share the codebase</li>
<li>All views are in templates w/ logic (ERB or similar, not HAML)</li>
<li>Start together for domain language and models for communication</li>
<li>constantly committing to the same codebase</li>
<li>Train designers in git and ruby and other things</li>
<li>Designers are motivated to learn so they can make changes directly: it gives them more power</li>
</ul>
<h2>Nick Gauthier &#8211; Grease your Suite</h2>
<h2>Les Hill and Jim Remsik &#8211; Sustainably Awesome</h2>
<ul>
<li>Comfortable and productive environment is crucial</li>
<li>sustainable pace is important. 40h weeks.</li>
<li>cargo culting</li>
<li>Pet friendly</li>
<li>The point is not to do what we do, but to recognize our goals. Don&#8217;t cargo cult these tips!</li>
<li>Casual</li>
<li>No Micromanagement</li>
<li>Don&#8217;t penny pinch</li>
<li>Keep a budget and spend it wisely</li>
<li>$400 per week grocery budget</li>
<li>No death marches</li>
<li>No meetings (except daily standup and project standup and monthly company status meeting)</li>
<li>No hierarchy</li>
<li>No future-proofing (software and organizational practices)</li>
<li>What do you do when a developer rm -rfs?
<ul>
<li>No sudo for devs?</li>
<li>3 manager approval before running a script?</li>
<li>Develop a backup solution and a common machine image?</li>
</ul>
</li>
<li>&#8220;Process is an embedded reaction to prior stupidity&#8221; &#8211; Clay Shirky</li>
<li>A project came along that needed work done ASAP</li>
<li>Crafted an MVP and built it without changing their process</li>
<li>The MVP did not overlap with their mockups and specs</li>
<li>Started with story cards and team boards</li>
<li>Moved to pivotal tracker</li>
<li>Tim Pope had a suggestion about how to work stories in pivotal that worked really well</li>
<li>Always open to try new things and experiment with new processes</li>
<li>Enjoy your work</li>
<li>Don&#8217;t hire people you don&#8217;t like, or without passion</li>
<li>Hire smart people that get things done</li>
<li>Must be a great cultural fit</li>
<li>Hiring
<ul>
<li>phone screening</li>
<li>week long &#8220;test drive&#8221;</li>
<li>gems you use are important</li>
<li>editors you use are important</li>
<li>test driven (and test-first) style</li>
<li>hang out after hours to check for a cultural fit</li>
</ul>
</li>
<li>&#8220;If I&#8217;m not saying &#8216;hell yeah!&#8217; about something, then I say no&#8221; &#8211; Derek Sivers</li>
<li>Firing: due to lack of communication or mistake, probably on both sides</li>
<li>Fire fast, but with compassion</li>
<li>Approach building a team the same way you build software</li>
</ul>
<h2>Yehuda Katz &#8211; Rails 3</h2>
<ul>
<li>Rails core family is getting bigger</li>
<li>Rails 2 was very intertwined</li>
<li>Broke things up cleanly</li>
<li>Instead of Railties being a big glue layer w/ initialization stack, it became a small part or Rails 3 and specifies the framework for applications and engines</li>
<li>Engines are special plugins now that inherit from Railties</li>
<li>Applications inherit from Engines</li>
<li>Railtie lets you add features to rails</li>
<li>Railties provide a series of Hooks</li>
<li>Inheriting from Railtie doesn&#8217;t do anything, but it has lots of functionality</li>
<li>Railtie lets you configure the application, such as pull in generators</li>
<li>Rake Tasks are another Railtie Hook
<ul>
<li>Extra stuff you want to have happen in rake, and not on boot<br />
rake_tasks do<br />
load &#8220;my_stuff/my_tasks.rake&#8221;<br />
end</li>
</ul>
</li>
<li>before_configuration hook = right inside Rails::Application, before user stuff happens, but you know about rails root and stuff.</li>
<li>config.to_prepare : in dev, run every time, in production, run once (i.e. compass template compilation)</li>
<li>Framework loading: ActiveSupport.on_load = i.e. when action mailer loads, monkey patch in some code. Then you don&#8217;t have to try to detect ActionMailer, you just say, when it loads do stuff.</li>
<li>Don&#8217;t do if(defined) because it depends on order</li>
<li>Decouple via Instrumentation</li>
<li>ActiveSupport::Notifications.instrument(&#8220;receive.action_mailer&#8221;) do |payload|; #callback; end</li>
<li>Worth Noting: we worked really hard making things mostly backwards compatible</li>
<li>The old way may appear to work, even if it doesn&#8217;t</li>
<li>AbstractController is decoupled from ActionController</li>
<li>ActionDispatch = Rack++</li>
<li>ActiveModel lets other persistence engines connect to ActionController. Only need to support ~5 methods</li>
<li>Tight Integration without Coupling</li>
<li>Integration first, decouple later</li>
<li>Migrating:
<ol>
<li>Install Rails 2.3.9.</li>
<li>bundler</li>
<li>rails_xss</li>
<li>Deprecations &#8211; get the count to 0</li>
<li>Upgrade</li>
<li>Deprecations again!</li>
</ol>
</li>
<li>Helpers should call partials, not generate html</li>
<li>Rails 3.1: We&#8217;re not burned out!
<ul>
<li>Engines</li>
<li>@drogus did all the engine work</li>
<li>Engine Migrations</li>
<li>Static assets (w/o copying). Leave it in the engine, and Rack::Static will find it</li>
<li>Self-contained engine</li>
<li>Built-in http caching, to get away from filesystem caching</li>
<li>fresh_when? calculates an etag from the post and returns 304 if not fresh</li>
<li>caching at the browser layer</li>
<li>etag can be based on an AR object</li>
<li>If you have Varnish, you can turn off Rack::Cache and fresh_when will be built in</li>
<li>This also means that when you turn on Akamai, you already have all the code that makes it work well</li>
<li>Enables Edge-Cached SCSS</li>
<li>Rack::Cache is like Memcache, but uses HTTP semantics</li>
<li>Assets </li>
<li>ERB == SCSS (I have content that needs to be processed before it hits the browser) </li>
<li>Solution: build in compilation pipeline</li>
<li>app.css.scss (like app.html.erb)</li>
<li>posts/index.css.scss</li>
<li>Treats CSS the same as HTML for templating</li>
<li>SCSS template handler => http response => rack::cache</li>
<li>It just works w/ varnish and the like</li>
<li>Spriting</li>
<li>Compass and lemonade are merging w/ a new sprite api</li>
<li>Put all your images in images/sprites/ 1, 2, 3, 4, .png</li>
<li>Lets you include all the images as a sprite</li>
<li>Gives you a bunch of css classes to use the sprites</li>
<li>SCSS can take CSS, and then add stuff in</li>
<li>You don&#8217;t need imagemagick, there is a pure ruby PNG spriting library</li>
<li>AutoFlush &#8211; it&#8217;s cool, read his blog, running out of time</li>
<li>flush content to the browser as it is rendering</li>
<li>Tradeoffs you have to deal with, like exceptions</li>
<li>Browser can be working on your CSS while you are doing SQL queries</li>
<li>Keep content_for at the top of the template</li>
<li>Exceptron</li>
<li>Stolen from merb</li>
<li>ExceptionsController to render and take actions when exceptions happen</li>
<li>Performance</li>
<li>We did pretty well in 3.0, definitely some trouble spots</li>
<li>More mechanisms for performance</li>
<li>Big Arel rewrite for 3.1</li>
<li>Possible to get to 2x faster over 3.0</li>
</ul>
</li>
</ul>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/09/07/nicks-highlights-from-ruby-hoedown/"     class="crp_title">Nick&#8217;s Highlights from Ruby Hoedown</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/"     class="crp_title">Using RSpec Macros and Metadata</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/12/how-user-stories-help-software-developers-know-what-the-___-to-do/"     class="crp_title">How User Stories Help Software Developers Know What The ___&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/11/28/using-pull-requests-to-improve-code-quality-process-and-skills/"     class="crp_title">Using Pull Requests to Improve Code Quality, Process, and&hellip;</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/12/12/api-versioning-3-ways-to-architect-your-api-to-handle-versioned-requests/"     class="crp_title">API Versioning: 3 Ways to Architect Your API to Handle&hellip;</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2010/09/11/nicks-highlights-from-windy-city-rails/">Nick&#8217;s Highlights from Windy City Rails</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2010/09/11/nicks-highlights-from-windy-city-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nick&#8217;s Highlights from Ruby Hoedown</title>
		<link>http://blog.smartlogicsolutions.com/2010/09/07/nicks-highlights-from-ruby-hoedown/</link>
		<comments>http://blog.smartlogicsolutions.com/2010/09/07/nicks-highlights-from-ruby-hoedown/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 13:11:46 +0000</pubDate>
		<dc:creator>Nick Gauthier</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=963</guid>
		<description><![CDATA[<p>I attended and spoke at Ruby Hoedown 2010. Below are my notes from the conference. Day One (Nuby Hoedown) David A. Black &#8211; The Well-Grounded Nuby Seven key points, with code examples Every expression evaluates to an object if statements and class definitions return objects operations are messages (==, +, etc) methods are messages (to_s) [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/08/30/nicks-highlights-from-lone-star-ruby-conf/"     class="crp_title">Nick&#8217;s Highlights from Lone Star Ruby Conf</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/09/11/nicks-highlights-from-windy-city-rails/"     class="crp_title">Nick&#8217;s Highlights from Windy City Rails</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/"     class="crp_title">Using RSpec Macros and Metadata</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/09/27/automate-away-the-pain-of-multiple-database-yml-files/"     class="crp_title">Automate Away the Pain of Multiple Database.yml Files</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/01/15/guide-to-application-development-infrastructure-pairing-and-ci-servers/"     class="crp_title">Guide to Application Development Infrastructure: Pairing and</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2010/09/07/nicks-highlights-from-ruby-hoedown/">Nick&#8217;s Highlights from Ruby Hoedown</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I attended and spoke at Ruby Hoedown 2010. Below are my notes from the conference.</p>
<p><span id="more-963"></span></p>
<h2>Day One (Nuby Hoedown)</h2>
<h3>David A. Black &#8211; The Well-Grounded Nuby</h3>
<ul>
<li>Seven key points, with code examples</li>
<li>Every expression evaluates to an object</li>
<li>if statements and class definitions return objects</li>
<li>operations are messages (==, +, etc)</li>
<li>methods are messages (to_s)</li>
<li>a[2] is equivalent to a.<a href="2"></a></li>
<li>case is really if, elsif, etc, which is really x1.===(x0), x2.===(x0), etc.</li>
<li>String === String is false! Classes define === as meaning &#8220;is the argument an instance of me&#8221;</li>
<li>Objects have lookup paths they use to find the method among their associated modules and classes</li>
<li>Super means keep searching for the next method up. Not necessarily the super class, could just be<br />
in a module that was included the most recently.</li>
<li>instance.extend(module) will include the module into that instance, not the entire class</li>
<li>every object has a singleton class that represents the instance. So the above in actually including<br />
the module into the instance&#8217;s singleton class.</li>
<li>there is always a &#8220;self&#8221;. defaults to main:Object</li>
</ul>
<h3>Kevin W. Gisi &#8211; Dynamic Ruby for Nubies</h3>
<ul>
<li>DSLs help bridge the gap between an idea and code, as a layer of abstraction</li>
<li>I got lost :-(</li>
</ul>
<h3>Lunch</h3>
<ul>
<li>Om nom nom</li>
</ul>
<h3>Nick Gauthier &#8211; The Six Ws of Testing</h3>
<ul>
<li>I think it went well. Very low on technical content but many Nubies came to talk to me afterward and said they enjoyed it. I&#8217;m sure I bored the technical folks to tears. But hey, it&#8217;s the Nuby Hoedown!</li>
</ul>
<h3>Matt Yoho &#8211; Gem Authoring and Deployment</h3>
<ul>
<li>&#8220;require&#8221; loads code once, it is smart</li>
<li>&#8220;load&#8221; loads the code without doing any checks</li>
<li>You should not &#8220;require &#8216;rubygems&#8217;&#8221; it should already be on the load path</li>
<li>Don&#8217;t use jeweler, use a real gemspec
<p>http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/</p>
<p>Unsure about this, maybe the gemspec has enough automation you don&#8217;t have to do this any more?</li>
<li>Aruba lets you write cuke specs within cuke specs. Helps with command line applications</li>
</ul>
<h3>Hack Session of DOOM</h3>
<ul>
<li>Two features and one bug on hydra!</li>
</ul>
<h3>Scott Chacon &#8211; Getting Git</h3>
<ul>
<li>http://gitref.org</li>
<li>http://progit.org</li>
<li>schacon@gmail.com (put conf name in subj when emailing questions)</li>
<li>tree -a for nice tree list of a directory</li>
<li>check out his slides for example of cool showoff styling and layout
<p>http://github.com/schacon/showoff-wrangling-git</li>
<li>Email him to ask what he uses for his diagrams and highlights (backgrounds)</li>
<li>Would be really cool to allow a [dot] keyword in showoff to interpret the following graphviz code as a diagram</li>
<li>git log branchA ^branchB<br />
show commits reachable by A but not by B<br />
for example, I&#8217;m working on branch my-feature<br />
git log my-feature ^master<br />
is the stuff I&#8217;ve done that&#8217;s not in master yet</li>
<li>git branch &#8211;merged<br />
show me all branches that have been merged (safe to delete)</li>
<li>git branch &#8211;no-merged<br />
show me all branches that have not been merged</li>
</ul>
<h2>Day Two</h2>
<h3>Bryan Liles &#8211; Coding in Anger (or is that Desperation?)</h3>
<ul>
<li>Bryan Liles sings country</li>
<li>&#8220;run through the problem, take no prisoners&#8221; &#8230; &#8220;and undoubtedly do some bad things&#8221;</li>
<li>&#8220;we build straw houses&#8221;</li>
<li>&#8220;if you do it the wrong way just to get it done, you&#8217;ll get hit in the future&#8221;</li>
<li>Cargo Cult: &#8220;we&#8217;re all guilty of it&#8221; and &#8220;it&#8217;s bad&#8221;
<ul>
<li>Copy-pasting other people&#8217;s code without understanding it</li>
<li>&#8220;Copying code is not bad&#8221;</li>
<li>&#8220;It might do the right thing, but it might not be doing the right thing&#8221;</li>
<li>Read the code first</li>
<li>Respect the copyright</li>
<li>Understand what you copy</li>
<li>Don&#8217;t &#8220;copy and paste&#8221;</li>
<li>UNDERSTAND WHAT YOU COPY</li>
</ul>
</li>
<li>&#8220;It takes a big man to understand humility&#8221; </li>
<li>Break a task down and constantly refine task estimates</li>
<li>A desperate coder is a bad coder</li>
</ul>
<h4>bonus lightning talk: You are your own sales person</h4>
<ul>
<li>you are the product</li>
<li>you are the salesperson</li>
</ul>
<h3>Justin Love &#8211; You already use Closure</h3>
<ul>
<li>Block based programming</li>
<li>containment: f = File.read vs File.open do |f| &#8230;; end</li>
<li>You can call a proc with []<br />
proc.call(a,b) is equivalent to proc[a,b]</li>
<li>duwanis in IRC: &#8220;rack of lambda&#8221;</li>
</ul>
<h3>Nick Gauthier &#8211; Grease your Suite</h3>
<h3>Matthew Bass &#8211; A/B Testing for Developers</h3>
<ul>
<li>Choose a metric</li>
<li>Do some experiments</li>
<li>Compare the metrics</li>
<li>Vanity for rails A/B testing</li>
</ul>
<h3>Yossef Mendelssohn &#8211; The Perpetual Novice</h3>
<ul>
<li>Dryfus skill acquisition model</li>
<li>Novice level: follow the rules, do what you&#8217;re told</li>
<li>Adv. Beginner: limited ability to perceive different aspects of the situation</li>
<li>Competence: multitasking, handle more information, see how actions are related to goals</li>
<li>Proficiency: higher level view of the task, prioritize, adapt</li>
<li>Expert: no longer relying on rules and guidelines, deep &amp; tacit understanding, intuition</li>
<li>be mindful of your scenario: other people (or yourself) need to deal with the work you&#8217;ve done</li>
<li>unconscious incompetence: you don&#8217;t know what you&#8217;re doing and you don&#8217;t know that you don&#8217;t know it</li>
<li>conscious incompetence: you don&#8217;t know what you&#8217;re doing, but you know that you don&#8217;t know what you&#8217;re doing</li>
<li>conscious competence: you can do it and you understand it, but you have to think about it</li>
<li>unconscious competence: it is second nature to you. You know what you&#8217;re doing and you don&#8217;t have to try</li>
<li>Dunning-krueger effect:
<ul>
<li>when you don&#8217;t know what you don&#8217;t know, you don&#8217;t appreciate the skill itself, and are therefore very confident of yourself.</li>
<li>If you understand the skills, the more competent people think they are not very competent</li>
</ul>
</li>
<li>You need to practice, outside your main work</li>
<li>Focus on getting better, the entire time</li>
<li>low level people working together can be dangerous</li>
<li>a skilled person working with a lower level person need to work at the lower person&#8217;s level</li>
<li>Shuhari
<ul>
<li>Shu: learning fundamental techique, rules and guidelines (acceptance)</li>
<li>Ha: detach, digress, and break from tradition. think for yourself</li>
<li>Ri: transcendence: moved past rules and guidelines (no form)</li>
</ul>
</li>
<li>Shoshyu: beginner&#8217;s mind. In the beginner&#8217;s mind there are many possibilities. In an expert&#8217;s mind, there are few.
<ul>
<li>Experts have a tendency to stop asking questions</li>
<li>Beginners always ask questions</li>
</ul>
</li>
<li>Something doesn&#8217;t suck just because it&#8217;s old</li>
</ul>
<h3>Starcraft interlude</h3>
<ul>
<li>Nick Gauthier vs Bryan Liles and Saxon</li>
</ul>
<h3>Ben Scofield &#8211; Keynote</h3>
<ul>
<li>Practice is important for mastery</li>
<li>Practice is not fun</li>
<li>mastery is know how to do things, not just knowing what was done</li>
<li>mastery is not required</li>
<li>as a company, deciding what not to do is as important (or more) as deciding what to do</li>
<li>Pick out what is most important to succeed, and outsource the rest</li>
<li>errbit : open source alternative to hoptoad</li>
<li>as a company, focus on the most important stuff</li>
<li>live intentionally: think about what you&#8217;re spending your time on.</li>
<li>Embrace adequacy (and mediocrity)</li>
</ul>
<h2>Day Three</h2>
<p>Family friendly ruby conf in disney world. $189/night @ contemporary. Free conference.</p>
<p>http://magic-ruby.com</p>
<h3>Michael Jackson &#8211; Parsing Expressions in Ruby</h3>
<ul>
<li>Different school of thought alternative to regular expressions</li>
<li>Regexes are great but complicated ones get really gross, even after 10 or 12 characters</li>
<li>parsing expressions are:
<ul>
<li>declarative</li>
<li>recursive</li>
<li>readable</li>
<li>easy to maintain</li>
<li>not ambiguous</li>
<li>slow :-) (in ruby)</li>
</ul>
</li>
<li>Citrus gem</li>
</ul>
<h3>John Willis &#8211; Configuration Management in the Cloud with Chef</h3>
<ul>
<li>infrastructure as code</li>
<li>need to be able to share with teammates</li>
<li>can&#8217;t have &#8220;the deploy guy&#8221;</li>
<li>Chef is a library for configuration management</li>
<li>Chef client runs on the system (to accept commands and configuration)</li>
<li>Chef server is a RESTful API</li>
<li>Each system you configure is a Node</li>
<li>Attributes are searchable</li>
<li>Knife is the tool you use to interact with the API</li>
<li>Nodes have Roles, which describe what a Node should be</li>
<li>Nodes have a Run List
<ul>
<li>What Roles or Recipes to apply in Order</li>
</ul>
</li>
<li>A Resource is a Package or a Service</li>
<li>E.G. Package &#8220;sudo&#8221; &#8220;1.6.8p12&#8243; and it figures out what package manager to use</li>
<li>Services support actions (e.g. apache supports &#8220;restart&#8221; and &#8220;status&#8221;)</li>
<li>Resources take action through providers</li>
<li>Data bags store arbitrary data
<ul>
<li>E.G. put a user w/ their ssh key in a data bag, so you can add them as a user on the server</li>
</ul>
</li>
<li>Cookbooks are shareable</li>
<li>&#8220;Open source for infrastructure&#8221;</li>
<li>Open training</li>
<li>Cloud service independence (swap from slicehost to rackspace just by adding credentials)</li>
<li>http://www.opscode.com
<ul>
<li>5 chef servers for free</li>
</ul>
</li>
<li>@opscode @botchagalupe</li>
<li>Chef beats puppet on cloud support (more vendors)</li>
</ul>
<h3>Backchannel notes</h3>
<ul>
<li>Whiskydisk for deploy</li>
</ul>
<h3>Alex Sharp &#8211; Refactoring in Practice</h3>
<ul>
<li>Shantytown application: you want to bulldoze it, but people live there</li>
<li>testing in crucial for refactoring</li>
<li>avoid the EPIC refactor</li>
<li>changing the implementation without changing its behavior</li>
<li>deprecate action
<ul>
<li>for example, hoptoad a deprecation warning on old calls to actions</li>
<li>helpful when there are ajax calls you are not sure about</li>
</ul>
</li>
<li>take out small chunks and get them under test</li>
<li>lack of framework knowledge &#8211; often using existing solutions is an easy refactor</li>
<li>Domain driven development &amp; domain modeling</li>
<li>Document the smells</li>
<li>delete code that you aren&#8217;t using</li>
</ul>
<h3>Brian Hogan &#8211; There&#8217;s a Wheel for that Already</h3>
<ul>
<li>&#8220;I don&#8217;t want to use that because I don&#8217;t like how it looks&#8221;</li>
<li>How often is &#8220;better&#8221; really just an opinion</li>
<li>Forwardable &#8211; delegate a method to another class</li>
<li>Rails.root.join(&#8216;config&#8217;, &#8216;x.yml&#8217;)</li>
<li>dir, base = path.split</li>
<li>open-uri wraps net/http, net/https, net/ftp</li>
<li>Tempfile (like tmpdir, but just for one file)</li>
<li>x = Tempfile.new(&#8216;hydra.yml&#8217;)</li>
<li>OpenStruct.new(Yaml.load(&#8216;config.yml&#8217;))</li>
<li>Observer<br />
@@@ ruby<br />
def initialize<br />
  add_observer MyObserver.new<br />
end<br />
&#8230; later<br />
call: &#8220;changed&#8221; !</li>
<li>bash alias for serving static files via webrick<br />
I wasn&#8217;t able to write it down quick enough.</li>
<li>PStore for storing data</li>
<li>CSV is great if it doesn&#8217;t need to be faster</li>
<li>Home Run for datetime speedup via C extension</li>
<li>Oh no, I had to catch my flight and I missed the rest of this awesome talk!</li>
</ul>
<h3>Glenn Vanderburg &#8211; Keynote</h3>
<ul>
<li>Wasn&#8217;t there. See notes from Lone Star Ruby Conf. It was probably the same talk</li>
</ul>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/08/30/nicks-highlights-from-lone-star-ruby-conf/"     class="crp_title">Nick&#8217;s Highlights from Lone Star Ruby Conf</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/09/11/nicks-highlights-from-windy-city-rails/"     class="crp_title">Nick&#8217;s Highlights from Windy City Rails</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/02/21/using-rspec-macros-and-metadata/"     class="crp_title">Using RSpec Macros and Metadata</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/09/27/automate-away-the-pain-of-multiple-database-yml-files/"     class="crp_title">Automate Away the Pain of Multiple Database.yml Files</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/01/15/guide-to-application-development-infrastructure-pairing-and-ci-servers/"     class="crp_title">Guide to Application Development Infrastructure: Pairing and</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2010/09/07/nicks-highlights-from-ruby-hoedown/">Nick&#8217;s Highlights from Ruby Hoedown</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2010/09/07/nicks-highlights-from-ruby-hoedown/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nick&#8217;s Highlights from Lone Star Ruby Conf</title>
		<link>http://blog.smartlogicsolutions.com/2010/08/30/nicks-highlights-from-lone-star-ruby-conf/</link>
		<comments>http://blog.smartlogicsolutions.com/2010/08/30/nicks-highlights-from-lone-star-ruby-conf/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 21:12:05 +0000</pubDate>
		<dc:creator>Nick Gauthier</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=954</guid>
		<description><![CDATA[<p>I recently attended and spoke at Lone Star Ruby Conf 2010. I took notes on anything technical I thought would be useful to bring back and use day-to-day at SmartLogic. Keep in mind there were many excellent talks that aren&#8217;t on this list, it&#8217;s just a snippet of things I wanted to look into more. [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/09/07/nicks-highlights-from-ruby-hoedown/"     class="crp_title">Nick&#8217;s Highlights from Ruby Hoedown</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/30/22-links-from-railsconf-2013-day-1/"     class="crp_title">22 Links From RailsConf 2013 Day 1</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/25/4-railsconf-2013-topics-to-get-excited-about/"     class="crp_title">4 RailsConf 2013 Topics to Get Excited About</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/01/15/guide-to-application-development-infrastructure-pairing-and-ci-servers/"     class="crp_title">Guide to Application Development Infrastructure: Pairing and</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/11/03/rubyconf-2012-links-to-follow-up-on/"     class="crp_title">RubyConf 2012: Links to Follow Up On</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2010/08/30/nicks-highlights-from-lone-star-ruby-conf/">Nick&#8217;s Highlights from Lone Star Ruby Conf</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I recently attended and spoke at Lone Star Ruby Conf 2010. I took notes on anything technical I thought would be useful to bring back and use day-to-day at SmartLogic. Keep in mind there were many excellent talks that aren&#8217;t on this list, it&#8217;s just a snippet of things I wanted to look into more.</p>
<p><span id="more-954"></span></p>
<h2>Day one</h2>
<h3>Adam Keys &#8211; Rails&#8217; Next Top Model: Using ActiveModel and ActiveRelation</h3>
<ul>
<li>Rails 3 &#8211; ActiveSupport::Concern</li>
<li>Accessors + Concern cleans up code</li>
<li>New encryption classes for secure keys and encrypted data transfer</li>
<li>ActiveModel::Validator for non AR validations</li>
<li>validates_with MyValidator</li>
<li>ActiveModel::Serialization for hydra?</li>
<li>serialization: require ‘attributes’ and ‘attributes=’</li>
<li>serializable_hash =&gt; to_json, to_xml, from_json, from_xml</li>
<li>ActiveRelation (AREL)</li>
</ul>
<h3>Jesse Crouch &#8211; Building fast, lightweight data-driven apps using the Infochimps API</h3>
<p>Infochimps API to create linkedin’ 2nd degree network with twitter data. Check it out at <a href="http://trst.me">http://trst.me</a></p>
<h3>Aman Gupta &#8211; Debugging Ruby: Understanding and Troubleshooting the VM and your Application</h3>
<p>Slides: http://dl.dropbox.com/u/635/debugging_ruby-lsrc.pdf</p>
<ul>
<li>lsof -nPp : get open files for a specific pid</li>
<li>strace: observe functions being called. Can see reads and writes between processes, like rails hitting mysql</li>
<li>compile ruby w/ &#8211;enable-pthreads (not by default in debian or in rvm)</li>
<li>See http://rvm.beginrescueend.com/rubies/installing/ end of page for how to do this via RVM</li>
<li>tcpdump for networking</li>
<li>google perftools for ruby profiling</li>
<li>pprof ruby =&gt; graphical output</li>
<li>home_run for C based time parsing</li>
<li>perftools.rb for ruby diagrams of usage time</li>
<li>gdb.rb to executive ruby from gdb, when running ruby via gdb</li>
<li>bleak house: ruby memory leak detector</li>
<li>rack-perftools: rack middleware for perftools.rb</li>
<li>google perftools for forking</li>
</ul>
<h3>Caleb Clausen – What every Ruby programmer should know about threads</h3>
<ul>
<li>Thread safe objects: mutex, queue, sizequeue, condition variable</li>
<li>Semaphores to signal between threads</li>
<li>Mutex to lock and unlock resources</li>
</ul>
<h3>Jesse Wolgamott &#8211; Battle of NoSQL stars: Amazon&#8217;s SDB vs Mongoid vs CouchDB vs RavenDB</h3>
<ul>
<li>CouchDB is ACID, has great replication</li>
<li>Mongo has great rails support</li>
</ul>
<h2>Day two</h2>
<h3>James Edward Gray II &#8211; Ruby in the Wild</h3>
<ul>
<li>Logarithmic graphs!</li>
<li>Rubyists like to do a lot of stuff from scratch</li>
<li>&#8220;I&#8217;ve always been a fan of sqlite&#8221; &#8211; wha?</li>
<li>For fun, scatch an itch, try something new</li>
<li>&#8220;I try to make it a fun place [to work]&#8220;</li>
<li>Greg Brown wearing a Boh hat for his interview</li>
<li>Core of rake written in 30 mins</li>
<li>Rake file list in place of Dir.glob for hydra? (FileList ?)</li>
<li>File matching to compare input (source) and output (binary). Maybe for Sauron?</li>
</ul>
<h3>Chat with Scott Bellware</h3>
<p>I had a great chat with Scott Bellware about Agile, Lean, and his own style of OO integration testing. He recommended this book:</p>
<p><a href="http://www.amazon.com/gp/product/1935401009?ie=UTF8&#038;force-full-site=1">The Principles of Product Development Flow: Second Generation Lean Product Development</a></p>
<p>Also, he sent me a link to how he does his OO testing scenarios:</p>
<p><a href="http://github.com/sbellware/preview-signup">http://github.com/sbellware/preview-signup</a></p>
<p>I flew back after lunch on day two, so I&#8217;ll have to catch the rest in the videos!</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/09/07/nicks-highlights-from-ruby-hoedown/"     class="crp_title">Nick&#8217;s Highlights from Ruby Hoedown</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/30/22-links-from-railsconf-2013-day-1/"     class="crp_title">22 Links From RailsConf 2013 Day 1</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/25/4-railsconf-2013-topics-to-get-excited-about/"     class="crp_title">4 RailsConf 2013 Topics to Get Excited About</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/01/15/guide-to-application-development-infrastructure-pairing-and-ci-servers/"     class="crp_title">Guide to Application Development Infrastructure: Pairing and</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/11/03/rubyconf-2012-links-to-follow-up-on/"     class="crp_title">RubyConf 2012: Links to Follow Up On</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2010/08/30/nicks-highlights-from-lone-star-ruby-conf/">Nick&#8217;s Highlights from Lone Star Ruby Conf</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2010/08/30/nicks-highlights-from-lone-star-ruby-conf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Directory Conventions for Rack Middleware RubyGems</title>
		<link>http://blog.smartlogicsolutions.com/2010/05/13/directory-conventions-for-rack-middleware-rubygems/</link>
		<comments>http://blog.smartlogicsolutions.com/2010/05/13/directory-conventions-for-rack-middleware-rubygems/#comments</comments>
		<pubDate>Thu, 13 May 2010 15:48:27 +0000</pubDate>
		<dc:creator>John Trupiano</dc:creator>
				<category><![CDATA[Rack]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[conventions]]></category>
		<category><![CDATA[middleware]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=896</guid>
		<description><![CDATA[<p>I just wanted to make a quick note about directory conventions for rack middleware gems. For all gems you should follow the convention of housing all of your code inside a single file and directory of the same name as your gem within lib, e.g. $> ls -l ~/projects/timecop/lib drwxr-xr-x 5 john staff 170 Jan [...]<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/08/30/nicks-highlights-from-lone-star-ruby-conf/"     class="crp_title">Nick&#8217;s Highlights from Lone Star Ruby Conf</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/08/20/testing-pdf-content-with-capybara/"     class="crp_title">Testing PDF Content with Capybara</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/30/22-links-from-railsconf-2013-day-1/"     class="crp_title">22 Links From RailsConf 2013 Day 1</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/09/11/nicks-highlights-from-windy-city-rails/"     class="crp_title">Nick&#8217;s Highlights from Windy City Rails</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/"     class="crp_title">cURLin’ for Docs</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div></p><p>The post <a href="http://blog.smartlogicsolutions.com/2010/05/13/directory-conventions-for-rack-middleware-rubygems/">Directory Conventions for Rack Middleware RubyGems</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I just wanted to make a quick note about directory conventions for rack middleware gems.  For all gems you should follow the convention of housing all of your code inside a single file and directory of the same name as your gem within lib, e.g.</p>
<p><code><br />
$> ls -l ~/projects/timecop/lib<br />
drwxr-xr-x  5 john  staff  170 Jan 14 20:31 timecop<br />
-rw-r--r--  1 john  staff   82 Jan 14 20:31 timecop.rb<br />
</code></p>
<p>The reason for this is related to how RubyGems hijacks Ruby&#8217;s require method.  When a gem is activated its lib/ folder is added to the load path.  This means that anything inside that directory is now accessible via the require method.  In order to avoid file naming collisions across gems, you must name these exactly the same as your gem. (see <a href="http://i-dont-trust-your-code.heroku.com/">slides for I Don&#8217;t Trust Your Code</a> for a more complete discussions of this)</p>
<p>However, this is slightly different with rack gems.  The convention for naming rack middleware is by using a dash, e.g. rack-rewrite.  The convention for requiring rack middleware though is to replace that dash with a slash, e.g. <code>require 'rack/rewrite'</code>.</p>
<p>The convention I&#8217;ve adopted for structuring rack middleware within a gem is to include a file by the same name as the gem and a rack directory in lib/, and then to include the second part of the middleware name as a subdirectory under that.</p>
<p><code><br />
~/projects/rack-rewrite (master) $> ls -l lib/<br />
total 8<br />
drwxr-xr-x  4 john  staff  136 Apr 17 18:02 rack<br />
-rw-r--r--@ 1 john  staff   22 Apr 17 18:02 rack-rewrite.rb</p>
<p>~/projects/rack-rewrite (master) $> ls -l lib/rack<br />
total 8<br />
drwxr-xr-x  3 john  staff  102 May 13 11:09 rewrite<br />
-rw-r--r--@ 1 john  staff  827 Apr 17 18:02 rewrite.rb<br />
</code></p>
<p>This allows my users to use either <code>require 'rack-rewrite'</code> or <code>require 'rack/rewrite'</code>.</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/08/30/nicks-highlights-from-lone-star-ruby-conf/"     class="crp_title">Nick&#8217;s Highlights from Lone Star Ruby Conf</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/08/20/testing-pdf-content-with-capybara/"     class="crp_title">Testing PDF Content with Capybara</a></li><li><a href="http://blog.smartlogicsolutions.com/2013/04/30/22-links-from-railsconf-2013-day-1/"     class="crp_title">22 Links From RailsConf 2013 Day 1</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/09/11/nicks-highlights-from-windy-city-rails/"     class="crp_title">Nick&#8217;s Highlights from Windy City Rails</a></li><li><a href="http://blog.smartlogicsolutions.com/2012/07/12/curlin-for-docs/"     class="crp_title">cURLin’ for Docs</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/" rel="nofollow">Contextual Related Posts</a></li></ul></div><p>The post <a href="http://blog.smartlogicsolutions.com/2010/05/13/directory-conventions-for-rack-middleware-rubygems/">Directory Conventions for Rack Middleware RubyGems</a> appeared first on <a href="http://blog.smartlogicsolutions.com">Web Development Advice and Tips</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2010/05/13/directory-conventions-for-rack-middleware-rubygems/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
