Skip to content

Commit

Permalink
Fix tasks when running standalone
Browse files Browse the repository at this point in the history
* Only require environment task if running Rails
  • Loading branch information
kjvarga committed Jan 17, 2012
1 parent e1f462e commit 6659064
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sitemap_generator/tasks.rb
Expand Up @@ -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

Expand Down

0 comments on commit 6659064

Please sign in to comment.