<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,8 @@
 #!/usr/bin/env ruby
 require 'fileutils'
+require 'tmpdir'
+
+TMP = Dir::tmpdir
 
 def usage(msg = nil)
   puts &quot;Error: #{msg}&quot; if msg
@@ -18,16 +21,16 @@ def usage(msg = nil)
   puts &quot;    ...&quot;
   puts &quot;  end&quot;
   puts
-  puts &quot;A copy of the old file will be left under /tmp/ in case this script just seriously screws up&quot;
+  puts &quot;A copy of the old file will be left under #{TMP} in case\nthis script just seriously screws up&quot;
   puts
   exit (msg ? 2 : 0)
 end
 
 usage(&quot;Wrong number of arguments.&quot;) unless ARGV.size == 1
-usage(&quot;This system doesn't have a /tmp directory.  wtf?&quot;) unless File.directory?('/tmp')
+usage(&quot;Temp directory '#{TMP}' is not valid. Set TMPDIR environment variable to a writeable directory.&quot;) unless File.directory?(TMP) &amp;&amp; File.writable?(TMP)
 
 file = ARGV.shift
-tmpfile = &quot;/tmp/#{File.basename(file)}&quot;
+tmpfile = File.join(TMP, File.basename(file))
 usage(&quot;File '#{file}' doesn't exist&quot;) unless File.exists?(file)
 
 FileUtils.cp(file, tmpfile)</diff>
      <filename>bin/convert_to_should_syntax</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>630ce1744374c51e4e8e588caf4cecfc056e73fa</id>
    </parent>
  </parents>
  <author>
    <name>Bob Showalter</name>
    <email>showaltb@gmail.com</email>
  </author>
  <url>http://github.com/thechrisoshow/shoulda/commit/abc3aa73a49502c874d4b3b184d1e94d075492a0</url>
  <id>abc3aa73a49502c874d4b3b184d1e94d075492a0</id>
  <committed-date>2008-07-30T05:25:25-07:00</committed-date>
  <authored-date>2008-07-29T12:59:43-07:00</authored-date>
  <message>convert_to_shoulda_syntax: use Dir::tmpdir instead of hardcoded /tmp</message>
  <tree>40c4e28de397e200351e4ee1fd7eca73af8028d6</tree>
  <committer>
    <name>Ryan McGeary</name>
    <email>ryanongit@mcgeary.org</email>
  </committer>
</commit>
