Google sitemap for Ruby on Rails website

I was building a Google site map for using their generator (in python). Using the generator is very easy: just edit the config file according to the comments included the example. You can configure the generator to analyze access logs of your webserver to extract URLs to put in the sitemap. You can also pass a simple text file listing URLs which you want to be included, useful for example if you launch a new website, with not all urls present in the access logs. That made me think that it should be possible to automate the build of that list for a Rails website as urls are based on the name of the controller and the action called. Usually, it follows this example. This controller
  class CustomerController < ApplicationController
    def index
    def list
will be accessible through these URLs:
I have coded a mini script building these url for a rails project. It works also for controllers in a subdirectory: < pre> class Admin::CustomersController < ApplicationController def list end end which is accessible at
To run the script, you download the gen_url_list.rb file, save it in the lib directory of your rails project, edit it ( see end of the script) , and call it by running this (from the root dir of your rails project):
ruby script/runner "require 'gen_url_list'"
All generated URL are printed on stdout and you can redirect it to a file. You can then refer this file in the config.xml of the sitemap generator:

and run the generator: --config=config.xml
The generator will then include all URLs present in the list extracted from your rails project. Limitations: doesn't use Rails routing. I'm not sure how I could have access to the url_for method from the script. Suggestions welcome.