<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -127,7 +127,7 @@ class Thor
       @usage, @desc, @method_options = nil
     end
 
-    def register_klass_file(klass, file = caller[1].split(&quot;:&quot;)[0])
+    def register_klass_file(klass, file = caller[1].match(/(.*):\d+/)[1])
       unless self == Thor
         superclass.register_klass_file(klass, file)
         return</diff>
      <filename>lib/thor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,23 +9,13 @@ require &quot;pathname&quot;
 
 class Thor::Runner &lt; Thor
   def self.globs_for(path)
-    [
-      &quot;#{path}/Thorfile&quot;,
-      &quot;#{path}/*.thor&quot;,
-      &quot;#{path}/tasks/*.thor&quot;,
-      &quot;#{path}/lib/tasks/*.thor&quot;
-    ]
+    [&quot;#{path}/Thorfile&quot;, &quot;#{path}/*.thor&quot;, &quot;#{path}/tasks/*.thor&quot;, &quot;#{path}/lib/tasks/*.thor&quot;]
   end
 
-  # Mappings for default tasks
-  map &quot;-T&quot; =&gt; :list,
-      &quot;-i&quot; =&gt; :install,
-      &quot;-u&quot; =&gt; :update
+  map &quot;-T&quot; =&gt; :list, &quot;-i&quot; =&gt; :install, &quot;-u&quot; =&gt; :update
   
-  desc &quot;install NAME&quot;,
-       &quot;install a Thor file into your system tasks, optionally named for future updates&quot;
-  method_options :as       =&gt; :optional,
-                 :relative =&gt; :boolean
+  desc &quot;install NAME&quot;, &quot;install a Thor file into your system tasks, optionally named for future updates&quot;
+  method_options :as =&gt; :optional, :relative =&gt; :boolean
   def install(name)
     initialize_thorfiles
 
@@ -90,8 +80,7 @@ class Thor::Runner &lt; Thor
     thor_yaml[as][:filename] # Indicate sucess
   end
   
-  desc &quot;uninstall NAME&quot;,
-       &quot;uninstall a named Thor module&quot;
+  desc &quot;uninstall NAME&quot;, &quot;uninstall a named Thor module&quot;
   def uninstall(name)
     raise Error, &quot;Can't find module `#{name}'&quot; unless thor_yaml[name]
     
@@ -105,8 +94,7 @@ class Thor::Runner &lt; Thor
     puts &quot;Done.&quot;
   end
   
-  desc &quot;update NAME&quot;,
-       &quot;update a Thor file from its original location&quot;
+  desc &quot;update NAME&quot;, &quot;update a Thor file from its original location&quot;
   def update(name)
     raise Error, &quot;Can't find module `#{name}'&quot; if !thor_yaml[name] || !thor_yaml[name][:location]
 
@@ -119,8 +107,7 @@ class Thor::Runner &lt; Thor
     end
   end
   
-  desc &quot;installed&quot;,
-       &quot;list the installed Thor modules and tasks (--internal means list the built-in tasks as well)&quot;
+  desc &quot;installed&quot;, &quot;list the installed Thor modules and tasks (--internal means list the built-in tasks as well)&quot;
   method_options :internal =&gt; :boolean
   def installed
     thor_root_glob.each do |f|
@@ -167,7 +154,23 @@ class Thor::Runner &lt; Thor
   end
 
   def self.thor_root
-    File.join(ENV[&quot;HOME&quot;] || ENV[&quot;APPDATA&quot;], &quot;.thor&quot;)
+    return File.join(ENV[&quot;HOME&quot;], '.thor') if ENV[&quot;HOME&quot;]
+
+    if ENV[&quot;HOMEDRIVE&quot;] &amp;&amp; ENV[&quot;HOMEPATH&quot;] then
+      return File.join(ENV[&quot;HOMEDRIVE&quot;], ENV[&quot;HOMEPATH&quot;], '.thor')
+    end
+    
+    return File.join(ENV[&quot;APPDATA&quot;], '.thor') if ENV[&quot;APPDATA&quot;]
+
+    begin
+      File.expand_path(&quot;~&quot;)
+    rescue
+      if File::ALT_SEPARATOR then
+        &quot;C:/&quot;
+      else
+        &quot;/&quot;
+      end
+    end
   end
 
   def self.thor_root_glob</diff>
      <filename>lib/thor/runner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,8 +14,8 @@ class Thor
   def self.install_task(spec)
     package_task spec
 
-    null, sudo, gem = RUBY_PLATFORM =~ /w(in)?32$/ ? ['NUL', '', 'gem.bat'] :
-                                                     ['/dev/null', 'sudo', 'gem']
+    null, sudo, gem = RUBY_PLATFORM =~ /mswin|mingw/ ? ['NUL', '', 'gem.bat'] :
+                                                       ['/dev/null', 'sudo', 'gem']
     
     desc &quot;install&quot;, &quot;install the gem&quot;
     define_method :install do
@@ -43,11 +43,12 @@ class Thor
     
     desc(name, &quot;spec task&quot;)
     define_method(name) do
-      cmd = &quot;ruby &quot;
+      require 'rbconfig'
+      cmd = RbConfig::CONFIG['ruby_install_name'] &lt;&lt; &quot; &quot;
       if rcov
-        cmd &lt;&lt; &quot;-S rcov -o #{rcov_dir} #{rcov_opts} &quot;
+        cmd &lt;&lt; &quot;-S #{where('rcov')} -o #{rcov_dir} #{rcov_opts} &quot;
       end
-      cmd &lt;&lt; `which spec`.chomp
+      cmd &lt;&lt; where('spec')
       cmd &lt;&lt; &quot; -- &quot; if rcov
       cmd &lt;&lt; &quot; &quot;
       cmd &lt;&lt; file_list
@@ -73,5 +74,13 @@ class Thor
         &quot;--#{key} #{value.inspect}&quot;
       end
     end.join(&quot; &quot;)    
-  end  
+  end
+
+  def where(file)
+    ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
+      file_with_path = File.join(path, file)
+      next unless File.exist?(file_with_path) &amp;&amp; File.executable?(file_with_path)
+      return File.expand_path(file_with_path)
+    end
+  end
 end</diff>
      <filename>lib/thor/tasks.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>40f66fb76c9a440ea20457bad5d31ce2770bfcc9</id>
    </parent>
    <parent>
      <id>d95def274d2e5c94d1d97f0338dc08a9feb3bb4e</id>
    </parent>
  </parents>
  <author>
    <name>James Herdman</name>
    <email>james.herdman@gmail.com</email>
  </author>
  <url>http://github.com/wycats/thor/commit/867e912ad9da417e273615e69b1c97b66e210748</url>
  <id>867e912ad9da417e273615e69b1c97b66e210748</id>
  <committed-date>2009-02-04T17:14:39-08:00</committed-date>
  <authored-date>2009-02-04T17:14:39-08:00</authored-date>
  <message>Bring Thor inline with Wycats</message>
  <tree>a71ac73188e9d3af3c012a7d43a10cc59c2c0402</tree>
  <committer>
    <name>James Herdman</name>
    <email>james.herdman@gmail.com</email>
  </committer>
</commit>
