Permalink
Browse files

Fix tasks when running standalone

* Only require environment task if running Rails
  • Loading branch information...
1 parent e1f462e commit 66590645f35ec0e1e2db3e671912abeae88e06a9 @kjvarga committed Jan 17, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/sitemap_generator/tasks.rb
@@ -21,7 +21,10 @@
# Require sitemap_generator after loading the Rails environment. We still need the require
# in case we are installed as a gem and are setup to not automatically be required.
- task :require_environment => :environment do
+ task :require_environment do
+ if defined?(Rails)
+ Rake::Task['environment'].invoke
+ end
require 'sitemap_generator'
end

0 comments on commit 6659064

Please sign in to comment.