adamsalter / sitemap_generator

This plugin enables 'enterprise-class' Google Sitemaps to be easily generated for a Rails site as a rake task, using a simple 'Rails Routes'-like DSL. It allows you to take care of familiar Sitemap issues like: Gzip of Sitemap files, variable priority links, paging/sorting links (e.g. my_list?page=3), SSL host links (e.g. https:), Rails apps which are installed on a sub-path (e.g. example.com/blog_app/) and hidden AJAX routes. It includes a Sitemap Index file so it supports more than the standard 50,000 individual urls (up to a maximum of 2.5 billion), and pings all major search engines on completion (Google, Yahoo, MSN, Ask, SitemapWriter).
MIT License
268 stars 304 forks source link

Sitemap generator loads application controller when defining itself #4

Closed richievos closed 14 years ago

richievos commented 14 years ago

This is giving me 2 issues:

  1. My classes aren't reloading properly when sitemap gets loaded into my app. I think this has to do with my sitemap referencing some classes when generating urls, but it goes away whenever I comment out sitemap from my required gems.
  2. My AppController references other classes. When I include sitemap it tries loading my app controller before all of those dependencies have been loaded, which ends up blowing up.

I think this can all be simplified by not touching application controller at all, and going directly at the underlying rails path utilities.

I think I have this working without ever touching the application controller, so I'll send a patch when I confirm.

richievos commented 14 years ago

I switched to using UrlWriter directly instead of App controller at http://github.com/jerryvos/sitemap_generator/commit/c31e88374aec08a575c1f17e2d13377d984c3c93

kjvarga commented 14 years ago

Resolved.