<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.pivotallabs.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title>Pivotal Blabs</title>
  
  <subtitle>The Pivotal Labs Blog</subtitle>
  <id>tag:pivotallabs.com,2007:/blabs</id>
  <updated>2012-02-11T07:38:00-00:00</updated>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.pivotallabs.com/pivotallabs/blabs" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="pivotallabs/blabs" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
    <updated>2012-02-11T07:38:00-00:00</updated>
    <title type="html">NYC Standup: 2/5-10 Batched</title>
    <author>
      <name>Steve Ellis</name>
    </author>
    <link href="http://pivotallabs.com/users/sellis/blog/articles/2012-nyc-standup-2-5-10-batched" />
    <id>http://pivotallabs.com/users/sellis/blog/articles/2012-nyc-standup-2-5-10-batched</id>
    <content type="html">&lt;h2&gt;Interesting&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;assert_template Matching&lt;/strong&gt;: RSpec's template matcher uses a reg ex, which is loose enough to cause some false positives.&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;
  render &amp;quot;_foo_bar.haml&amp;quot;
&lt;/pre&gt;

&lt;p&gt;will pass cause both of these to pass:&lt;/p&gt;

&lt;pre&gt;
  should render_template &amp;quot;_foo_bar.haml&amp;quot;
  should render_template &amp;quot;_bar.haml&amp;quot;
&lt;/pre&gt;

&lt;p&gt;The best solution presented was to explicitly say what you expect not to be rendered&amp;#40;should_not render_template "_bar.haml"&amp;#41;. There has been some activity on Github recently around ActionController's assert_template method, but none addressing this exact problem&amp;#40;1 example: https://github.com/rails/rails/pull/3879/files&amp;#41;. The regex is complicated by the fact that it has to match ambiguous partials rendered with specific paths&amp;#40;should render_template "_bar.haml" needs to match render "foo/_bar.haml"&amp;#41;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Let It Be&lt;/strong&gt;: If you declare a "let!" variable at the top of a file, and redeclare that variable with a "let" statement in a nested context, the variable will not be lazily loaded. RSpec evaluates it as a "let!".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Binary Tempfiles&lt;/strong&gt;: There is no way to open a new Tempfile in binary mode; you must open it first and then call foo.binmode.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Airbrake was acquired by Exceptional
&lt;a href="http://techcrunch.com/2012/02/07/exceptional-acquires-error-tracking-application-airbrake/"&gt;http://techcrunch.com/2012/02/07/exceptional-acquires-error-tracking-application-airbrake/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Auto compiling SASS, pre-3.0&lt;/strong&gt;: Adam used 'compass watch' and Foreman to automate the regeneration of stylesheets in development. This prevents him from having to wait for the sass to recompile on the first request he makes after modifying stylesheets. &lt;a href="https://github.com/ddollar/foreman"&gt;https://github.com/ddollar/foreman&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Should receive, in any order&lt;/strong&gt;: Ian &amp;amp; Suman were attempting to write an RSpec 1.3 spec that asserted a method was called with an array that included the correct elements; however, the order of the elements within the array was not important. Seems there is no array_including equivalent to hash_including. The solution they came to was to use the block style expectation as defined here: https://www.relishapp.com/rspec/rspec-mocks/docs/argument-matchers&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;
  foo.should_receive&amp;#40;:bar&amp;#41; do |arg1|
    arg1.should =~ [3,1,2]
  end
&lt;/pre&gt;

&lt;p&gt;Anyone know of a built-in matcher for arrays similar to hash_including?&lt;/p&gt;</content>
  </entry>
  <entry>
    <updated>2012-02-11T02:23:00-00:00</updated>
    <title type="html">Standup 02/10/2012: Who Reads the Manual, Anyway?</title>
    <author>
      <name>Ian Lesperance</name>
    </author>
    <link href="http://pivotallabs.com/users/ilesperance/blog/articles/2011-standup-02-10-2012-who-reads-the-manual-anyway-" />
    <id>http://pivotallabs.com/users/ilesperance/blog/articles/2011-standup-02-10-2012-who-reads-the-manual-anyway-</id>
    <content type="html">&lt;h2&gt;Help&lt;/h2&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"Anyone know what DocumentCloud uses to generate the documentation for &lt;a href="http://documentcloud.github.com/backbone/"&gt;Backbone.js&lt;/a&gt;, &lt;a href="http://documentcloud.github.com/underscore/"&gt;Underscore.js&lt;/a&gt;, et. al.?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's a mystery.&lt;/p&gt;

&lt;h2&gt;Interesting&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://mymarks.heroku.com/"&gt;MyMarks&lt;/a&gt;—if you use &lt;a href="http://www.xmarks.com/"&gt;Xmarks&lt;/a&gt; to synchronize your bookmarks across browsers/machines, you can use MyMarks to browse them from your mobile device. It's a Sinatra/jQuery Mobile app written by our very own Michael Grosser. It's also &lt;a href="https://github.com/grosser/mymarks"&gt;on Github&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://devcenter.heroku.com/articles/labs-user-env-compile"&gt;user_env_compile&lt;/a&gt;—an experimental Heroku Labs feature that makes your application's configuration variables present during slug compilation. This is useful if, for example, you need the environment loaded when precompiling assets.&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <updated>2012-02-09T23:02:00-00:00</updated>
    <title type="html">Standup for 2/9/2012: NP in P time? As usual, no.</title>
    <author>
      <name>David Stevenson</name>
    </author>
    <link href="http://pivotallabs.com/users/stevend/blog/articles/2010-standup-for-2-9-2012-np-in-p-time-as-usual-no-" />
    <id>http://pivotallabs.com/users/stevend/blog/articles/2010-standup-for-2-9-2012-np-in-p-time-as-usual-no-</id>
    <content type="html">&lt;h2&gt;Ask for Help&lt;/h2&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"How can I know all the descendants of a class in the superclass at load time in ruby? I want to create a scope for each subclass."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can't.&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"What popovers should I use?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We've used at least these two before:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://craigsworks.com/projects/qtip/"&gt;QTip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://onehackoranother.com/projects/jquery/tipsy/"&gt;Tipsy&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"What recurring billing system should I use?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We've had good luck with &lt;a href="http://www.braintreepayments.com/"&gt;BrainTree&lt;/a&gt; and &lt;a href="http://recurly.com/"&gt;Recurly&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Interesting Things&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/powmedia/backbone-forms"&gt;backbone-forms&lt;/a&gt; is a plugin to backbone that provides model-based form views similar to rails' &lt;code&gt;form_for&lt;/code&gt; functionality.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://emberjs.com/"&gt;EmberJS&lt;/a&gt; &lt;a href="http://www.meetup.com/Ember-SF/events/50058382/"&gt;meetup&lt;/a&gt; will be Feb 21, at our new pivotal office!&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <updated>2012-02-08T02:13:00-00:00</updated>
    <title type="html">Standup 02/07/2012: What's the Sound of All Hands Clapping?</title>
    <author>
      <name>Ian Lesperance</name>
    </author>
    <link href="http://pivotallabs.com/users/ilesperance/blog/articles/2009-standup-02-07-2012-what-s-the-sound-of-all-hands-clapping-" />
    <id>http://pivotallabs.com/users/ilesperance/blog/articles/2009-standup-02-07-2012-what-s-the-sound-of-all-hands-clapping-</id>
    <content type="html">&lt;h2&gt;Ask for Help&lt;/h2&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"Are there any good enum gems that work with Rails 3.2?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Try &lt;a href="https://github.com/lwe/simple_enum"&gt;simple_enum&lt;/a&gt;. But watch out: by default it will take your array of string values and store the numeric indices in the database. To avoid having to migrate your existing data, you can pass it a hash:&lt;/p&gt;

&lt;pre&gt;
as_enum :status, :pending =&amp;gt; &amp;quot;pending&amp;quot;, :active =&amp;gt; &amp;quot;active&amp;quot;
&lt;/pre&gt;

&lt;h2&gt;Interesting Things&lt;/h2&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"And... clap."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A fun thing to try at standup: get everyone to clap once simultaneously without counting down.&lt;/p&gt;</content>
  </entry>
  <entry>
    <updated>2012-02-08T02:06:00-00:00</updated>
    <title type="html">IntelliJ Modules in Rubymine</title>
    <author>
      <name>Stephan Hagemann</name>
    </author>
    <link href="http://pivotallabs.com/users/shagemann/blog/articles/2008-intellij-modules-in-rubymine-" />
    <id>http://pivotallabs.com/users/shagemann/blog/articles/2008-intellij-modules-in-rubymine-</id>
    <content type="html">&lt;p&gt;IntelliJ has a feature called &lt;a href="http://www.jetbrains.com/idea/webhelp/module.html"&gt;modules&lt;/a&gt;: "a functional unit which you can compile, run, test and debug independently." &lt;/p&gt;

&lt;p&gt;&lt;img src="http://assets.pivotallabs.com/1280/original/intellij_modules.png" alt="Modules in IntelliJ: Multiple top-level folders" /&gt;&lt;/p&gt;

&lt;p&gt;A module in IntelliJ is a top-level view on a part of a codebase. IntelliJ is for Java, which is why I do not typically use it. I use Rubymine - no similar functionality exists here... but a way around that!&lt;/p&gt;&lt;p&gt;It may have been true at some point that these kind of modules were not something that Rails offered, but they have been around for quite a while: &lt;a href="http://edgeapi.rubyonrails.org/classes/Rails/Engine.html"&gt;Engines&lt;/a&gt;! &lt;/p&gt;

&lt;p&gt;Engines are typically seen as a way to package a Rails app that can be reused and configured in the context of other Rails apps. However, many big Rails projects can benefit from engines and their ability to structure a large codebase into smaller, more independent parts. Namespacing within one Rails app can achieve a similar effect, but engines take it to the next level: all the code, including views, javascript, and even rake tasks and migrations can be separated consistently. Now, if the apps were totally separate, several independent Rails apps might be the right solution, but if those are tied together by the same database, one might do more harm then good when ripping that code apart... &lt;/p&gt;

&lt;h2&gt;The Problem&lt;/h2&gt;

&lt;p&gt;Imagine a Rails project with the following folder structure:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rails_app/
  app/
  ...
  engines/
    custom_engine1/
    custom_engine2/
  ...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The engines are somewhat hidden away, two levels deep in the folder structure. Also, running specs for engines in these sub-folders won't work from Rubymine, because the paths it tries to use are wrong.&lt;/p&gt;

&lt;p&gt;Whether you are actually working with engines or just want to see multiple root folders in Rubymine at once, here is how to do it.&lt;/p&gt;

&lt;h2&gt;Make modules work in Rubymine&lt;/h2&gt;

&lt;p&gt;1&amp;#41; You can get modules to work in Rubymine by opening your Rails project in IntelliJ: &lt;code&gt;Cmd + ;&lt;/code&gt; opens the project structure dialog, select &lt;code&gt;Modules&lt;/code&gt; from the list on the left and create a new module with the &lt;code&gt;+&lt;/code&gt; button. Or, you can simply add a few files to your project...&lt;/p&gt;

&lt;p&gt;2&amp;#41; The .idea folder in the root of your project holds the Rubymine configuration files. Edit &lt;code&gt;modules.xml&lt;/code&gt; and add a &lt;code&gt;module&lt;/code&gt; line for every module you would like to create:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;!-- ROOT/.idea/modules.xml --&amp;gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;project version="4"&amp;gt;
  &amp;lt;component name="ProjectModuleManager"&amp;gt;
    &amp;lt;modules&amp;gt;
      &amp;lt;module fileurl="file://$PROJECT_DIR$/custom_engine1/module1.iml" filepath="$PROJECT_DIR$/custom_engine1/custom_engine1.iml" /&amp;gt;
      &amp;lt;module fileurl="file://$PROJECT_DIR$/custom_engine2/module2.iml" filepath="$PROJECT_DIR$/custom_engine2/custom_engine2.iml" /&amp;gt;
    &amp;lt;/modules&amp;gt;
  &amp;lt;/component&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In the root folder of every module create a &lt;code&gt;.iml&lt;/code&gt; file with the name of that module like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;!-- ROOT/engines/custom_engine1/custom_engine1.iml --&amp;gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;module type="RUBY_MODULE" version="4"&amp;gt;
  &amp;lt;component name="NewModuleRootManager"&amp;gt;
    &amp;lt;content url="file://$MODULE_DIR$" /&amp;gt;
    &amp;lt;orderEntry type="inheritedJdk" /&amp;gt;
    &amp;lt;orderEntry type="sourceFolder" forTests="false" /&amp;gt;
  &amp;lt;/component&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Voila: The next time you open the project folder in Rubymine, the custom_engine folders show up as top-level entries in the projects file list! &lt;/p&gt;

&lt;p&gt;&lt;img src="http://assets.pivotallabs.com/1281/original/rubymine_modules.png" alt="Modules in Rubymine!" /&gt;&lt;/p&gt;

&lt;p&gt;Here is the gist: &lt;a href="https://gist.github.com/1764127"&gt;https://gist.github.com/1764127&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This worked for me with Rubymine 3.2.4 and IntelliJ IDEA 11 CE.&lt;/p&gt;</content>
  </entry>
  <entry>
    <updated>2012-02-06T21:17:00-00:00</updated>
    <title type="html">Standup 2/6/2012: Tracker UI updates</title>
    <author>
      <name>David Stevenson</name>
    </author>
    <link href="http://pivotallabs.com/users/stevend/blog/articles/2006-standup-2-6-2012-tracker-ui-updates" />
    <id>http://pivotallabs.com/users/stevend/blog/articles/2006-standup-2-6-2012-tracker-ui-updates</id>
    <content type="html">&lt;h2&gt;Ask for Help&lt;/h2&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"pg gem version 0.12.2 seems to be leaving connections open sometimes after our application server is dead.  This results in transactions that never finish.  Anyone know what's up?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;Interesting Things&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tracker released major UI updates on Saturday, and we're getting a lot of positive and negative feedback about it.  Fear the change!&lt;/li&gt;
&lt;li&gt;If you change code that's part of the rails asset pipeline, it won't really take effect until you deleted the cached files and allow the asset pipeline to regenerate them.  This is because the pipeline watches for changes in the input files, but not in the source code.&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <updated>2012-02-05T18:05:00-00:00</updated>
    <title type="html">Test your Rake tasks!</title>
    <author>
      <name>Stephan Hagemann</name>
    </author>
    <link href="http://pivotallabs.com/users/shagemann/blog/articles/1967-test-your-rake-tasks-" />
    <id>http://pivotallabs.com/users/shagemann/blog/articles/1967-test-your-rake-tasks-</id>
    <content type="html">&lt;p&gt;There are several reasons why you should test your Rake tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rake tasks are code and as such deserve testing.&lt;/li&gt;
&lt;li&gt;When untested Rake tasks have a tendency to become overly long and convoluted. Tests will help keep them in bay.&lt;/li&gt;
&lt;li&gt;As Rake tasks typically depend on your models, you &amp;#40;should&amp;#41; loose confidence in them if you don't have tests and are attempting refactorings.&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;A problematic Rake task test&lt;/h2&gt;

&lt;p&gt;Here is a Rake file...&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;File: lib/tasks/bar_problematic.rake

namespace :foo do
  desc "bake some bars"
  task bake_a_problematic_bar: :environment do
    puts '*' * 60
    puts ' Step back: baking in action!'
    puts '*' * 60

    puts Bar.new.bake

    puts '*' * 60
    puts ' All done. Thank you for your patience.'
    puts '*' * 60
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;...and its too simplistic spec:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;File: spec/tasks/bar_rake_problematic_spec.rb
require 'spec_helper'
require 'rake'

describe 'foo namespace rake task' do
  describe 'foo:bake_a_problematic_bar' do

    before do
      load File.expand_path&amp;#40;"../../../lib/tasks/bar_problematic.rake", __FILE__&amp;#41;
      Rake::Task.define_task&amp;#40;:environment&amp;#41;
    end

    it "should bake a bar" do
      Bar.any_instance.should_receive :bake
      Rake::Task["foo:bake_a_problematic_bar"].invoke
    end

    it "should bake a bar again" do
      Bar.any_instance.should_receive :bake
      Rake::Task["foo:bake_a_problematic_bar"].invoke
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Some notable aspects of testing Rake tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rake has to be required.&lt;/li&gt;
&lt;li&gt;The Rake file under test has to be manually loaded.&lt;/li&gt;
&lt;li&gt;In this example, the Rake task depends on the &lt;code&gt;environment&lt;/code&gt; task, which is not automatically available in a spec. Since we are in rspec, the environment is already loaded and we can just define &lt;code&gt;environment&lt;/code&gt; as an empty Rake task to make the bake task run in the test.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When run, this spec fails on the second it block... and that is not the only problem with this spec and the Rake task:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Rake task duplicates code to output information to the user.&lt;/li&gt;
&lt;li&gt;The spec "should bake a bar" will output that information when run, which clobbers the spec runners output.&lt;/li&gt;
&lt;li&gt;The spec "should bake a bar" again will fail, because Rake tasks are built to only execute once per process. See &lt;a href="https://github.com/ruby/ruby/blob/ruby_1_9_1/lib/rake.rb#L557"&gt;rake.rb&lt;/a&gt;. This makes sense for the normal use of Rake tasks where a task may be named as the prerequisite of another task multiple times through multiple dependencies it might have - the task only needs to run once. In our tests we have to reenable the task.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;A better Rake task test&lt;/h2&gt;

&lt;p&gt;A new version of the above Rake file...&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;File: lib/tasks/bar.rake
class BarOutput
  def self.banner text
    puts '*' * 60
    puts " #{text}"
    puts '*' * 60
  end

  def self.puts string
    puts string
  end
end

namespace :foo do
  desc "bake some bars"
  task bake_a_bar: :environment do
    BarOutput.banner " Step back: baking in action!"
    BarOutput.puts Bar.new.bake
    BarOutput.banner " All done. Thank you for your patience."
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;... and its spec:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;File: spec/tasks/bar_rake_spec.rb
require 'spec_helper'
require 'rake'

describe 'foo namespace rake task' do
  before :all do
    Rake.application.rake_require "tasks/bar"
    Rake::Task.define_task&amp;#40;:environment&amp;#41;
  end

  describe 'foo:bar' do
    before do
      BarOutput.stub&amp;#40;:banner&amp;#41;
      BarOutput.stub&amp;#40;:puts&amp;#41;
    end

    let :run_rake_task do
      Rake::Task["foo:bake_a_bar"].reenable
      Rake.application.invoke_task "foo:bake_a_bar"
    end

    it "should bake a bar" do
      Bar.any_instance.should_receive :bake
      run_rake_task
    end

    it "should bake a bar again" do
      Bar.any_instance.should_receive :bake
      run_rake_task
    end

    it "should output two banners" do
      BarOutput.should_receive&amp;#40;:banner&amp;#41;.twice
      run_rake_task
    end

  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This spec passes just fine and does not clobber the spec output. Again, let's look at noteworthy things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The output of the Rake task now goes through the &lt;code&gt;BarOutput&lt;/code&gt; class. This reduces code duplication and allows for easy stubbing. There are other ways to achieve a similar effect and not clobber test output: &lt;a href="http://www.whatastruggle.com/stub-out-puts-or-print-with-rspec"&gt;Stub puts and print&lt;/a&gt;, &lt;a href="http://stackoverflow.com/questions/1546200/check-for-the-absence-of-puts-in-rspec"&gt;stub on $stdout&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rake.application&lt;/code&gt; has a nicer way of requiring Rake files than a simple &lt;code&gt;load&lt;/code&gt;, because &lt;code&gt;rake_require&lt;/code&gt; knows where Rake files live.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rake::Task["TASK"].reenable&lt;/code&gt; reenables the task with name "TASK" so that it will be run again and can be called multiple times in a spec.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the gist: &lt;a href="https://gist.github.com/1764423"&gt;https://gist.github.com/1764423&lt;/a&gt;&lt;/p&gt;</content>
  </entry>
  <entry>
    <updated>2012-02-03T17:55:00-00:00</updated>
    <title type="html">SF Standup 2/3/2012: Fixnum[what?]</title>
    <author>
      <name>Kevin Fitzpatrick</name>
    </author>
    <link href="http://pivotallabs.com/users/kevin/blog/articles/2004-sf-standup-2-3-2012-fixnum-what-" />
    <id>http://pivotallabs.com/users/kevin/blog/articles/2004-sf-standup-2-3-2012-fixnum-what-</id>
    <content type="html">&lt;h2&gt;Ask for Help&lt;/h2&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"In an android web browser, if I have an autocomplete menu, and I click on one of the items, the click is registered on that item, but also seems to pass through to the elements behind it.  For instance, a different text input was behind it, and became focused."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"Yep, that bug sucks."  "The world may never know."&lt;/p&gt;

&lt;h2&gt;Interesting Things&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Fixnum's &lt;code&gt;[]&lt;/code&gt; operator works! According to the ruby docs &lt;/p&gt;

&lt;p&gt;"Bit Reference—Returns the nth bit in the binary representation of fix, where fix is the least significant bit."&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# 2:Fixnum in binary is 10, right? So…


2[0] = 0
2[1] = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Also:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;a = 0b11001100101010
30.downto&amp;#40;0&amp;#41; do |n| print a[n] end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;produces:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;0000000000000000011001100101010
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://code.google.com/p/innotop/" title="innotop - The best top clone for MySQL, with special attention paid to InnoDB - Google Project Hosting"&gt;innotop&lt;/a&gt; &lt;code&gt;innotop&lt;/code&gt; is a 'top' clone for MySQL with more features and flexibility than similar tools. It'll let you do all sorts of dangerous things to your database! Have fun!!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://parse.com"&gt;Parse.com&lt;/a&gt; apparently accepts job applications via API! Check it out at &lt;a href="https://parse.com/jobs#api"&gt;https://parse.com/jobs#api&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;jQuery and the &lt;code&gt;resize&lt;/code&gt; event – If you trigger a &lt;code&gt;resize&lt;/code&gt; even on any object other than the window, it will not trigger the binding on that element. It will, however, trigger any &lt;code&gt;resize&lt;/code&gt; bindings you have on window.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Did you commit to git under the wrong author's name and email? Use&lt;br /&gt;
&lt;code&gt;--ammend --reset-author&lt;/code&gt; after committing, but before pushing &amp;#40;unless you want a pain in the tuchus&amp;#41;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mkdir foo  
cd foo  
git init  
touch README  
git config --global user.name "Santa Claus"  
git config --global user.email "santa@claus.no"  
git add .  
git commit -m "Commit from Santa Claus" 
git show 
# commit e5f4ebe6c689ddbf4ff595855fec544da5d8ce01
# Author: Santa Claus &amp;lt;santa@claus.no&amp;gt;


# Oops! I'm not Santa Claus  


git config --global user.name "Easter Bunny"  
git config --global user.email "easter@bunny.cl"  
git commit --amend --reset-author  


git show  
# commit d523479d487d04388972bea872913ffda734ef89
# Author: Easter Bunny &amp;lt;easter@bunny.cl&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Looking to game the system on Superbowl Game day? Check out Onsi's &lt;a href="http://supersquare.heroku.com/"&gt;Super Square&lt;/a&gt; &lt;a href="http://supersquare.heroku.com/"&gt;http://supersquare.heroku.com/&lt;/a&gt; stats app for your Squares pool.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <updated>2012-02-02T17:29:00-00:00</updated>
    <title type="html">[Standup][SF] 2/2/2012: When does Van Damme show up?</title>
    <author>
      <name>Kevin Fitzpatrick</name>
    </author>
    <link href="http://pivotallabs.com/users/kevin/blog/articles/2002--standup-sf-2-2-2012-when-does-van-damme-show-up-" />
    <id>http://pivotallabs.com/users/kevin/blog/articles/2002--standup-sf-2-2-2012-when-does-van-damme-show-up-</id>
    <content type="html">&lt;h2&gt;Interesting Things&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;When using TimeCop to travel in time in your specs, &lt;code&gt;Time&lt;/code&gt; works normally, however &lt;code&gt;DateTime&lt;/code&gt; will round to the nearest second. You have been warned&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Help!&lt;/h2&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"What's going on with &lt;a href="https://github.com/mmangino/facebooker" title="mmangino/facebooker - GitHub"&gt;Facebooker&lt;/a&gt; and :class/:class_name_?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Normally, in an ActiveRecord class definition you can use &lt;code&gt;:class_name&lt;/code&gt; to change the class of an association.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;has_many :foos, :class_name =&amp;gt; 'Bar'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;With Facebooker installed, one project found that their project was able to use &lt;code&gt;:class&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;has_many :foos, :class =&amp;gt; 'Bar'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When Facebooker was removed, it all blew up.  No one had a solid answer as to why this worked in the first place.&lt;/p&gt;

&lt;hr /&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;em&gt;"How do can we tell if our app's email has been marked as spam like &lt;a href="http://www.campaignmonitor.com/" title="Email marketing software for web designers - Campaign Monitor"&gt;Campaign Monitor&lt;/a&gt; claim to do? How else can I get spam reports?"&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;*"Does anyone know to get this info from ISPs?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Services like Return Path can give you aggregate reports, but not specifics.  &lt;/p&gt;

&lt;p&gt;All other suggestions were vague and/or said "Contact the ISP."&lt;/p&gt;

&lt;hr /&gt;

&lt;blockquote&gt;
    &lt;p&gt;*"How do I sign up for Heroku with a Google Group email?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Allow non-member emails.  You want to do this before you sign up, because some Pivots have reported that they could not get a second confirmation message to be sent.&lt;/p&gt;</content>
  </entry>
  <entry>
    <updated>2012-02-01T18:17:00-00:00</updated>
    <title type="html">Standup 2012/2/1: Speed kills</title>
    <author>
      <name>Jacob Maine</name>
    </author>
    <link href="http://pivotallabs.com/users/jacob/blog/articles/2001-standup-2012-2-1-speed-kills-" />
    <id>http://pivotallabs.com/users/jacob/blog/articles/2001-standup-2012-2-1-speed-kills-</id>
    <content type="html">&lt;h2&gt;Interesting Things&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If you haven't noticed, Jasmine tests are at least twice as fast in Chrome as they are in Firefox.  Closing the inspection pane makes it even faster.  Be aware that part of the speed is from Chrome's aggressive caching, which can lead to erroneous test results.&lt;/li&gt;
&lt;li&gt;One team is using Backbone's local storage.  When they add &lt;code&gt;model.clear&amp;#40;&amp;#41;&lt;/code&gt; after every test run, their tests go from 20 seconds to over 100 seconds.  Someone suggested the &lt;code&gt;silent: true&lt;/code&gt; option, to suppress the &lt;code&gt;change&lt;/code&gt; events that &lt;code&gt;clear&lt;/code&gt; triggers.&lt;/li&gt;
&lt;li&gt;To avoid bugs in minified JS put semicolons in the right spots.  The easiest way to do that is to run a tool like JSLint or JSHint over your code.  Add it to your test suite to prevent mistakes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Ask for Help&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"In IE8 the numbers don't show up on ordered lists if we dynamically create &lt;code&gt;li&lt;/code&gt;s"&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or rather, they do, but only after hovering over the list.  The common wisdom is that this has been broken in IE for a long time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"Our project does some DNS resolution.  Is there a preferred way to mock this in tests?"&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No suggestions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"When replying to an email each email system adds different junk to the message.  We're processing those incoming replies.  Any standard way to strip out the junk?"&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everyone is using the ugly regex approach.  Are there mail gems that handle this?&lt;/p&gt;</content>
  </entry>
</feed>

