paths in Instiki errors will look a bit less funny
This commit is contained in:
parent
ca22e59c38
commit
2c637539be
|
@ -3,16 +3,16 @@ if RUBY_VERSION < '1.8.1'
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
RAILS_ROOT = File.dirname(__FILE__) + '/../' unless defined? RAILS_ROOT
|
RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/../') unless defined? RAILS_ROOT
|
||||||
RAILS_ENV = ENV['RAILS_ENV'] || 'production' unless defined? RAILS_ENV
|
RAILS_ENV = ENV['RAILS_ENV'] || 'production' unless defined? RAILS_ENV
|
||||||
|
|
||||||
unless defined? ADDITIONAL_LOAD_PATHS
|
unless defined? ADDITIONAL_LOAD_PATHS
|
||||||
# Mocks first.
|
# Mocks first.
|
||||||
ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"]
|
ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"]
|
||||||
|
|
||||||
# Then model subdirectories.
|
# Then model subdirectories.
|
||||||
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"])
|
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"])
|
||||||
|
|
||||||
# Followed by the standard includes.
|
# Followed by the standard includes.
|
||||||
ADDITIONAL_LOAD_PATHS.concat %w(
|
ADDITIONAL_LOAD_PATHS.concat %w(
|
||||||
app
|
app
|
||||||
|
@ -22,7 +22,7 @@ unless defined? ADDITIONAL_LOAD_PATHS
|
||||||
config
|
config
|
||||||
libraries
|
libraries
|
||||||
).map { |dir| "#{File.expand_path(File.join(RAILS_ROOT, dir))}" }
|
).map { |dir| "#{File.expand_path(File.join(RAILS_ROOT, dir))}" }
|
||||||
|
|
||||||
# Third party vendors
|
# Third party vendors
|
||||||
ADDITIONAL_LOAD_PATHS.concat %w(
|
ADDITIONAL_LOAD_PATHS.concat %w(
|
||||||
vendor/bluecloth-1.0.0/lib
|
vendor/bluecloth-1.0.0/lib
|
||||||
|
@ -35,7 +35,7 @@ unless defined? ADDITIONAL_LOAD_PATHS
|
||||||
).map { |dir|
|
).map { |dir|
|
||||||
"#{File.expand_path(File.join(RAILS_ROOT, dir))}"
|
"#{File.expand_path(File.join(RAILS_ROOT, dir))}"
|
||||||
}.delete_if { |dir| not File.exist?(dir) }
|
}.delete_if { |dir| not File.exist?(dir) }
|
||||||
|
|
||||||
# Prepend to $LOAD_PATH
|
# Prepend to $LOAD_PATH
|
||||||
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
|
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
|
||||||
end
|
end
|
||||||
|
@ -57,4 +57,3 @@ require 'wiki_service'
|
||||||
Socket.do_not_reverse_lookup = true
|
Socket.do_not_reverse_lookup = true
|
||||||
|
|
||||||
ActionController::Base.template_root ||= "#{RAILS_ROOT}/app/views/"
|
ActionController::Base.template_root ||= "#{RAILS_ROOT}/app/views/"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue