lib/git-precommit/tasks.rb in git-precommit-1.2.1 vs lib/git-precommit/tasks.rb in git-precommit-1.2.2
- old
+ new
@@ -1,5 +1,10 @@
-ENVIRONMENT = Rails.env || RAILS_ENV
+if defined? Rails
+ ENVIRONMENT = Rails.env
+else
+ ENVIRONMENT = RAILS_ENV || "development"
+end
+
if %w[development test].include? ENVIRONMENT
require "git_precommit"
GitPrecommit::PrecommitTasks.new
task :environment => ".git/hooks/pre-commit"