Skip to content

Commit

Permalink
Add a graceful fallback when eurbis is missing. Otherwise when you ru…
Browse files Browse the repository at this point in the history
…n say 'rake db:migrate' it crashes instead of displaying the 'Missing these required gems' message.
  • Loading branch information
Mateusz Drożdżyński authored and NZKoz committed Jan 7, 2010
1 parent 41d244b commit 59341ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Include hook code here
unless $gems_rake_task
begin
require 'erubis/helpers/rails_helper'
require 'rails_xss'

Expand All @@ -11,4 +11,6 @@

require 'rails_xss_escaping'
require 'av_patch'
end
rescue LoadError
puts "Could not load all modules required by rails_xss. Please make sure erubis is installed an try again."
end unless $gems_rake_task

0 comments on commit 59341ac

Please sign in to comment.