<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Things I Like</title>
  <id>http://127.0.0.1</id>
  <updated>2009-04-02</updated>
  <author>
    <name>Matt Van Horn</name>
  </author>
  <entry>
    <title>Gimme Cookie!</title>
    <link rel="alternate" href="http://127.0.0.1/2012/02/13/gimme-cookie/"/>
    <id>http://127.0.0.1/2012/02/13/gimme-cookie/</id>
    <published>2012-02-13</published>
    <updated>2012-02-13</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;I&amp;rsquo;m using signed permanent cookies to track users in my app, and sometimes it&amp;rsquo;s
nice to be able to be able to set them in the browser manually. I&amp;rsquo;m using &amp;ldquo;Edit This Cookie&amp;rdquo;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I&amp;rsquo;m using signed permanent cookies to track users in my app, and sometimes it&amp;rsquo;s
nice to be able to be able to set them in the browser manually. I&amp;rsquo;m using &amp;ldquo;Edit This Cookie&amp;rdquo;
in Chrome to handle this, but it was a bit tricky to figure out how to get the
encrypted value of the cookie to manually set it. Well, for future reference, I&amp;rsquo;ll put it here.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cookie_jar = ActionDispatch::Cookies::CookieJar.new(Rails.configuration.secret_token)
cookie_jar.permanent.signed[:foo] = 'bar'
cookie_jar[:foo] # =&amp;gt; "BAhpBg==--8e5eb732858427af92a0c1eeb4f81b276a775fb8"
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Using Webmock with Cucumber for Robust Integration Tests</title>
    <link rel="alternate" href="http://127.0.0.1/2012/02/09/cucumber-webmock/"/>
    <id>http://127.0.0.1/2012/02/09/cucumber-webmock/</id>
    <published>2012-02-09</published>
    <updated>2012-02-09</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;I decided that it would be a good idea to make my integration tests reflect as
much of the real-world setup of my app as possible. This includes hitting 3rd
party APIs over the internet&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I decided that it would be a good idea to make my integration tests reflect as
much of the real-world setup of my app as possible. This includes hitting 3rd
party APIs over the internet.
While this can be slow, it is nice to check
assertions against actual responses, in case an API change breaks something.&lt;/p&gt;

&lt;p&gt;The drawback to this was that I could no longer rely on all my cucumber
features passing while I was coding on the train, or in a park, for example.&lt;/p&gt;

&lt;p&gt;Mocking the responses would work, but I didn&amp;rsquo;t want to have 2 sets of
scenarios, just for offline and online testing. I also wanted to run the same
assertions regardless of where I was.&lt;/p&gt;

&lt;p&gt;So I came up with the following pattern, which tries to use a real connection,
and falls back to a stub when a connection can&amp;rsquo;t be made.&lt;/p&gt;

&lt;p&gt;First, I use curl to record an actual response for Webmock to send.
The -i option is necessary to include the headers.
(The API I was using in this example accepts posts of json, and returns json responses.)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;curl -iX POST -d @request.json http://www.api.example.com/do_something &amp;gt; do_something_response.json
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next, I set up my API stubs, in support/fake_api.rb. Note the instance variable in the After block &amp;ndash; that a key part that we will return to.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module FakeApi
  def stub_api
    canned_response  = File.read(File.join(Rails.root, 'features', 'support', 'fixtures', 'api', 'do_something_response.json'))

    stub_request(:post, "http://www.api.example.com/do_something").to_return( canned_response )
  end
end

World(FakeApi)

After do
  @api_stubbed = false
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Lastly, I write my cucumber step that deals with the API&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;When /^I do something at an external API endpoint$/ do
  api = MyApi.new
  begin
    result = api.do_something
    result.should be_something

  rescue SocketError =&amp;gt; e
    unless @api_stubbed
      stub_api
      @api_stubbed = true
      retry
    end
    fail "Can't connect to API (real OR fake)"
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So what we do here is try the real API, and if we cannot connect, we retry the
begin-rescue block using the stubbed version. We use the instance variable as
a flag to prevent an infinite loop, and we use the After block to ensure that
the next scenario starts with a real attempt again.&lt;/p&gt;

&lt;p&gt;You might want to adjust this, perhaps omitting the After block cleanup to assume that
if the network isn&amp;rsquo;t there for one test, it won&amp;rsquo;t be there for the duration of the run.&lt;/p&gt;

&lt;p&gt;You could also move the flag setting into the method that does the stubbing.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>My Development Setup</title>
    <link rel="alternate" href="http://127.0.0.1/2012/01/30/my-development-setup/"/>
    <id>http://127.0.0.1/2012/01/30/my-development-setup/</id>
    <published>2012-01-30</published>
    <updated>2012-01-30</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;I was working on the CSS for this blog, and reading an older post, when I realized how much my daily development setup has changed. Almost everything has changed from a couple of years ago, and I thought it might be nice to share how I get things done, since IMHO it is a pretty nice way to work&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I was working on the CSS for this blog, and reading an older post, when I realized how much my daily development setup has changed. Almost everything has changed from a couple of years ago, and I thought it might be nice to share how I get things done, since IMHO it is a pretty nice way to work.&lt;/p&gt;

&lt;h2&gt;Hardware&lt;/h2&gt;

&lt;p&gt;This has changed the least. I&amp;rsquo;m still tooling away on my 2008 MacBook Pro, although I did drop in a 500GB drive. I will say this about Apple products &amp;ndash; they stay useful far longer than their counterparts from Acer and Dell.&lt;/p&gt;

&lt;h2&gt;Editor&lt;/h2&gt;

&lt;p&gt;Still using Textmate, although I am now starting to explore alternatives. Rubymine (which I use at work) is a total pain to work with, so right now I&amp;rsquo;m leaning towards biting the bullet and learning Vim, unless another decent editor pops up.&lt;/p&gt;

&lt;h2&gt;VCS&lt;/h2&gt;

&lt;p&gt;Github. Is there really anything that needs to be said about that?&lt;/p&gt;

&lt;h2&gt;Ruby &amp;amp; Rails&lt;/h2&gt;

&lt;p&gt;I&amp;rsquo;m currently using Ruby 1.9.2-p290, with RVM. My most recent project is Rails 3.1.2, but I will probably upgrade to 3.2 within the month.&lt;/p&gt;

&lt;h2&gt;Development App Server&lt;/h2&gt;

&lt;p&gt;I&amp;rsquo;m using Pow, from 37 signals, which although it has some drawbacks with regard to SSL, is still pretty nice to use locally. I got sick of tweaking Apache and Passenger config files all the time.&lt;/p&gt;

&lt;h2&gt;Testing Tools&lt;/h2&gt;

&lt;p&gt;Cucumber, RSpec 2.8 &amp;amp; Capybara for the basics.
Fabrication as a factory for test data
NullDb to ensure that my unit tests are actually unit tests.
Shoulda Matchers, Email Spec, and Timecop for some miscellaneous conveniences.&lt;/p&gt;

&lt;h2&gt;Extras&lt;/h2&gt;

&lt;p&gt;I use Guard, with guard-spork, guard-rspec, guard-cucumber, guard-bundler, and  guard-pow. This keeps my tests running quickly and continuously.&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;m also using TDDium to offload my CI work.  There&amp;rsquo;s a post-receive hook set at Github, and they push to Heroku for me when the build is green. Pain-free continuous deployment, yay!&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;m also using Pivotal Tracker and pickler to coordinate my development priorities. With the Pivotal iPhone app, I can write stories on the train, and then pickler-pull them into my test suite to do BDD.&lt;/p&gt;

&lt;p&gt;That&amp;rsquo;s about it &amp;ndash; some nice tools to keep me focused on writing code instead of struggling to configure a bunch of stuff on my machine. After all, who likes shaving yaks?&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Set Up A Rails 3.1 App On Heroku Cedar, Ruby 1.9, with Assets Precompiled on the Server</title>
    <link rel="alternate" href="http://127.0.0.1/2012/01/07/heroku-cedar-assets-ruby-1-9/"/>
    <id>http://127.0.0.1/2012/01/07/heroku-cedar-assets-ruby-1-9/</id>
    <published>2012-01-07</published>
    <updated>2012-01-07</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;Someone told me the other day that they had some trouble with this, so here is a quick guide to getting set up on Heroku.
This approach is going to compile assets during slug compilation, which I think is the best of the available options&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Someone told me the other day that they had some trouble with this, so here is a quick guide to getting set up on Heroku.
This approach is going to compile assets during slug compilation, which I think is the best of the available options.&lt;/p&gt;

&lt;h2&gt;Step 1&lt;/h2&gt;

&lt;p&gt;set up a new Rails app&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ rails new placepanda --database=postgresql --skip-test-unit&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;Step 2&lt;/h2&gt;

&lt;p&gt;put the app into a Git repo&lt;/p&gt;

&lt;p&gt;First, I like to add the following two lines to .gitignore:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;config/database.yml
.DS_Store
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Heroku makes it own database connection, and I hate those .DS_Store files cluttering up my repository.
Now we can get on with the commit.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ git init
$ git add .
$ git commit -m "my brand new Rails app"
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Step 3&lt;/h2&gt;

&lt;p&gt;Deploy to Heroku as soon as possible. This way we can deal with issues as they arise, not after they accumulate and become hard to track down.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ heroku create --stack cedar
$ git push heroku master
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now we can look at the app&amp;rsquo;s status&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ heroku ps

Process  State       Command
-------  ----------  ---------------------------------
web.1    up for 10s  bundle exec rails server -p $PORT

$ heroku logs

2012-01-07T18:35:28+00:00 heroku[api]: Add-on add logging:basic by user@example.com
2012-01-07T18:35:28+00:00 heroku[api]: Release v2 created by user@example.com
2012-01-07T18:36:18+00:00 heroku[slugc]: Slug compilation started
2012-01-07T18:37:08+00:00 heroku[api]: Add-on add shared-database:5mb by user@example.com
2012-01-07T18:37:08+00:00 heroku[api]: Release v3 created by user@example.com
2012-01-07T18:37:08+00:00 heroku[api]: Config add RAILS_ENV, LANG, PATH, RACK_ENV, GEM_PATH by user@example.com
2012-01-07T18:37:08+00:00 heroku[api]: Release v4 created by user@example.com
2012-01-07T18:37:11+00:00 heroku[api]: Deploy cc64c78 by user@example.com
2012-01-07T18:37:11+00:00 heroku[api]: Release v5 created by user@example.com
2012-01-07T18:37:11+00:00 heroku[web.1]: State changed from created to starting
2012-01-07T18:37:15+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 40738`
2012-01-07T18:37:18+00:00 heroku[slugc]: Slug compilation finished
2012-01-07T18:37:20+00:00 app[web.1]: [2012-01-07 18:37:20] INFO  WEBrick 1.3.1
2012-01-07T18:37:20+00:00 app[web.1]: [2012-01-07 18:37:20] INFO  ruby 1.9.2 (2011-07-09) [x86_64-linux]
2012-01-07T18:37:20+00:00 app[web.1]: [2012-01-07 18:37:20] INFO  WEBrick::HTTPServer#start: pid=1 port=40738
2012-01-07T18:37:21+00:00 heroku[web.1]: State changed from starting to up
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Step 4&lt;/h2&gt;

&lt;p&gt;I use HAML, so I am installing the haml-rails gem, and so we can check if the assets precompilation on deploy works,
I am also building out a minimal app with a HAML view, an image, and a SASS stylesheet. I&amp;rsquo;ve also installed RSpec, and Thin
as the webserver at this point, because that&amp;rsquo;s just how I roll.
&lt;a href="http://github.com/mattvanhorn/placepanda/commits"&gt;You can see the actual commits here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I deploy to Heroku again.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ git push heroku master
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And it all seems to be working.&lt;/p&gt;

&lt;p&gt;I will update this post a little later, as I add more real-world features to the app, and see if we can&amp;rsquo;t keep everything working and happy.&lt;/p&gt;

&lt;h2&gt;Step 5&lt;/h2&gt;

&lt;p&gt;O.K. &amp;ndash; I&amp;rsquo;m back now, and installing the Compass gem and framework.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ compass init rails . --syntax sass
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;edit your Gemfile to include&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gem "compass", "&amp;gt;= 0.12.alpha.3"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;in the :assets group.&lt;/p&gt;

&lt;p&gt;Now, we&amp;rsquo;ve got to move the sass files to where Rails expects them to be, and
also to rename them (to include the &amp;lsquo;.css&amp;rsquo;) for the assets pipeline.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ mv app/stylesheets/screen.sass app/assets/stylesheets/screen.css.sass
$ mv app/stylesheets/print.sass app/assets/stylesheets/print.css.sass
$ mv app/stylesheets/ie.sass app/assets/stylesheets/ie.css.sass
$ rm -rf app/stylesheets
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Also, we need to update the app/config/application.rb to include:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;config.assets.precompile &amp;lt;&amp;lt; /^((.*?)\/)?(?!_)[^\/]*$/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(The idea is that this regex prevents the pre-compilation of partials, because if that is attempted, it
will fail with errors like &amp;ldquo;Undefined mixin &amp;lsquo;blueprint-form&amp;rsquo;&amp;rdquo;)&lt;/p&gt;

&lt;p&gt;I usually put the above line with the regex after the line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;config.assets.enabled = true
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Also, in order to use Compass properly, we need to rearrange our stylesheet folder a bit. I make a folder called&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;app/assets/stylesheets/application
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and I put all my custom stylesheets in there.&lt;/p&gt;

&lt;p&gt;Then I edit app/assets/stylesheets/application.css, and change from:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;*= require_tree .
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;*= require_tree ./application
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This allows the compass stylesheets to render and be included separately, which I prefer.
I wind up with one stylesheet for the framework, and one for the rest of my app. My layout head section looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;%head
  %title Placepanda
  = stylesheet_link_tag 'screen.css', :media =&amp;gt; 'screen, projection'
  = stylesheet_link_tag 'print.css', :media =&amp;gt; 'print'
  /[if IE]
    = stylesheet_link_tag 'ie.css', :media =&amp;gt; 'screen, projection'
  = stylesheet_link_tag    "application"
  = javascript_include_tag "application"
  = csrf_meta_tags
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Naturally, you might want to do this all in one big file, in which case, I suggest not using the folder structure above, and instead
you can just edit the application css to require the files in the right order, as the default alphabetical order is usually non-optimal.
It would probably end up like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;*= require_self
* THE COMPASS STYLES
*= require screen
*
* YOUR STYLES THAT NEED TO BE ORDERED
*= require my_stylesheet
*= require my_other_stylesheet
*
* EVERYTHING ELSE IN THE STYLESHEETS FOLDER
*= require_tree .
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now we can deploy to Heroku again&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ git push heroku master
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and everything should still be peachy.&lt;/p&gt;

&lt;h2&gt;Step 6&lt;/h2&gt;

&lt;p&gt;Installing blueprint.&lt;/p&gt;

&lt;p&gt;If you&amp;rsquo;re following along with the commits on github, at this point, I&amp;rsquo;ve added my basic app functions, and
I just want to style my static pages using blueprint. (The procedure will be similar for other frameworks)&lt;/p&gt;

&lt;p&gt;First in my app directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ compass install blueprint
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And once again we have to move the files that get created into our assets folder and rename them to &amp;lsquo;some-name.css.sass&amp;rsquo;&lt;/p&gt;

&lt;p&gt;After that, we can just deploy again, and everything is still working.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ git push heroku master
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Cleaning Up After Paperclip Cucumber Tests</title>
    <link rel="alternate" href="http://127.0.0.1/2011/11/24/cucumber-paperclip-cleanup/"/>
    <id>http://127.0.0.1/2011/11/24/cucumber-paperclip-cleanup/</id>
    <published>2011-11-24</published>
    <updated>2011-11-24</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;I love using cucumber for acceptance testing, but recently on a personal project
I noticed that I was accumulating files in my public/system directory every time&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I love using cucumber for acceptance testing, but recently on a personal project
I noticed that I was accumulating files in my public/system directory every time
a paperclip step was executed. A little googling got me to
&lt;a href="http://blog.ardes.com/2009/8/4/that-cuking-paperclip"&gt;a solution&lt;/a&gt;, which I&amp;rsquo;ve
adapted below for Rails 3.1&lt;/p&gt;

&lt;p&gt;In features/support/env.rb:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'paperclip'

module Paperclip::Interpolations 
  alias_method :orig_attachment, :attachment 
  def attachment(att, style) 
    "cucumber/" + orig_attachment(att, style) 
  end 
end

After do 
  `rm -rf #{"#{Rails.root}/public/system/cucumber"}`  #remove paperclip files
end
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Story Anti-Patterns 1</title>
    <link rel="alternate" href="http://127.0.0.1/2011/11/06/story-anti-patterns-one/"/>
    <id>http://127.0.0.1/2011/11/06/story-anti-patterns-one/</id>
    <published>2011-11-06</published>
    <updated>2011-11-06</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;This is the first in a series, where I describe some common mistakes made when trying to run an agile team&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;This is the first in a series, where I describe some common mistakes made when trying to run an agile team.&lt;/p&gt;

&lt;h1&gt;Anti-Pattern 1 &amp;ndash; Visual design isn&amp;rsquo;t the whole story.&lt;/h1&gt;

&lt;h2&gt;Example 1 &amp;ndash; &lt;em&gt;the team is using Pivotal Tracker as a to-do list&lt;/em&gt; &lt;/h2&gt;

&lt;blockquote&gt;&lt;h3&gt;Typical Story&lt;/h3&gt;

&lt;blockquote&gt;&lt;p&gt;Add styling to product page.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;In teams that have stories like this, there are probably a few others that look like:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Clicking on product title directs user to to product page&lt;/p&gt;

&lt;p&gt;Product page shows detailed description and product specs&lt;/p&gt;

&lt;p&gt;User clicks buy now button on product page
    &lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;

&lt;h2&gt;Example 2 &amp;ndash; &lt;em&gt;all the business value attached to the wrong thing for the wrong role&lt;/em&gt;&lt;/h2&gt;

&lt;blockquote&gt;&lt;h3&gt;Typical Story&lt;/h3&gt;

&lt;blockquote&gt;&lt;p&gt;As the designer&lt;br/&gt;
I want a well-designed product page&lt;br/&gt;
In order to encourage purchases&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;

&lt;p&gt;Here, the team is trying to find the value, but they are looking in the wrong place for it.
This is an example of thinking about &amp;ldquo;what do I want the user to do?&amp;rdquo; instead of &amp;ldquo;what does the user want to do?&amp;rdquo;&lt;/p&gt;

&lt;h3&gt;Forces leading to the use of this anti-pattern:&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The team is using Pivotal Tracker (or their equivalent tool) to track to-do items, instead of tracking the stakeholder conversations it was meant for.&lt;/li&gt;
&lt;li&gt;The visual designers are not working on the same team as the software developers (stovepiping).&lt;/li&gt;
&lt;li&gt;UI design and graphic asset production is being done in a big-design-up-front fashion.&lt;/li&gt;
&lt;li&gt;The user is lacking representation in the agile process&lt;/li&gt;
&lt;li&gt;The development team feels pressured to put points on the board.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Problems caused by this anti-pattern:&lt;/h3&gt;

&lt;p&gt;When this pattern becomes common, you wind up with an application that spends most of its time not ready for deployment.
If the demo gets rescheduled two weeks earlier, there&amp;rsquo;s a good chance you won&amp;rsquo;t be able to show many features in a complete state.
Punchlists that need to be completed in order to deploy is the opposite of agile practice.&lt;/p&gt;

&lt;p&gt;Another issue this pattern leads to is programmers waiting on designers, or vice versa. Again &amp;ndash; not very agile. This fosters
an us-vs-them mentality that is inimical to getting things done.&lt;/p&gt;

&lt;p&gt;Lastly, when software development is iterating, but UI design and/or production is handled as a page-at-a-time waterfall,
the mismatch leads to gross inefficiencies in how the look &amp;amp; feel gets implemented &amp;ndash; bloated CSS, endless tweaking of styles, etc.&lt;/p&gt;

&lt;h2&gt;Solutions:&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use story templates that enforce business value consideration&lt;/li&gt;
&lt;li&gt;Use iterative development in ui design as well as programming&lt;/li&gt;
&lt;li&gt;Designers and developers work together on the same stories until they are done.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Using better story templates&lt;/h3&gt;

&lt;p&gt;Story templates need to show three important things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business &lt;strong&gt;value&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;role&lt;/strong&gt; that benefits from the value&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;feature&lt;/strong&gt; necessary to provide the value&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The above story could become:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;In order to &lt;em&gt;&lt;strong&gt;more easily make a purchase decision&lt;/strong&gt;&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;&lt;strong&gt;the customer&lt;/strong&gt;&lt;/em&gt;&lt;br/&gt;
wants to see &lt;em&gt;&lt;strong&gt;a well-designed product details page&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Given an existing product named &amp;ldquo;Foo"&lt;br/&gt;
When the customer visits the product page for "Foo"&lt;br/&gt;
Then the customer should see the product details for "Foo"&lt;br/&gt;
And the page should be styled according to the current design specifications for the product page&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Notice that there are no implementation details exposed in the story or scenario. This prevents brittle tests.
The feature is written from a user&amp;rsquo;s point of view, and doesn&amp;rsquo;t concern itself with what the developers consider details,
or what the designers mean by well-designed.&lt;/p&gt;

&lt;p&gt;If what is meant by &amp;ldquo;product details&amp;rdquo; changes, this is a change in requirements that will correctly force a change in
the implementation of the step. However, the feature itself does not need to change, since it is value-driven and focused on the
user&amp;rsquo;s needs. Ideally, what is meant by product details should be centralized, and changed only in one place to update all
the features that rely on it.&lt;/p&gt;

&lt;p&gt;The last step could be implemented using matchers for such ui requirements as:
All headlines should be blue, and all body copy should be 16px high. This then becomes a reusable step that can
help catch look &amp;amp; feel flaws on other pages, as well.&lt;/p&gt;

&lt;p&gt;It can be argued that tests for this sort of thing are excessive, since look and feel changes so often, and maintaining these
tests creates a lot of overhead. I think that perhaps the overhead would encourage more consideration of changes, since the actual
cost of doing them correctly becomes exposed. The alternative is to not care whether the look and feel is correct &amp;ndash; if you do care,
there is work to be done to ensure correctness, whether it is automated or (like most teams) manually reviewed by designers working
over the shoulders of developers, nearly doubling the overhead costs.&lt;/p&gt;

&lt;h3&gt;Iterative UI design&lt;/h3&gt;

&lt;p&gt;There&amp;rsquo;s not enough space or time to go into a full discussion of agile UI development here. I wish there were more resources
online, but unfortunately there is not a lot written on the topic. Briefly, though, UI development should follow many of
the same principles as software development. The UI design can and should be developed in an organic, iterative fashion.
Stories should be deployed as they are completed &amp;ndash; in this system you&amp;rsquo;ll never hear &amp;ldquo;the story is done, but we can&amp;rsquo;t deploy it until
the UI is finished.&amp;rdquo;&lt;/p&gt;

&lt;h3&gt;No More Us-And-Them&lt;/h3&gt;

&lt;p&gt;The UI design team should be an integral part of the development team, and should pair with software engineers to deliver stories. The
pairs can work on establishing what UI elements are needed for a given story, and can add chores to create the actual assets, while using
placeholders in development. Programmer-Designer pairs can go from paper wireframes to HTML prototype to working application code, together.
The agile principle of YAGNI will be critical to making this system work. Design development can also benefit from DRY thinking.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Getting Settled In San Francisco</title>
    <link rel="alternate" href="http://127.0.0.1/2011/11/06/getting-settled-in-sf/"/>
    <id>http://127.0.0.1/2011/11/06/getting-settled-in-sf/</id>
    <published>2011-11-06</published>
    <updated>2011-11-06</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;I&amp;rsquo;ve been in San Francisco for about a month now, and I am finally starting to
feel like I am getting settled. I&amp;rsquo;ve mostly adjusted to the changes in my job,&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I&amp;rsquo;ve been in San Francisco for about a month now, and I am finally starting to
feel like I am getting settled. I&amp;rsquo;ve mostly adjusted to the changes in my job,
and I&amp;rsquo;ve got almost all the furniture I need, and I am back to training jiu
jitsu, although not as frequently as I&amp;rsquo;d like.&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;m going to write a post giving my first impressions of the city, as compared
to NYC, because that seems to be a required post for developers and/or startup
employees. But first, I am working on a story about stories.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>New Blog</title>
    <link rel="alternate" href="http://127.0.0.1/2011/08/03/new-blog/"/>
    <id>http://127.0.0.1/2011/08/03/new-blog/</id>
    <published>2011-08-03</published>
    <updated>2011-08-03</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;I finally decided to stop using Wordpress for this blog, and am now using &lt;a href="https://github.com/cloudhead/toto"&gt;Toto&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It was very easy to get it up and running on Heroku, using &lt;a href="http://www.rubyinside.com/deploy-blog-with-toto-and-heroku-2962.html" title="Deploy A Free, Ruby Powered Blog In 5 Minutes with Toto and Heroku"&gt;instructions&lt;/a&gt; I found at &lt;a href="http://www.rubyinside.com" title="Ruby Inside: The Ruby Blog"&gt;Ruby Inside&lt;/a&gt;&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I finally decided to stop using Wordpress for this blog, and am now using &lt;a href="https://github.com/cloudhead/toto"&gt;Toto&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It was very easy to get it up and running on Heroku, using &lt;a href="http://www.rubyinside.com/deploy-blog-with-toto-and-heroku-2962.html" title="Deploy A Free, Ruby Powered Blog In 5 Minutes with Toto and Heroku"&gt;instructions&lt;/a&gt; I found at &lt;a href="http://www.rubyinside.com" title="Ruby Inside: The Ruby Blog"&gt;Ruby Inside&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I also found &lt;a href="http://patshaughnessy.net/2011/1/23/4-tips-for-how-to-customize-a-toto-blog-site" title="4 tips for how to customize a Toto blog site - Pat Shaughnessy"&gt;this article&lt;/a&gt; on ways to customize it, although I&amp;rsquo;m not taking advantage of this fully, at the moment.&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;ve never been much of a blogger, but I&amp;rsquo;m hoping the simplicity of this setup makes it easier for me to write quick posts like this one about things I like.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Things I Like</title>
    <link rel="alternate" href="http://127.0.0.1/2011/07/21/things-i-like/"/>
    <id>http://127.0.0.1/2011/07/21/things-i-like/</id>
    <published>2011-07-21</published>
    <updated>2011-07-21</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;Programming, Brazilian Jiu Jitsu, Burgers, Beer, etc.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Programming, Brazilian Jiu Jitsu, Burgers, Beer, etc.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Passenger Headaches</title>
    <link rel="alternate" href="http://127.0.0.1/2009/04/02/passenger-headaches/"/>
    <id>http://127.0.0.1/2009/04/02/passenger-headaches/</id>
    <published>2009-04-02</published>
    <updated>2009-04-02</updated>
    <author>
      <name>Matt Van Horn</name>
    </author>
    <summary type="html">&lt;p&gt;I&amp;rsquo;ve been using &lt;a href="http://blog.phusion.nl/"&gt;Phusion Passenger&lt;/a&gt; and Apache2 for a little while as &lt;a href="http://www.fuzzylizard.com/archives/2008/05/29/947/"&gt;my development setup&lt;/a&gt;, since it is hassle free for setting up apps and switching between them. I don&amp;rsquo;t miss typing ./script/server 100 times a day at all&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I&amp;rsquo;ve been using &lt;a href="http://blog.phusion.nl/"&gt;Phusion Passenger&lt;/a&gt; and Apache2 for a little while as &lt;a href="http://www.fuzzylizard.com/archives/2008/05/29/947/"&gt;my development setup&lt;/a&gt;, since it is hassle free for setting up apps and switching between them. I don&amp;rsquo;t miss typing ./script/server 100 times a day at all.
However, Over the last couple of weeks I&amp;rsquo;ve run into a few issues that sidetracked me for more time than they were worth.&lt;/p&gt;

&lt;p&gt;First, I realized that one of my apps that was using &lt;a href="http://www.thoughtbot.com/projects/paperclip"&gt;Thoughtbot&amp;rsquo;s Paperclip&lt;/a&gt; for attachments was no longer making thumbnails, and it wasn&amp;rsquo;t giving me an errors either. In case you are having this problem too, here&amp;rsquo;s the cause and solution (&lt;a href="https://groups.google.com/group/paperclip-plugin/browse_thread/thread/42eb7f12562faf3a?pli=1"&gt;as found here&lt;/a&gt;.)
Apparently mod_rails apps run as the same user as Apache so whatever is in your personal $PATH doesn&amp;rsquo;t carry over. Therefore it is not finding the ImageMagick binaries.
The solution is to create an initializers/paperclip_config.rb file something like:
&lt;code&gt;if RAILS_ENV == &amp;ldquo;development&amp;rdquo;
Paperclip.options[:image_magick_path] = &amp;lsquo;/opt/local/bin/&amp;rsquo;
else
Paperclip.options[:image_magick_path] = &amp;lsquo;/usr/bin/&amp;rsquo;
end&lt;/code&gt;
Now it can find the programs it needs for the thumbnails, and you&amp;rsquo;re back in business.&lt;/p&gt;

&lt;p&gt;The next issue I ran into was with &lt;a href="http://github.com/binarylogic/authlogic/tree/master"&gt;Authlogic&lt;/a&gt;, which is my current favorite authentication solution.
Apparently, when using Passenger 2.0.6 with Rails 2.3.2 and using the cookie session store, you are prevented from logging out. I&amp;rsquo;m not sure why, but &lt;a href="http://github.com/binarylogic/authlogic/commit/495e95e5a2f724e6f1e339c4871168c6c5e6a7ca"&gt;the solution&lt;/a&gt; is either to use the ActiveRecord session, or to upgrade to 2.2.1+ which is what worked for me.&lt;/p&gt;

&lt;p&gt;Now, today I hit another little glitch when using the &lt;a href="http://code.google.com/p/ruby-ole/downloads/list"&gt;ruby-ole&lt;/a&gt; and &lt;a href="http://rubyforge.org/projects/spreadsheet/"&gt;spreadsheet&lt;/a&gt; gems. The gem uses the ruby logger writing to STDERR by default, and it seems that while Mongrel can route the log messages to the right place, Passenger just throws a &amp;ldquo;stream closed&amp;rdquo; error. The solution was just to add the following line to environment.rb
&lt;code&gt;Ole::Log = RAILS_DEFAULT_LOGGER&lt;/code&gt;
Simple enough, but it took me a long time (and a coworker&amp;rsquo;s input) to realize what was going on.&lt;/p&gt;
</content>
  </entry>
</f
