<?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.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DUAFR384eyp7ImA9WhdaFko.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664</id><updated>2011-10-26T21:08:36.133-04:00</updated><category term="ruby" /><category term="ruby rake" /><category term="test" /><category term="embedded" /><category term="webrat" /><category term="wx-nobbie" /><category term="ruby rails github" /><category term="rails" /><category term="mac" /><category term="windows" /><category term="cucumber" /><category term="quotes" /><category term="github" /><category term="heroku" /><category term="bdd" /><category term="wxruby" /><category term="sqlite3" /><title>Bryan Ash</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://bryan-ash.blogspot.com/" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/BryanAsh" /><feedburner:info uri="bryanash" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DkEFQ3Y9eip7ImA9Wx9SF0o.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-555236052749571240</id><published>2010-12-05T22:45:00.010-05:00</published><updated>2010-12-07T21:16:52.862-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-07T21:16:52.862-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby rails github" /><title>Providing markdown engine options in HAML</title><content type="html">I've started looking into using &lt;a href="http://daringfireball.net/projects/markdown/"&gt;Markdown&lt;/a&gt; in &lt;a href="http://www.rubyonrails.org/"&gt;Rails&lt;/a&gt;.  I use &lt;a href="http://haml-lang.com"&gt;HAML&lt;/a&gt; for rendering views, so markdown is handled by a HAML filter:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;%h1 Here's some rendered Markdown
  :markdown
    = @model.markdown
&lt;/pre&gt;&lt;br /&gt;
This worked great, but I was concerned about javascript injection since the markdown would be provided by a user using a &lt;a href="https://github.com/derobins/wmd"&gt;WMD editor&lt;/a&gt;.  I found that I could explicitly call RDiscount, with the :filter_html option, to render the markdown myself:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;%h1 Here's some rendered Markdown
  != RDiscount.new(@model.markdown, :filter_html).to_html
&lt;/pre&gt;&lt;br /&gt;
This worked great, but I didn't want to have to remember this incantation every time I want to render some Markdown.  After some discussion with &lt;a href="https://github.com/nex3"&gt;Nathan Weizenbaum&lt;/a&gt; the current maintainer of Haml, I realized that the answer is actually presented (somewhat indirectly) through the documentation.  The section on &lt;a href="http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#filters"&gt;Custom Filters&lt;/a&gt; says "You can also define your own filters. See &lt;a href="http://haml-lang.com/docs/yardoc/Haml/Filters.html"&gt;Haml::Filters&lt;/a&gt; for details.".  You have to then follow on to &lt;a href="http://haml-lang.com/docs/yardoc/Haml/Filters/Base.html"&gt;Haml::Filters::Base&lt;/a&gt; for the full story.&lt;br /&gt;
&lt;br /&gt;
In my Rails app, I created a custom Haml filter that overrides the original :markdown (so I don't accidentally forget and use an unsafe :markdown) config/initializers/haml.rb:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="ruby" name="code"&gt;module MyApp
  module Filters
    module Markdown
      include Haml::Filters::Base
      lazy_require 'rdiscount'

      def render(text)
        ::RDiscount.new(text, :filter_html).to_html
      end
    end
  end
end
&lt;/pre&gt;&lt;br /&gt;
Now, whenever HAML renders a :markdown filter, it will filter the HTML and protect me against javascript injection attacks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-555236052749571240?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=v5FkZIYXaF8:CSi_McFl_-Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=v5FkZIYXaF8:CSi_McFl_-Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=v5FkZIYXaF8:CSi_McFl_-Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/v5FkZIYXaF8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/555236052749571240/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2010/12/providing-markdown-engine-options-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/555236052749571240?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/555236052749571240?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/v5FkZIYXaF8/providing-markdown-engine-options-in.html" title="Providing markdown engine options in HAML" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2010/12/providing-markdown-engine-options-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MCSHs_eSp7ImA9Wx9SE0k.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-885593172000081371</id><published>2010-12-02T20:57:00.000-05:00</published><updated>2010-12-02T20:57:49.541-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-02T20:57:49.541-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="heroku" /><title>Stop deploying unneccessary Gems in your Heroku slug</title><content type="html">&lt;a href="http://heroku.com/"&gt;Heroku&lt;/a&gt; published a handy tip in their newsletter today:&lt;br /&gt;
&lt;pre class="shell" name="code" style="background-color: black; color: white; font-family: "Courier New,Courier,monospace;"&gt;$ heroku config:add BUNDLE_WITHOUT=development:test
&lt;/pre&gt;Having set this and pushed a change to my Gemfile, my slug size went from 39.4MB down to 10.9MB.&lt;br /&gt;
&lt;br /&gt;
Smaller slugs compile and load faster.&lt;br /&gt;
&lt;br /&gt;
Thank you Heroku!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-885593172000081371?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=zbISCSqLC5M:zvwC-tGtOh8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=zbISCSqLC5M:zvwC-tGtOh8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=zbISCSqLC5M:zvwC-tGtOh8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/zbISCSqLC5M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/885593172000081371/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2010/12/stop-deploying-unneccessary-gems-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/885593172000081371?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/885593172000081371?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/zbISCSqLC5M/stop-deploying-unneccessary-gems-in.html" title="Stop deploying unneccessary Gems in your Heroku slug" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2010/12/stop-deploying-unneccessary-gems-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QCRXw4fSp7ImA9Wx9SE04.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-8672189856638203232</id><published>2010-11-22T16:44:00.001-05:00</published><updated>2010-12-02T20:22:44.235-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-02T20:22:44.235-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby rake" /><title>Rake duplicate task descriptions</title><content type="html">Using Rake I can define tasks that get added to a collection of tasks for execution.&amp;nbsp; For example:&lt;br /&gt;
&lt;pre class="ruby" name="code"&gt;desc "one"
task :one do
  puts "one"
end

desc "all"
task :all =&amp;gt; [:one]

desc "two"
task :two do
  puts "two"
end

desc "all"
task :all =&amp;gt; [:two]
&lt;/pre&gt;&lt;br /&gt;
Now, if I look at &lt;b&gt;rake --tasks&lt;/b&gt; I will see:&lt;br /&gt;
&lt;pre class="shell" name="code" style="background-color: black; color: white; font-family: "Courier New,Courier,monospace;"&gt;&amp;gt; rake --tasks
rake one     # one
rake two     # two
rake all     # all / all&lt;/pre&gt;&lt;br /&gt;
Rake has duplicated the description for the :all task.  Looking at the code for Rake I discovered that this can be avoided by terminating the :all task description with a period:&lt;br /&gt;
&lt;pre class="ruby" name="code"&gt;desc "one"
desc "all."
task :all =&amp;gt; [:one]

desc "one"
desc "all."
task :all =&amp;gt; [:one]
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="shell" name="code" style="background-color: black; color: white; font-family: "Courier New,Courier,monospace;"&gt;&amp;gt; rake --tasks
rake one     # one
rake two     # two
rake all     # all.&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-8672189856638203232?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=ZZ2dB-SvlOQ:0IvevvMKo8w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=ZZ2dB-SvlOQ:0IvevvMKo8w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=ZZ2dB-SvlOQ:0IvevvMKo8w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/ZZ2dB-SvlOQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/8672189856638203232/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2010/11/rake-duplicate-task-descriptions.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/8672189856638203232?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/8672189856638203232?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/ZZ2dB-SvlOQ/rake-duplicate-task-descriptions.html" title="Rake duplicate task descriptions" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2010/11/rake-duplicate-task-descriptions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4CRHgycCp7ImA9WxNUFk8.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-5388337764405985462</id><published>2009-11-07T14:25:00.002-05:00</published><updated>2009-11-07T14:59:25.698-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-07T14:59:25.698-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mac" /><title>Blogging software for Mac</title><content type="html">&lt;p&gt;I used to use Windows Live Writer in the old days but now I'm a trendy Mac user I need something suitable.&amp;nbsp; Seems like there are a number of paid options that people rate quite highly but I'm too cheap to pay for software.
&lt;/p&gt;
&lt;p&gt;
I just tried Quamana and it looked promising.&amp;nbsp; Unfortunately it kept throwing errors, didn't download tags from Blogger and then failed to actually publish the post!
&lt;/p&gt;
&lt;p&gt;
I'm now trying Flock which is a full featured browser built on the same stuff as Firefox, that happens to have a blog editor built in.&amp;nbsp; I don't think it's as clean as Live Writer, but appears to have enough functionality for my basic use.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-5388337764405985462?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=xaYX_iz7v-o:gZoIzptGE9g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=xaYX_iz7v-o:gZoIzptGE9g:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=xaYX_iz7v-o:gZoIzptGE9g:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/xaYX_iz7v-o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/5388337764405985462/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/11/blogging-software-for-mac.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/5388337764405985462?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/5388337764405985462?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/xaYX_iz7v-o/blogging-software-for-mac.html" title="Blogging software for Mac" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/11/blogging-software-for-mac.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAAR3Y9eCp7ImA9WxBaEE8.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-8187278569777746131</id><published>2009-11-07T10:13:00.001-05:00</published><updated>2010-03-19T14:35:46.860-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-19T14:35:46.860-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mac" /><title>MacBook Pro AirPort autoconnect</title><content type="html">We just installed a new wireless router with WPA security (with the last one we were using WEP).&amp;nbsp; My MacBook Pro connected just fine first time.&amp;nbsp; The problem was that whenever I close the lid and reopen, the Airport would not automatically connect, it would ask me which network to connect to.&lt;br /&gt;
&lt;br /&gt;
The surprising solution was to move &lt;b&gt;/Applications/Utilities/&lt;/b&gt;&lt;b&gt;System Preferences.app&lt;/b&gt; into &lt;b&gt;/Applications/System Preferences.app&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Now AirPort reconnects all by itself every time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-8187278569777746131?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=5n24V48V1HU:JatJD3TQw8w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=5n24V48V1HU:JatJD3TQw8w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=5n24V48V1HU:JatJD3TQw8w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/5n24V48V1HU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/8187278569777746131/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/11/macbook-pro-airport-autoconnect.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/8187278569777746131?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/8187278569777746131?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/5n24V48V1HU/macbook-pro-airport-autoconnect.html" title="MacBook Pro AirPort autoconnect" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/11/macbook-pro-airport-autoconnect.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEINRHY7cSp7ImA9WxJVEEo.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-2318714071841395237</id><published>2009-06-27T00:23:00.001-04:00</published><updated>2009-06-27T00:23:15.809-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-27T00:23:15.809-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><title>Using simple_auto_complete</title><content type="html">&lt;p&gt;I'm working on my first public Rails application for managing small skydiving businesses.&amp;#160; The primary feature is to track when a person gets in an aircraft to make a skydive.&amp;#160; In skydiver speak, that's: &amp;quot;Jumpers are manifested in a Slot on a Load&amp;quot;. I'm using a model named Account to hold Jumpers, Pilots and in fact anyone who does business with the dropzone.&lt;/p&gt; So, My models look like:   &lt;pre class="ruby" name="code"&gt;class Load &amp;lt; ActiveRecord::Base
  has_many :slots, :dependent =&amp;gt; :destroy
end&lt;/pre&gt;
and: 

&lt;pre class="ruby" name="code"&gt;class Slot &amp;lt; ActiveRecord::Base
  belongs_to :account
end&lt;/pre&gt;
The form for editing a load contains: 

&lt;pre class="html" name="code"&gt;&amp;lt;%= render :partial =&amp;gt; 'slot', :collection =&amp;gt; @load.slots %&amp;gt;&lt;/pre&gt;
and the _slots.html.erb partial contains something like: 

&lt;pre class="html" name="code"&gt;&amp;lt;% fields_for &amp;quot;load[slot_attributes][]&amp;quot;, slot do |slot_form| -%&amp;gt;
  &amp;lt;%= slot_form.label :account_name, 'Jumper:' %&amp;gt;
  &amp;lt;%= slot_form.text_field :account_name %&amp;gt;
&amp;lt;% end -%&amp;gt;&lt;/pre&gt;

&lt;p&gt;This all works great, so it's time for a little flair ... what I'd like is for the Account.name field to present a list of accounts that match the text that I've typed so far and allow me to pick one (like the Google search field does these days).&lt;/p&gt;

&lt;h3&gt;Enter &lt;a href="http://github.com/grosser/simple_auto_complete/tree"&gt;simple_auto_complete&lt;/a&gt;.&lt;/h3&gt;

&lt;p&gt;The instructions in the README describe the steps to get the simplest example working but left me scratching my head.&amp;#160; What I needed was the following...&lt;/p&gt;

&lt;p&gt;In SlotsController (something I didn't even need before):&lt;/p&gt;

&lt;pre class="ruby" name="code"&gt;class SlotsController &amp;lt; ApplicationController
  autocomplete_for :account, :name, :order =&amp;gt; 'name ASC'
end&lt;/pre&gt;

&lt;p&gt;in _slot.html.erb, I changed to: &lt;/p&gt;

&lt;pre class="html" name="code"&gt;&amp;lt;% fields_for &amp;quot;load[slot_attributes][]&amp;quot;, slot do |slot_form| -%&amp;gt;
  &amp;lt;%= slot_form.label :account_name, 'Jumper:' %&amp;gt;
  &amp;lt;%= slot_form.text_field :account_name, :class =&amp;gt; 'autocomplete', 
      :autocomplete_url =&amp;gt; autocomplete_for_account_name_slots_path %&amp;gt;
&amp;lt;% end -%&amp;gt;&lt;/pre&gt;
I updated my routes.rb to include: 

&lt;pre class="ruby" name="code"&gt;map.resources :slots, :collection =&amp;gt; { :autocomplete_for_account_name =&amp;gt; :get}&lt;/pre&gt;
Finally, I added to my application.html.erb layout: 

&lt;pre class="ruby" name="code"&gt;&amp;lt;%= stylesheet_link_tag 'site', 'jquery.autocomplete' %&amp;gt;
&amp;lt;%= javascript_include_tag 'jquery', 'jquery.autocomplete', 'application', 'prototype' %&amp;gt;&lt;/pre&gt;
And it works like a champ! 

  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-2318714071841395237?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=1Bcgjyi2MIo:YqjrcZ1LIMQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=1Bcgjyi2MIo:YqjrcZ1LIMQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=1Bcgjyi2MIo:YqjrcZ1LIMQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/1Bcgjyi2MIo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/2318714071841395237/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/06/using-simpleautocomplete.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/2318714071841395237?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/2318714071841395237?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/1Bcgjyi2MIo/using-simpleautocomplete.html" title="Using simple_auto_complete" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/06/using-simpleautocomplete.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMHRH05eCp7ImA9WxVWGE0.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-6296280093149767239</id><published>2009-02-28T03:07:00.001-05:00</published><updated>2009-02-28T03:07:15.320-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-28T03:07:15.320-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sqlite3" /><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><title>Permission denied - db/test.sqlite3</title><content type="html">I'm investigating creating a plugin for &lt;a href="http://www.redmine.org/"&gt;Redmine&lt;/a&gt; and having a good old time when I decide to clear out the test database:   &lt;p&gt;C:\dev\redmine&amp;gt;rake db:test:purge   &lt;br /&gt;(in C:/dev/redmine)    &lt;br /&gt;rake aborted!    &lt;br /&gt;&lt;font color="#ff0000"&gt;Permission denied - db/test.sqlite3&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Boo!&amp;#160; &lt;/p&gt;  &lt;p&gt;I don't know what made me think of it but I tried unsetting my RAILS_ENV environment variable (I had it set to &amp;quot;test&amp;quot;):&lt;/p&gt;  &lt;p&gt;C:\dev\redmine&amp;gt;set rails_env= &lt;/p&gt;  &lt;p&gt;C:\dev\redmine&amp;gt;rake db:test:purge   &lt;br /&gt;(in C:/dev/redmine) &lt;/p&gt;  &lt;p&gt;C:\dev\redmine&amp;gt;&lt;/p&gt;  &lt;p&gt;Hurrah!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-6296280093149767239?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=XhSnRJLmNFA:7YdNJuiJTKM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=XhSnRJLmNFA:7YdNJuiJTKM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=XhSnRJLmNFA:7YdNJuiJTKM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/XhSnRJLmNFA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/6296280093149767239/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/02/permission-denied-dbtestsqlite3.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/6296280093149767239?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/6296280093149767239?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/XhSnRJLmNFA/permission-denied-dbtestsqlite3.html" title="Permission denied - db/test.sqlite3" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/02/permission-denied-dbtestsqlite3.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8FQHk_fyp7ImA9WxVWE0w.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-852525474720528066</id><published>2009-02-22T11:06:00.001-05:00</published><updated>2009-02-22T11:06:51.747-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-22T11:06:51.747-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="github" /><title>Formatting README.rdoc on github</title><content type="html">Github has a neat feature that displays a README file, that it finds in the root directory of a project, on the project page.  The &lt;a href="http://github.com/guides/readme-formatting"&gt;README formatting&lt;/a&gt; page describes a number of different formats that it will render based on the file extension.  I tried renaming to README.rdoc but it still rendered as plain text.  The trouble was that the file was intended to be used with a full RDOC site for the source.  When I removed the "link" tags from the file and pushed ... Github renders it correctly ... Hurrah!   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-852525474720528066?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=uccIrrlT9lQ:ytowsyBHshQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=uccIrrlT9lQ:ytowsyBHshQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=uccIrrlT9lQ:ytowsyBHshQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/uccIrrlT9lQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/852525474720528066/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/02/formatting-readmerdoc-on-github.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/852525474720528066?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/852525474720528066?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/uccIrrlT9lQ/formatting-readmerdoc-on-github.html" title="Formatting README.rdoc on github" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>6</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/02/formatting-readmerdoc-on-github.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMESHc8fSp7ImA9WxVXFko.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-7013701348852249376</id><published>2009-02-14T22:57:00.002-05:00</published><updated>2009-02-14T23:00:09.975-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-14T23:00:09.975-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wxruby" /><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="cucumber" /><category scheme="http://www.blogger.com/atom/ns#" term="wx-nobbie" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="bdd" /><title>BDD WxRuby applications with Cucumber and Nobbie</title><content type="html">&lt;p&gt;For a long time now, I've been wanting to write some &lt;a href="http://github.com/aslakhellesoy/cucumber/tree"&gt;Cucumber&lt;/a&gt; features to describe a &lt;a href="http://wxruby.rubyforge.org/wiki/wiki.pl"&gt;WxRuby&lt;/a&gt; application I have. A couple of weeks ago, I found a library called wx-nobbie on Rubyforge that seems to be almost exactly what I was looking for.&amp;#160; It provides a simple, high level interface for driving WxRuby applications through commands like &amp;quot;click&amp;quot;, &amp;quot;choose&amp;quot; and &amp;quot;type&amp;quot;.&amp;#160; I had a little trouble getting the tests to pass to start with, but with a few minor tweaks I got there.&amp;#160; I contacted the original author and got his permission to take it forward.&lt;/p&gt;  &lt;p&gt;I created a GitHub repository for &lt;a href="http://github.com/bryan-ash/wx-nobbie/tree"&gt;Wx-Nobbie&lt;/a&gt; and have made a few updates over the last week.&amp;#160; Currently, I've got 4 feature scenarios with 10 steps:&lt;/p&gt;  &lt;pre&gt;C:\dev\wx-nobbie&amp;gt;rake features
(in C:/dev/wx-nobbie)
In order to test drive a WxRuby application  # features/acceptance_test.feature
As a developer
I want Nobbie to provide acceptance test access to the application
  &lt;font color="green"&gt;Scenario: Choosing a radio button&lt;/font&gt;  # features/acceptance_test.feature:5
    &lt;font color="green"&gt;Then &amp;quot;radio_button&amp;quot; is not chosen&lt;/font&gt;# features/step_definitions/acceptance_test_steps.rb:21
    &lt;font color="green"&gt;When I choose &amp;quot;radio_button&amp;quot;&lt;/font&gt;     # features/step_definitions/acceptance_test_steps.rb:1
    &lt;font color="green"&gt;Then &amp;quot;radio_button&amp;quot; is chosen&lt;/font&gt;    # features/step_definitions/acceptance_test_steps.rb:17

  &lt;font color="green"&gt;Scenario: Choosing a check box&lt;/font&gt;  # features/acceptance_test.feature:10
    &lt;font color="green"&gt;Then &amp;quot;check_box&amp;quot; is not chosen&lt;/font&gt;# features/step_definitions/acceptance_test_steps.rb:21
    &lt;font color="green"&gt;When I choose &amp;quot;check_box&amp;quot;&lt;/font&gt;     # features/step_definitions/acceptance_test_steps.rb:1
    &lt;font color="green"&gt;Then &amp;quot;check_box&amp;quot; is chosen&lt;/font&gt;    # features/step_definitions/acceptance_test_steps.rb:17

  &lt;font color="green"&gt;Scenario: Type into a text control&lt;/font&gt;        # features/acceptance_test.feature:15
    &lt;font color="green"&gt;When I type &amp;quot;123&amp;quot; into &amp;quot;text_ctrl&amp;quot;&lt;/font&gt;      # features/step_definitions/acceptance_test_steps.rb:5
    &lt;font color="green"&gt;Then I should see &amp;quot;123&amp;quot; in &amp;quot;text_ctrl&amp;quot;&lt;/font&gt;  # features/step_definitions/acceptance_test_steps.rb:9

  &lt;font color="green"&gt;Scenario: Type into a combo box&lt;/font&gt;           # features/acceptance_test.feature:19
    &lt;font color="green"&gt;When I type &amp;quot;456&amp;quot; into &amp;quot;combo_box&amp;quot;&lt;/font&gt;      # features/step_definitions/acceptance_test_steps.rb:5
    &lt;font color="green"&gt;Then I should see &amp;quot;456&amp;quot; in &amp;quot;combo_box&amp;quot;&lt;/font&gt;  # features/step_definitions/acceptance_test_steps.rb:9


4 scenarios
&lt;font color="green"&gt;10 steps passed&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;With just these 4 scenarios, RCov tells me I have 62.9% coverage. &lt;/p&gt;

&lt;p&gt;Hurrah! &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-7013701348852249376?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=LyFlhKz8okA:6-z__vcexlE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=LyFlhKz8okA:6-z__vcexlE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=LyFlhKz8okA:6-z__vcexlE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/LyFlhKz8okA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/7013701348852249376/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/02/bdd-wxruby-applications-with-cucumber.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/7013701348852249376?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/7013701348852249376?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/LyFlhKz8okA/bdd-wxruby-applications-with-cucumber.html" title="BDD WxRuby applications with Cucumber and Nobbie" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/02/bdd-wxruby-applications-with-cucumber.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UDRn46eip7ImA9WxVbEkU.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-4588263150785248545</id><published>2009-01-25T10:29:00.002-05:00</published><updated>2009-03-28T20:07:57.012-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-28T20:07:57.012-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="test" /><title>Building a Ruby Extension With Visual C++ Express 2008</title><content type="html">&lt;span style="font-style:italic;"&gt;Edit March 29, 2009: While the instructions below describe how to build the Win32::GuiTest extension, I didn't get very far with using it before I found &lt;a href="http://github.com/bryan-ash/wx-nobbie/tree"&gt;Wx::Nobbie&lt;/a&gt; which I much prefer and have taken up the maintenance of at Github.&lt;/span&gt;
&lt;p&gt;I'd like to be able to use Cucumber to drive the development of Windows applications so I went looking for something like Webrat for desktop GUI's. I found &lt;a href="http://raa.ruby-lang.org/project/win32-guitest/"&gt;Win32::GuiTest&lt;/a&gt;.&amp;#160; There is a project of the same name on RubyForge that contains the same source but that's as far as that went.&amp;#160; &lt;/p&gt;  &lt;p&gt;Win32::GuiTest is a C extension that was compiled with Cygwin, so I wanted to rebuild a native version.&amp;#160; I found some instructions on &lt;a href="http://www.kleinfelter.com/build-ruby-guitest-win32"&gt;Kevin Kleinfelter's blog&lt;/a&gt; that look much like below, but using VC++ 2008 I got to skip a couple of steps:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Download and install &lt;a href="http://www.microsoft.com/express/vc/"&gt;Visual C++ Express Edition&lt;/a&gt; (this is free, I got the 2008 version) &lt;/li&gt;    &lt;li&gt;Edit $RUBY_HOME/lib/ruby/1.8/i386-mswin32/config.h and delete the “#error MSC version unmatch” line &lt;/li&gt;    &lt;li&gt;Open a Visual Studio 2008 Command Prompt      &lt;ul&gt;       &lt;li&gt;Start &lt;/li&gt;        &lt;li&gt;All Programs &lt;/li&gt;        &lt;li&gt;Microsoft Visual C++ 2008 Express Edition &lt;/li&gt;        &lt;li&gt;Visual Studio Tools &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;cd C:\temp\guitest020218\ext\cguitest      &lt;ul&gt;       &lt;li&gt;I'm building the guitest extension &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;ruby extconf.rb &lt;/li&gt;    &lt;li&gt;nmake &lt;/li&gt;    &lt;li&gt;mt.exe -manifest cguitest.so.manifest -outputresource:cguitest.so;2      &lt;ul&gt;       &lt;li&gt;Copy and paste the command above. You need it all from the 'mt' to the ';2' &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;nmake install &lt;/li&gt;    &lt;li&gt;cd \temp\guitest020218 &lt;/li&gt;    &lt;li&gt;ruby install.rb config &lt;/li&gt;    &lt;li&gt;ruby install.rb install &lt;/li&gt;    &lt;li&gt;To test:      &lt;ul&gt;       &lt;li&gt;irb &lt;/li&gt;     &lt;/ul&gt;      &lt;ul&gt;       &lt;li&gt;require 'win32/guitest' &lt;/li&gt;        &lt;li&gt;check response is '=&amp;gt; true' &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-4588263150785248545?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=g_BM4KKdUAE:wL8ImtCnhrg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=g_BM4KKdUAE:wL8ImtCnhrg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=g_BM4KKdUAE:wL8ImtCnhrg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/g_BM4KKdUAE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/4588263150785248545/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/01/building-ruby-extension-with-visual-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/4588263150785248545?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/4588263150785248545?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/g_BM4KKdUAE/building-ruby-extension-with-visual-c.html" title="Building a Ruby Extension With Visual C++ Express 2008" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/01/building-ruby-extension-with-visual-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ICRn86fip7ImA9WxVREE8.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-8045940159935174106</id><published>2009-01-14T23:01:00.002-05:00</published><updated>2009-01-15T08:19:27.116-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-15T08:19:27.116-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="test" /><title>My first Rails bug – accepted!</title><content type="html">&lt;p&gt;At the time that I posted about &lt;a href="http://bryan-ash.blogspot.com/2008/09/my-first-rails-bug.html"&gt;My first Rails bug&lt;/a&gt; the tests that existed for Action Pack contained failures and the only test in integration_upload_test.rb was:&lt;/p&gt;  &lt;pre class="ruby" name="code"&gt;assert_equal(:multipart_form, SessionUploadTest.last_request_type)&lt;/pre&gt;

&lt;p&gt;I felt that my change could be submitted with no tests because:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The change was trivial (6 characters) &lt;/li&gt;

  &lt;li&gt;The change was for a well known Windows file issue &lt;/li&gt;

  &lt;li&gt;The tests that existed didn’t pass &lt;/li&gt;

  &lt;li&gt;There were no example tests for me to build on &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Three months after I submitted the &lt;a href="http://rails.lighthouseapp.com/projects/8994/tickets/1065-multipart_body-truncates-file-in-windows"&gt;ticket&lt;/a&gt;, &lt;a href="http://rails.lighthouseapp.com/users/1366"&gt;Pratik&lt;/a&gt; dismissed it by changing its state to &lt;strong&gt;incomplete&lt;/strong&gt; with the comment “Missing a test case.”&amp;#160; Are these guys CRAZY?&amp;#160; No, no they are not.&amp;#160; Just because there were &lt;a href="http://www.pragprog.com/the-pragmatic-programmer/extracts/software-entropy"&gt;broken windows&lt;/a&gt; in the neighborhood did not give me the right to break any more.&lt;/p&gt;

&lt;p&gt;So, I sucked it up, cloned the latest rails repository again and to my surprise … all the Action Pack tests passed! … and there was a nice simple example in multipart_params_parsing_test.rb:&lt;/p&gt;

&lt;pre class="ruby" name="code"&gt;  test &amp;quot;uploads and reads file&amp;quot; do
    with_test_routing do
      post '/read', :uploaded_data =&amp;gt; fixture_file_upload(FIXTURE_PATH + &amp;quot;/hello.txt&amp;quot;, &amp;quot;text/plain&amp;quot;)
      assert_equal &amp;quot;File: Hello&amp;quot;, response.body
    end
  end&lt;/pre&gt;

&lt;p&gt;This is too easy!&amp;#160; I added a test for my issue:&lt;/p&gt;

&lt;pre class="ruby" name="code"&gt;  test &amp;quot;uploads and reads a binary file in windows&amp;quot; do
    with_test_routing do
      fixture_file = FIXTURE_PATH + &amp;quot;/mona_lisa.jpg&amp;quot;
      post '/read', :uploaded_data =&amp;gt; fixture_file_upload(fixture_file, &amp;quot;image/jpg&amp;quot;)
      assert_equal 'File: '.length + File.size(fixture_file), response.content_length
    end
  end&lt;/pre&gt;

&lt;p&gt;Watched it fail.&amp;#160; Added the magic 6 characters (“, ‘rb’”).&amp;#160; Watched it pass.&amp;#160; Wrapped it up and shipped it off.&amp;#160; The following morning I pick up an email letting me know that Pratik has reopened the ticket and assigned it to &lt;a href="http://rails.lighthouseapp.com/users/424"&gt;Joshua Peek&lt;/a&gt; for review.&amp;#160; The change was committed before the day was out!&lt;/p&gt;

&lt;p&gt;Many thanks to Pratik and Josh for attending to this so promptly.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-8045940159935174106?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=u7KOtdXTgK8:8vtJ8E-j4Qc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=u7KOtdXTgK8:8vtJ8E-j4Qc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=u7KOtdXTgK8:8vtJ8E-j4Qc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/u7KOtdXTgK8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/8045940159935174106/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/01/my-first-rails-bug-accepted.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/8045940159935174106?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/8045940159935174106?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/u7KOtdXTgK8/my-first-rails-bug-accepted.html" title="My first Rails bug – accepted!" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/01/my-first-rails-bug-accepted.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YNRnYzfip7ImA9WxVSGEk.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-6710261044071847390</id><published>2009-01-12T22:13:00.002-05:00</published><updated>2009-01-13T07:19:57.886-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-13T07:19:57.886-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="cucumber" /><category scheme="http://www.blogger.com/atom/ns#" term="bdd" /><title>Restful-Authentication with Cucumber features (Step 2)</title><content type="html">&lt;p&gt;Knowing that all the stories that ship with restful-authentication pass, I’m ready to convert to Cucumber features.&amp;#160; The process is actually fairly simple and is described quite clearly on this Cucumber &lt;a href="http://wiki.github.com/aslakhellesoy/cucumber/migration-from-rspec-stories"&gt;wiki page&lt;/a&gt;.&amp;#160; I did have to tweak a couple of the step matchers and create ra_env.rb:&lt;/p&gt;  &lt;pre class="ruby" name="code"&gt;Before do
  Fixtures.reset_cache
  fixtures_folder = File.join(RAILS_ROOT, 'spec', 'fixtures')
  Fixtures.create_fixtures(fixtures_folder, &amp;quot;users&amp;quot;)
end
 
# Make visible for testing
ApplicationController.send(:public, :logged_in?, :current_user, :authorized?)&lt;/pre&gt;

&lt;p&gt;I’d have liked to put this in the support directory but Cucumber loaded it before env.rb, so I put in with the step_definitions.&lt;/p&gt;

&lt;p&gt;Once that was done, all that was left was to update authenticated_generator.rb to copy the template features instead of stories.&lt;/p&gt;

&lt;p&gt;The result is available from &lt;a href="http://github.com/bryan-ash/restful-authentication/tree"&gt;my fork&lt;/a&gt; on github.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-6710261044071847390?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=VATN83tM75g:zappiPQyiMg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=VATN83tM75g:zappiPQyiMg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=VATN83tM75g:zappiPQyiMg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/VATN83tM75g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/6710261044071847390/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/01/restful-authentication-with-cucumber_12.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/6710261044071847390?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/6710261044071847390?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/VATN83tM75g/restful-authentication-with-cucumber_12.html" title="Restful-Authentication with Cucumber features (Step 2)" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/01/restful-authentication-with-cucumber_12.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cGQno5eyp7ImA9WxVSFkw.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-3495749242750219434</id><published>2009-01-10T12:18:00.004-05:00</published><updated>2009-01-10T13:10:23.423-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-10T13:10:23.423-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="cucumber" /><category scheme="http://www.blogger.com/atom/ns#" term="bdd" /><title>Restful-Authentication with Cucumber features (Step 1)</title><content type="html">My latest exercise is to update the &lt;a href="http://github.com/technoweenie/restful-authentication/tree"&gt;restful-authentication&lt;/a&gt; Rails plugin to generate &lt;a href="http://github.com/aslakhellesoy/cucumber/tree"&gt;Cucumber&lt;/a&gt; features instead of RSpec stories.

There is already a &lt;a href="http://rails_security.lighthouseapp.com/projects/15332/tickets/23-use-cucumber-features-instead-of-rspec-stories"&gt;Lighthouse ticket&lt;/a&gt; open for this, so I guess I'm not the first one to think of it.

The first steps make sure that restful-authentication is set up correctly:&lt;ol&gt;
&lt;li&gt;Create an empty Rails application&lt;/li&gt;&lt;li&gt;Put in version control (git init, git add ., git commit -a -m "init")&lt;/li&gt;&lt;li&gt;Add plugins as shown on the Cucumber &lt;a href="http://wiki.github.com/aslakhellesoy/cucumber/ruby-on-rails"&gt;Rails wiki page&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Add &lt;a href="http://github.com/bryan-ash/restful-authentication/tree"&gt;my fork&lt;/a&gt; of restful-authentication in the same manner&lt;/li&gt;&lt;li&gt;Complete the restful-authentication installation per the directions&lt;/li&gt;&lt;li&gt;Create the database tables (rake db:migrate)&lt;/li&gt;&lt;li&gt;Run the RSpec stories (stories\rest_auth_stories.rb)&lt;/li&gt;&lt;/ol&gt;

Stories won't even run, let alone pass!  I'm not going to show all the errors along the way, but the steps to get to passing stories were:&lt;ol&gt;&lt;li&gt;Added AthenticatedSystem into ApplicationController with the following 2 lines:&lt;pre name="code" class="ruby"&gt;  include AuthenticatedSystem
  helper :all # include all helpers, all the time&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Uncommented the routes.rb map.root line(map.root :controller =&gt; "welcome")&lt;/li&gt;&lt;li&gt;Removed line 1 of user_steps.rb (require File.dirname(__FILE__) + '/../helper')&lt;/li&gt;&lt;li&gt;Created a minimal WelcomeController with an index method&lt;/li&gt;&lt;li&gt;Created a minimal layout&lt;/li&gt;&lt;/ol&gt;

&lt;pre name="code" class="ruby"&gt;16 scenarios: 16 succeeded, 0 failed, 0 pending&lt;/pre&gt;

Hurrah!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-3495749242750219434?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=0VuHn2aU9fY:JREu2ezs12w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=0VuHn2aU9fY:JREu2ezs12w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=0VuHn2aU9fY:JREu2ezs12w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/0VuHn2aU9fY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/3495749242750219434/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2009/01/restful-authentication-with-cucumber.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/3495749242750219434?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/3495749242750219434?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/0VuHn2aU9fY/restful-authentication-with-cucumber.html" title="Restful-Authentication with Cucumber features (Step 1)" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2009/01/restful-authentication-with-cucumber.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYBR34ycSp7ImA9WxRXFEo.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-3207913781298910741</id><published>2008-10-19T21:18:00.007-04:00</published><updated>2008-10-19T22:35:56.099-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-19T22:35:56.099-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="webrat" /><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="cucumber" /><category scheme="http://www.blogger.com/atom/ns#" term="bdd" /><title>Cucumber scenarios need a title</title><content type="html">So I'm playing with &lt;a href="http://dannorth.net/introducing-bdd"&gt;Behavior Driven Development&lt;/a&gt; (BDD) and Ruby on Rails using &lt;a href="http://github.com/aslakhellesoy/cucumber/wikis/home"&gt;Cucumber&lt;/a&gt; and &lt;a href="http://github.com/brynary/webrat"&gt;Webrat&lt;/a&gt;.  I thought I'd start with the simplest feature I could think of, "I want to see the application name in the title". So, off we go with features/site_layout.feature:
&lt;pre name="code" class="feature"&gt;
Feature: Site Layout
  In order to build familiarity
  As a user
  I want to see the application name in the title

  Scenario:
    Given I am on the home page
    Then the title tag should be "WOW App"
&lt;/pre&gt;
I create features/steps/site_steps.rb:
&lt;pre name="code" class="ruby"&gt;
Given /^I am on (.*)$/ do |page|
  visits case page
         when "the home page"
           "/"
         else
           raise "Can't find mapping from \"#{page}\" to a path"
         end
end

Then /^the (.*) tag should be "(.*)"$/ do |tag, content|
  response.should have_tag(tag, content)
end
&lt;/pre&gt;
And run it with "rake features".  What I get is:
&lt;pre&gt;
C:\dev\temp&gt;rake features
(in C:/dev/temp)
Feature: Site Layout  # features/site_layout.feature
  In order to build familiarity
  As a user
  I want to see the application name in the title
  &lt;font color="green"&gt;Scenario: Given I am on the home page&lt;/font&gt;     # features/site_layout.feature:6
    &lt;font color="red"&gt;Then the title tag should be "WOW App"&lt;/font&gt;  # features/steps/site_steps.rb:10
      &lt;font color="red"&gt;You have a nil object when you didn't expect it!
      The error occurred while evaluating nil.content_type (NoMethodError)
      ...
      ./features/steps/site_steps.rb:11:in `Then /^the (.*) tag should be "(.*)"$/'
      features/site_layout.feature:8:in `Then the title tag should be "WOW App"'


1 steps failed&lt;/font&gt;
rake aborted!
&lt;/pre&gt;
    
Not quite what I had in mind, I was expecting a failure, but got an error.  Nevermind, this is all very new to me, so I'll push on and it'll all become clear right?

I create an app/views/layouts/application.html.erb:
&lt;pre name="code" class="html"&gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;

&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
  &amp;lt;meta http-equiv="content-type" content="text/html;charset=UTF-8" /&amp;gt;
    &amp;lt;title&amp;gt;WOW App&amp;lt/title&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

Run the feature again ... no joy, same error.  Hours of web searching leads me nowhere.  Finally while looking at some examples I noticed that my Scenario doesn't have a description, so I add one on line 6:

&lt;pre name="code" class="feature"&gt;
Feature: Site Layout
  In order to build familiarity
  As a user
  I want to see the application name in the title

  Scenario: On the home page
    Given I am on the home page
    Then the title tag should be "WOW App"
&lt;/pre&gt;

Now I get:

&lt;pre&gt;
C:\dev\temp&gt;rake features
(in C:/dev/temp)
Feature: Site Layout  # features/site_layout.feature
  In order to build familiarity
  As a user
  I want to see the application name in the title
  &lt;font color="green"&gt;Scenario: On the home page&lt;/font&gt;                # features/site_layout.feature:6
    &lt;font color="red"&gt;Given I am on the home page             # features/steps/site_steps.rb:1
      No route matches "/" with {:method=&gt;:get} (ActionController::RoutingError)
...
      features/site_layout.feature:7:in `Given I am on the home page'&lt;/font&gt;
    &lt;font color="blue"&gt;Then the title tag should be "WOW App"&lt;/font&gt;  # features/steps/site_steps.rb:10


&lt;font color="red"&gt;1 steps failed&lt;/font&gt;
&lt;font color="blue"&gt;1 steps skipped&lt;/font&gt;
rake aborted!
&lt;/pre&gt;

A quick addition to config/routes.rb:
&lt;pre name="code" class="ruby"&gt;
map.root :controller =&gt; 'example'
&lt;/pre&gt;

And a stub controller from "ruby script\generate controller Example index", I get:

&lt;pre&gt;
C:\dev\temp&gt;rake features
(in C:/dev/temp)
Feature: Site Layout  # features/site_layout.feature
  In order to build familiarity
  As a user
  I want to see the application name in the title
  &lt;font color="green"&gt;Scenario: On the home page&lt;/font&gt;                # features/site_layout.feature:6
    &lt;font color="green"&gt;Given I am on the home page&lt;/font&gt;             # features/steps/site_steps.rb:1
    &lt;font color="green"&gt;Then the title tag should be "WOW App"&lt;/font&gt;  # features/steps/site_steps.rb:10


&lt;font color="green"&gt;2 steps passed&lt;/font&gt;
&lt;/pre&gt;

Hurrah!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-3207913781298910741?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=EBgMpaBE6G0:Ndx029n5y14:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=EBgMpaBE6G0:Ndx029n5y14:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=EBgMpaBE6G0:Ndx029n5y14:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/EBgMpaBE6G0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/3207913781298910741/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2008/10/cucumber-scenarios-need-title.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/3207913781298910741?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/3207913781298910741?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/EBgMpaBE6G0/cucumber-scenarios-need-title.html" title="Cucumber scenarios need a title" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2008/10/cucumber-scenarios-need-title.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcMQXs6fSp7ImA9WxRQEks.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-2266881832885991686</id><published>2008-10-05T21:21:00.003-04:00</published><updated>2008-10-05T23:01:20.515-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-05T23:01:20.515-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="sqlite3" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title>Where to put sqlite3.dll on Windows</title><content type="html">When I first started using SQLite3 on Windows, most people suggested downloading sqlite3.dll from &lt;a href="http://www.sqlite.org/download.html"&gt;www.sqlite.org&lt;/a&gt; and storing it in ruby/bin so Windows could find it.  For a while, this strategy worked fine but I really didn't like the application requiring users to put that DLL into an acceptable place.

I don't know why it didn't occur to me earlier, but, given that this is only intended to be a Windows application, why not just modify the PATH environment variable within the application.  So that's what I've done.  In config/boot.rb:
&lt;pre name="code" class="ruby"&gt;
# Make sqlite3.dll available
ENV['PATH'] += ";#{RAILS_ROOT}/vendor/bin/sqlite3"
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-2266881832885991686?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=lcJVKrhSJaI:sprtkIMO0nU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=lcJVKrhSJaI:sprtkIMO0nU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=lcJVKrhSJaI:sprtkIMO0nU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/lcJVKrhSJaI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/2266881832885991686/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2008/10/where-to-put-sqlite3dll-on-windows.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/2266881832885991686?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/2266881832885991686?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/lcJVKrhSJaI/where-to-put-sqlite3dll-on-windows.html" title="Where to put sqlite3.dll on Windows" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2008/10/where-to-put-sqlite3dll-on-windows.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUGQX0zeip7ImA9WxVSF0s.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-5447989134644827492</id><published>2008-10-02T13:08:00.008-04:00</published><updated>2009-01-12T07:43:40.382-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-12T07:43:40.382-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><title>class &lt;&lt; self</title><content type="html">I've come across this construct many times while browsing a number of open source projects:
&lt;pre name="code" class="ruby"&gt;
class MyClass
  class &amp;lt&amp;lt self
    def a_class_method
      ...
    end
  end

  def an_instance_method
    ...
  end
end
&lt;/pre&gt;
I finally got it today ... there's no black magic ... all "class &amp;lt&amp;lt self" means is:
&lt;blockquote&gt;add the following class method definitions to the class MyClass.&lt;/blockquote&gt; 
Or,
&lt;blockquote&gt;open the class MyClass, and add the following class methods.&lt;/blockquote&gt;
Now that I'm in the gang and understand this incantation, I'm not sure I like it.  It seems like a nice way to group all your class methods together, but if you define several class methods then it becomes harder to recognize whether a method belongs to the class or an instance.  I think it's cleaner to explicitly state the ownership of each method:
&lt;pre name="code" class="ruby"&gt;
class MyClass
  def self.a_class_method
    ...
  end

  def an_instance_method
    ...
  end
end
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-5447989134644827492?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=wcBpMkta6X8:11rQyt28BvM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=wcBpMkta6X8:11rQyt28BvM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=wcBpMkta6X8:11rQyt28BvM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/wcBpMkta6X8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/5447989134644827492/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2008/10/class-self.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/5447989134644827492?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/5447989134644827492?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/wcBpMkta6X8/class-self.html" title="class &lt;&lt; self" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2008/10/class-self.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8ARnc4cCp7ImA9WxVRFEw.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-4988991560115295832</id><published>2008-09-20T22:46:00.012-04:00</published><updated>2009-01-19T20:27:27.938-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-19T20:27:27.938-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="test" /><title>My first Rails bug</title><content type="html">&lt;p&gt;&lt;em&gt;UPDATE January 14, 2009 -&amp;gt; &lt;a href="http://bryan-ash.blogspot.com/2009/01/my-first-rails-bug-accepted.html"&gt;The patch for this bug was accepted!&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I'm pretty new to &lt;a href="http://rubyonrails.org/"&gt;Rails&lt;/a&gt; and my first project included uploading videos. Shouldn't be too difficult I thought, after a little Google searching, I came up with the perfect example by Jim Neath: &lt;a title="Permanent Link: Converting Videos with Rails: Converting the Video" href="http://jimneath.org/2008/06/03/converting-videos-with-rails-converting-the-video/" rel="bookmark"&gt;Converting Videos with Rails: Converting the Video&lt;/a&gt; Wanting to practice new skills with &lt;a href="http://rspec.info/"&gt;RSpec&lt;/a&gt; and &lt;a href="https://github.com/aslakhellesoy/cucumber/tree"&gt;Cucumber&lt;/a&gt; I wrote my first feature spec: &lt;/p&gt;  &lt;pre class="cucumber" name="code"&gt;Feature: Upload videos
  In order to provide videos to users after hours
  As a videographer
  I want to upload videos

  Scenario: A valid filename is provided
    Given I go to the new video page
    And I browse to the file &amp;quot;Movie_0001.avi&amp;quot;

    When I submit the upload

    Then I should see &amp;quot;success&amp;quot;
    And the file should be uploaded&lt;/pre&gt;
and the supporting steps file, upload_steps.rb: 

&lt;pre class="ruby" name="code"&gt;require 'ftools'
require 'mime/types'

When /I browse to the file \&amp;quot;(.+)\&amp;quot;/ do |path|
  @original_filepath = File.join('features/fixtures/', path)
  mime_types = MIME::Types.of(@original_filepath)

  attach_file 'video[source]', @original_filepath, mime_types[0].content_type
end

When 'I submit the upload' do
  click_button 'Create'
end

def uploaded_filepath
  uploaded_basename = File.basename(@original_filepath)
  File.join(RAILS_ROOT, &amp;quot;public/videos/1&amp;quot;, uploaded_basename)
end

Then /the file should be uploaded/ do
  assert File.compare(@original_filepath, uploaded_filepath)
end&lt;/pre&gt;
what I got was: 

&lt;pre&gt;...
    &lt;font color="red"&gt;And the file should be uploaded
      &lt;false&gt; is not true. (Test::Unit::AssertionFailedError)
      c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:48:in `assert_block'
      c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:500:in `_wrap_assertion'
      c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_block'
      c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:63:in `assert'
      c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:495:in `_wrap_assertion'
      c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:61:in `assert'
      ./features/upload/steps/upload_steps.rb:22:in `And /the file should be uploaded/'
      features/upload/upload.feature:14:in `And the file should be uploaded'&lt;/font&gt;
...&lt;/pre&gt;
On closer inspection, the test was failing because the uploaded file was truncated in some bizarre way. However, if I ran the application and manually upload a file from the browser, everything worked fine. After much hunting I ended up in rails/actionpack/lib/action_controller/integration.rb where in multipart_body, the mode is not specified in the call to File.open, so it defaults to &amp;quot;r&amp;quot;. This is all well and good on anything but Windows, which I happen to be using! Windows requires that the mode be specified as &amp;quot;rb&amp;quot; to ensure the file is read as binary. I submitted a &lt;a href="http://rails.lighthouseapp.com/projects/8994/tickets/1065-multipart_body-truncates-file-in-windows"&gt;patch&lt;/a&gt; but I'm not holding my breath for it to be pulled in anytime soon.

  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-4988991560115295832?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=H0vfrwN0TCI:eJ1pNzYlz-o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=H0vfrwN0TCI:eJ1pNzYlz-o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=H0vfrwN0TCI:eJ1pNzYlz-o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/H0vfrwN0TCI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/4988991560115295832/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2008/09/my-first-rails-bug.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/4988991560115295832?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/4988991560115295832?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/H0vfrwN0TCI/my-first-rails-bug.html" title="My first Rails bug" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2008/09/my-first-rails-bug.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EEQn84fyp7ImA9WxRQEkg.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-4951581263601731269</id><published>2008-09-20T20:34:00.001-04:00</published><updated>2008-10-05T21:13:23.137-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-05T21:13:23.137-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="embedded" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="test" /><title>Ruby PCAN DLL Wrapper</title><content type="html">Inspired by &lt;a href="http://www.atomicobject.com/pages/System+Testing+in+Ruby"&gt;System Testing In Ruby (Systir)&lt;/a&gt;, I have published a small Ruby &lt;a href="http://rubyforge.org/projects/pcanusb/"&gt;PCAN USB DLL Wrapper.&lt;/a&gt;

Now with a small &lt;a href="http://www.peak-system.com/db/gb/pcanusb_gb.html"&gt;device&lt;/a&gt; available for less than $300 and some free software, I can write automated system test scripts of the form:
&lt;blockquote&gt;send tftp_rrq("autoexec.bat").with(blksize(2036))
verify_target_sends oack(blksize(2036)

send ack(0)
verify_target_sends autoexec_bat
send ack(1)
&lt;/blockquote&gt;If you have &lt;a href="http://rubygems.org/"&gt;rubygems&lt;/a&gt; installed, PCAN DLL Wrapper is easily obtained:
&lt;blockquote&gt;set http_proxy=http://my_proxy_host.com:80
gem install pcanusb
&lt;/blockquote&gt;and then use:
&lt;blockquote&gt;require 'pcan_usb'

PCAN_USB.init(PCAN_USB::BAUD_1M)
PCAN_USB.write(0x0E100501, "Hello World!")
PCAN_USB.close
&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-4951581263601731269?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=57l0Co5gPx8:UM3vz-p5NkE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=57l0Co5gPx8:UM3vz-p5NkE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=57l0Co5gPx8:UM3vz-p5NkE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/57l0Co5gPx8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/4951581263601731269/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2008/09/ruby-pcan-dll-wrapper_20.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/4951581263601731269?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/4951581263601731269?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/57l0Co5gPx8/ruby-pcan-dll-wrapper_20.html" title="Ruby PCAN DLL Wrapper" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2008/09/ruby-pcan-dll-wrapper_20.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcERXg5eSp7ImA9WxRSGUg.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-4227048963961034066</id><published>2008-09-20T20:29:00.000-04:00</published><updated>2008-09-20T20:30:04.621-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-20T20:30:04.621-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="quotes" /><title>Collection o quotes</title><content type="html">Ricky Hustler, a friend of mine, used to use this one on a regular basis:&lt;b&gt;
&lt;/b&gt;&lt;span style="font-style: italic;"&gt;&lt;blockquote&gt;"You never see a luggage rack on a hearse"
&lt;/blockquote&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-style: italic;"&gt;
&lt;/span&gt;&lt;/b&gt;I came across this on &lt;a href="http://butunclebob.com/ArticleS.JamesGrenning"&gt;James Grenning's&lt;/a&gt; blog:&lt;b&gt;
&lt;/b&gt;&lt;blockquote&gt;&lt;span style="font-style: italic;"&gt;"It's easier to act your way into thinking differently than to think your way into acting differently"&lt;/span&gt;
&lt;/blockquote&gt;&lt;span&gt;
From a friend's coffee cup:
&lt;blockquote&gt;&lt;span style="font-style: italic;"&gt;"Lead, follow, or get out of my way"&lt;/span&gt;
&lt;/blockquote&gt;
&lt;a href="http://www.susanjeffers.com/"&gt;Susan Jeffers&lt;/a&gt;:
&lt;blockquote&gt;&lt;span style="font-style: italic;"&gt;"Feel the fear and do it anyway"
&lt;/span&gt;&lt;/blockquote&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-4227048963961034066?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=2DUG0ROwTZg:KNEAYbtG2KM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=2DUG0ROwTZg:KNEAYbtG2KM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=2DUG0ROwTZg:KNEAYbtG2KM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/2DUG0ROwTZg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/4227048963961034066/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2008/09/collection-o-quotes.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/4227048963961034066?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/4227048963961034066?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/2DUG0ROwTZg/collection-o-quotes.html" title="Collection o quotes" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2008/09/collection-o-quotes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EGR3o5eyp7ImA9WxRQEkg.&quot;"><id>tag:blogger.com,1999:blog-1151397178864889664.post-6408874248421443008</id><published>2008-06-10T20:40:00.004-04:00</published><updated>2008-10-05T21:13:46.423-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-05T21:13:46.423-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title>ActiveRecord requires RAILS_ROOT for relative Sqlite path</title><content type="html">I'm writing a little time tracking tool for Windows in Ruby. The data is stored in a database so I figured I'd use ActiveRecord and maybe learn something about Rails along the way. Everything I found about ActiveRecord tells me that it "can be used independently outside of &lt;a href="http://api.rubyonrails.org/classes/Rails.html"&gt;Rails&lt;/a&gt;".  One minor detail that I just figured out:
&lt;blockquote&gt;If you want to use a relative path for a sqlite3 database in your database.yml, you have to define RAILS_ROOT.
&lt;/blockquote&gt;For example, if config/database.yml =&gt;
&lt;pre name="code" class="yaml"&gt;
production:
  adapter: sqlite3
  database: db/production.sqlite
&lt;/pre&gt;
ActiveRecord initialization (mine's in config/boot.rb) looks like:
&lt;pre name="code" class="ruby"&gt;
RAILS_ROOT = "#{File.dirname(File.expand_path(__FILE__))}/.."
RAILS_ENV  = ENV['RAILS_ENV'] || 'production'

$LOAD_PATH.unshift "#{RAILS_ROOT}/vendor/sqlite3"
config = YAML::load(IO.read("#{RAILS_ROOT}/config/database.yml"))
ActiveRecord::Base.configurations = config
ActiveRecord::Base.establish_connection(config[RAILS_ENV])
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1151397178864889664-6408874248421443008?l=bryan-ash.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=c5xXKY0QXd0:VuDEbXJG8xI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryanAsh?a=c5xXKY0QXd0:VuDEbXJG8xI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryanAsh?i=c5xXKY0QXd0:VuDEbXJG8xI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryanAsh/~4/c5xXKY0QXd0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://bryan-ash.blogspot.com/feeds/6408874248421443008/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://bryan-ash.blogspot.com/2008/06/activerecord-requires-railsroot-for.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/6408874248421443008?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1151397178864889664/posts/default/6408874248421443008?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BryanAsh/~3/c5xXKY0QXd0/activerecord-requires-railsroot-for.html" title="ActiveRecord requires RAILS_ROOT for relative Sqlite path" /><author><name>Bryan Ash</name><uri>http://www.blogger.com/profile/16035145599734362152</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_MD9_5-JNi6w/SuyLLoXaGBI/AAAAAAAAAFY/IluPzGsMMW4/s1600-R/48d30b5cea7a69195e9082da5e0b9ff8.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://bryan-ash.blogspot.com/2008/06/activerecord-requires-railsroot-for.html</feedburner:origLink></entry></feed>

