def self.included(klass)
klass.class_eval do
unless method_defined?(:load_environment_without_spork)
alias :load_environment_without_spork :load_environment
alias :load_environment :load_environment_with_spork
end
def self.run_with_spork(*args, &block)
if ENV['RAILS_ENV']
Object.send(:remove_const, :RAILS_ENV)
Object.const_set(:RAILS_ENV, ENV['RAILS_ENV'].dup)
end
run_without_spork(*args, &block)
end
class << self
unless method_defined?(:run_without_spork)
alias :run_without_spork :run
alias :run :run_with_spork
end
end
end
end