title: Can't pass args through to rake task - has the syntax changed?
body: <p>I'm using a rails 3.1.3 project which has rake (0.9.2.2).  I want to do this in a rake task: call it like </p>
  
  <pre><code>rake tale:import_kml /path/to/file.txt
  </code></pre>
  
  <p>and then inside the rake task, get access to "/path/to/file.txt" as args.filename</p>
  
  <p>I thought i would be able to do this like so (the puts is there for bit of debugging):</p>
  
  <pre><code>namespace :tale do
    desc "Expects to get a file or folder name as the first argument, and passes that to Tale.import_kml"
    task(:import_kml, [:filename] =&gt; :environment) do |t, args|
      puts "args = #{args.inspect}"
      if File.exists?(args.filename)
        Tale.import_kml(filename)
      end
    end
  end
  </code></pre>
  
  <p>But, i get this:  </p>
  
  <pre><code>** Invoke tale:import_kml (first_time)
  ** Invoke environment (first_time)
  ** Execute environment
  ** Execute tale:import_kml
  args = {}
  rake aborted!
  can't convert nil into String
  </code></pre>
  
  <p>so, filename isn't making it into args.  I can't work out what i'm doing wrong here...</p>